What is the definition of "legacy code"? [duplicate] - definition

This question already has answers here:
Closed 12 years ago.
Possible Duplicate:
What makes code legacy?
What is the definition of "legacy code"?

Channeling Michael Feathers: Code without tests.

I can't remember where I saw the expression (Pragmatic Programmer?) but one way to think about it is code is legacy code as soon as it's written.
Generally it's referred to code that gets inherited by a team or a programmer from somewhere else (external or internal).
I prefer the former definition, though. :)

Code someone else written (usually someone no longer available for any contact), but you must deal with it now.

Code written by others or under a previous language, architecture, methodology, or framework that pertains to the current project.

I would say that legacy code is (usually old) code that can be rewritten using better programming techniques or languages. Legacy code usually is not easily rewritten because of dependencies on that code.

Related

What is the usage of a class? [duplicate]

This question already has answers here:
VB.NET What is the purpose of a class or module?
(7 answers)
What's the point of OOP?
(45 answers)
Closed 8 years ago.
I understand how to create a class. I understand how to work with it in normal situations. However, I don't see the point of the reason. Can someone give clarification?
Well the point is to make coding more manageable. easier to add and ASSOCIATE functions, properties attributes etc than individually coding them as separate entities.
For instance you write functions to change system sound, one to increase it, other to decrease it and third to mute it. In non-OO languages they would literally be like Increasesoundfunc, Decreasesoundfunc and mutesoundfunc. while in OO they'd be like Soundclass.inreasesound, Soundclass.decreasesound ,Soundclass.mutesound . Horrible example, but you get the point.
Return to the Basics... A Class supposed to be a representation of an object from the real live, most of the time this is true, maybe its only how the computer its able to understand us.
Something its true about the classes: everything, every system, dll, framework, control, etc, etc, was made from a lot of classes.
hope it help you.... :)

Good language to implement for senior project? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
Its my last semester of college and I have to do a big presentation in December. I plan on designing a small language that not only works, but also has some nifty features to go with it. Does anyone have any interesting syntax ideas or features that would impress my professors?
Note: I do not want to just copy a language and reimplement it. Im looking to do a little research and try some new ideas out.
I have a crazy idea.
There are compilers that compile compilers. This is fun enough by itself.
You can implement one in the MetaII style (read this other SO answer:
Are there any "fun" ways to learn about Languages, Grammars, Parsing and Compilers?)
What makes this doable for a student project is that the MetaII compiler is remarkably small, and
the technical paper (read the other answer) has everything you need in 10 pages
except some sweat, which you supply. And this fits
well in the time frame you have available (which is frankly pretty short for as student
to just sit down and whack out a compiler by himself).
MetaII's own description of itself is remarkably terse: only some 50 lines(!).
And since it can compile itself, it can compile enhanced versions of itself... so
you can use it to bootstrap much more complicated compilers. Normally, that's the
direction most people want to take it, since MetaII by itself is fairly simple.
Here's the crazy idea: You can also use it to compile less capable versions of itself.
The question is, how much can you take out, and still be able to climb back up the
metacompiler ladder? How small a compiler can you build that is still bootstrappable?
I know for a fact that MetaII has 2 items are removable, since I've done
this in the long distant past. I'm not going to tell you what they are becuase
that spoils the discovery process. But its good in a student project to take
on something that is already known to be doable, so you don't go down alleys
that have real dead ends.
One of the people I'm knew long ago apparantly tried to do this seriously. His goal was to reduce this to a very short string of characters... think of this as "compiler DNA".
Whilst I might not be able to answer your question directly, I am sure this will give you some insights from my own experience - given, for a final year project I also attempted my own scripting language (in C++) - although I am aware you're attempting a compiler so there might not be similarities. Please learn from my mistakes.
From experience:
What you imagine the scripting language will do (you type in a command, does something nifty like it fixes windows or something) and what it actually does (you type in a command, but minutes later it crashes) can often be two different things. Keep it realistic.
Aside from the brain imagining this fantastic finished product (with no inbetween), it also has a tendency of deluding itself on it's own capabilities (like 'other programmers made that mistake but I won't!'). Chances are you do make the same mistakes, or if not the same, different mistakes.
The brain has a poor ability to assess time required (if it's thinking 'it's just a hack job that'll take a month' - think again), and time it thinks is required should be multiplied between 5 to 10 times (if not more) to get an accurate idea of real scope needed. Keep to the lengthy end of the scope - worse-case scenario.
Unexpected pitfalls. Like 'how do I implement multi-precedented logic statements' and 'it's taking longer than I expected (see 3.)'. Be willing to give up complicated matters.
Design. Don't just look for ideas, think about whether or not it's a viable project, and look at how you're going to implement the groundwork before jumping to the complicated stuff (see 1.). Laying the groundwork early on can save you time. And don't forget design documents.
Research. Chances are that function you plan to write out, has already been written before somewhere. Research for it. This will save you time. Do not reinvent the wheel and do not be concerned about efficiency (university is about learning).
As one commenter said, start simple, get it working, then expand.
Best way to develop useful ideas, is to see what really bothers you about a certain task or certain scripting languages, and build it so you can eliminate or minimise that task. For example, I got annoyed by having to keep downloading files from a website and sorting it manually into specific folders - so I built a program to do that for me.
Don't go general-purpose for such a small project. Find a niche where you would like to be able to program a solution to an everyday problem. Off the top of my head, how about a constraint language for window placement in your X11 window manager of choice?
If you're just looking to have some fun, then you should try and create your own 'esoteric language'. 'Brainf**k' has kinda achieved meme status in the community (If I'm not wrong)
http://en.wikipedia.org/wiki/Esoteric_programming_language

What do you do when a library you use is no longer maintained? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
One thing I've always found frustrating is when a library I use is no longer maintained. Even looking at update history and community beforehand, I've run into the situation where I check back later to find that the version I'm using is the last version.
Generally this goes unnoticed until a few months have passed, or some bug/limitation has been found. I run into this fairly often when coding in Python, because my desire to upgrade to a new version of the interpreter can easily introduce problems in libraries that worked fine before. My question is: what is the best response to this situation?
Do you become the maintainer of the old library? Even if you're only fixing the bugs you care about, this is still a lot of work. Especially if the library is large, complex, and has less-than-well-documented code (the case more often than not).
Do you switch to a different library (if there is one)? This is also a significant undertaking, with the potential to introduce new bugs, especially if the only alternatives approach the problem from a different angle. This can be true even if you had the foresight to write an abstraction layer for the old library's functionality.
Do you roll your own? It probably ends up as less code than the old library, since you only write the parts you care about. It's therefore easier to maintain in the future. But now you've wasted days/weeks/months to produce something that is probably less functional, and is guaranteed to introduce tons of new bugs.
I realize the answer depends on the specific case: the size of the library, whether source is available, how maintainable it is, how much of it your code uses, how deeply your code relies on it, etc. I'm looking for answers across a range of cases. What are your experiences with this problem?
Well, you've found one argument to lessen the number of external dependencies...
I've come across this in several Java projects I've audited; it seems people have a tendency to drop in a Jar found somewhere on the Web for the tiniest amount of reuse possible from it. The result is a mess of dependencies that ends up undermining the code base. I prefer to use external components sparingly.
It's probably most useful to ask what you can do before. Make a point of evaluating the future lifetime of an external component before you start using it. Do some research on how large its developer community and its user community are. Also, prefer to use a component that has one or two "lesser" alternatives which you could also use.
If there's something you're tempted to use, but it has only one or two people working on it and isn't used much beyond their own project, then you should probably roll your own - or join forces with the maintainers of the component.
I think your really answer is in how do you select third party libraries to include in your code.
If you happen to like constantly upgrading your code to the latest version of the language then by default you can only use libraries that have active communities behind them
In fact I would go as far as saying that the only time that you want to use a third party open source library is when the community behind it is large (say at least 40+ users) and it has undergone a few releases.
For a commercial library the same thing applies how long is the company going to be around and how many other clients use it.
If you can't find a library in this position then ensure that you abstract the third party library out of your code so replacement isn't hard in the future.
When the Java EE framework my employer chose went belly up, we went out and found a newer, better one. Fortunately Spring was available.
We prefer to roll our own for that very reason. We end up with full control over it, full knowledge of how it works, and we can change it any way we want. When our ass is on the line when the blame game is played, we prefer to reduce the risk and do it ourselves.
We had a situation once where we did use an external library, and it got rewritten and repurposed by the author and no longer did what we expected. We rolled over that, wrote our own version, and continued safely.
The bottom line is safety, and minimization of risk.
If the source is available, the licence is open and the library does the job really well, you have the option to fork the library. By doing this, you can also add new features to it. If the library has lots of things to fix and the code is a mess, it is better to find something else to work with.

Unit Testing Framework for Oracle PL/SQL? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I've seen the question (and answer) when posed for MS SQL Server, though I don't yet know of one for Oracle and PL/SQL. Are there xUnit style testing frameworks for Oracle's PL/SQL? What are they?
The most commonly used is probably utPLSQL
The original author of this toolkit now works for Quest, which has a commercial PL/SQL unit testing application.
The last version of SQL Developer includes an Unit Test suite very interesting.
I have created and using PL/SQL unit testing framework using Ruby library ruby-plsql.
It provides much shorter and more readable tests than utPLSQL and gives more flexibility compared to GUI tools (like Quest Code Tester or SQLDeveloper 2.1).
PLUTO appears to be very new, and there doesn't appear to be a lot of documentation. So I would be concerned that you'd be working through a decent number of bugs to get things working. utPLSQL has been around for a number of years and pretty widely deployed, so there have been a lot more bug fixes and a lot more people who can help out if you run into problems.
Additionally, and not to disparage anyone, but Steven Feuerstein, who wrote utPLSQL is one of the most recognized PL/SQL experts in the world. While I'm sure the author of PLUTO is a perfectly competent developer, I don't believe he has anywhere near the reputation Steven has.
I found this question searching for a PL/SQL unit test framework. I've found an article where PLUTO's developer argues for it:
... there are a few products that help PL/SQL programmers test their code. Quest Software has a product called Code Tester for Oracle; however, the free version is cripple-ware and the for-pay version just adds one more obstacle for you to have to get by in convincing your organization to start testing. There is also a utPLSQL project that was abandoned a few years ago and it is starting to suffer from bit rot.
I've recently used successfully unit testing framework of PL/SQL Commons toolkit (see also author's slides). The toolkit is not yet publicly available (at the time of the writing) but if you drop an email to the authors you'll get a working package (or at least I got).
I also found another library: PLUTO - has anyone used these and can compare/contrast them?
We use DBUnit. It integrates nicely into a continuous integration tools like Cruise Control, though developers need to learn a little Java. Templates, utilities and code samples helped our pl/sql developers get up to speed quickly.
Haven't used any, but last realese of utPLSQL was on July 2005 and since the author is the same from the commercial code tester for oracle (http://www.quest.com/code-tester-for-oracle/) I don't think we'll be seeing much of utPLSQL in the future if any, so I think I'll take my chances with PLUTO (2008)
I looked at all of those, but the only one I liked was PLUnit. It does seem to have been abandoned by its maintainers (I had to tweak the scripts to make them install). But the API is extremely simple, and it doesn't try to force an OOP/xUnit approach into PL/SQL.

First impressions of the Fantom programming language? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
Has anyone here given the Fantom programming language a whirl? (pun intended).
My first impression:
I like the ability to have the code run on either the .NET or Java VM.
The syntax is nice and clean and does not try anything fancy.
I have a belief that "the library is the language" and the developers of Fan believe that their USP is their APIs:
But getting a language to run on both Java and .NET is the easy part - in fact there are many solutions to this problem. The hard part is getting portable APIs. Fan provides a set of APIs which abstract away the Java and .NET APIs. We actually consider this one of Fan's primary benefits, because it gives us a chance to develop a suite of system APIs that are elegant and easy to use compared to the Java and .NET counter parts.
Any other thoughts, first impressions, pros and cons?
It looks very inspired by Ruby. It says that it's RESTful but I don't see how exactly. Compare with boo, which is more mature yet similar in many ways (its syntax is Python inspired, though).
The design decisions to keep generics and namespaces very limited are questionable.
I think their explanation sums it up:
"The primary reason we created Fan is
to write software that can seamlessly
run on both the Java VM and the .NET
CLR. The reality is that many software
organizations are committed to one or
the other of these platforms."
It doesn't look better than all other non-JVM/.NET languages. In the absence of any information about them (their blog is just an error page), I see no reason why they would necessarily get this righter than others. Every language starts out fairly elegant for the set of things it was designed for (though I see some awkwardness in the little Fan code I looked at just now) -- the real question is how well it scales to completely new things, and we simply don't know that yet.
But if your organization has a rule that "everything must run on our VM", then it may be an acceptable compromise for you.
You're giving up an awful lot just for VM independence. For example, yours is the first Fan question here on SO -- a couple orders of magnitude fewer than Lisp.
For what problem is Fan the best solution? Python and Ruby can already run on both VMs (or neither), have big communities and big libraries, and seem to be about the same level of abstraction, but are far more mature.
I have never heard of Fan until a couple of weeks ago. From the web site, it is about one year old so still pretty young and unproven. There are a couple of interesting points however: First the language is tackling the problem of concurrency by providing an actor model (similar to erlang) and by supporting immutable objects. Second, the object follows the example of Scala with type inference. Type inference allows the programmer to omit type declarations but have it computed by the compiler providing the advantage of short and cleaner code as in a dynamically type language while preserving the efficiency of a statically type language. And last, it seems like a very fast language, nearly as fast as Java and really close or beating the second fastest language on the JM: scala. Benchmark showing the performance can be found at http://www.slideshare.net/michael.galpin/performance-comparisons-of-dynamic-languages-on-the-java-virtual-machine?type=powerpoint.
This is very interesting.
Java (or C#) was created in order to eliminate Platform dependency by creating a JVM (or CLR) that will compile the code into a specific machine code at run time.
Now , There is a languege which is Virtual Machine independent? umm .... what the hell?!?!
Again , this is a very interesting topic , That might be the future...:) going to one universal single languege
I think it looks like a great language feature-wise, but I'm not sure how useful it is. I don't think it is all that useful to target .NET and JVM. Java is already cross-platform, and .NET is too, with Mono. By targeting two VMs, you have to use only the APIs that are available on both. You can't use any of the great native APIs that are available for Java and .NET. I can't imagine that their API is anywhere near as complete as either Java's of .NET's.