When you developing new version of a product you usually think about rewriting from scratch instead of refactoring and adding new functionality with help of hummer and nails. Lets skip questions “why we should” and “when we should” because each of them is a topic for separate article. We will discuss potential problems and possible solutions for “development from scratch” mode.
Usually, the first problem is development environment change and new development tools. When you move from one programming language to another or change technologies, third party libraries or something else there is always a risk of potential problems with it. That is why you shouldn’t start using new technology/language before you have at least few experts in it. In general the idea to learn new technology/language by developing a real important project is bad. Pilot project should go first and in pilot project you may resolve all potential technical problems. It is better to blog about pilot project progress and problems, in this case you can always obtain list of problems/solution.
The second problem (and the most significant) is that development from scratch leads to repeating bugs and issues that were already fixed in previous product. The simplest way to solve this problem is try to repeat all issues from previous version of product in current version It’s possible if you used Bug Tracking practice, but if not, you are in troubles. And in any way it will be hard, because there can be thousands of issues. Also it doesn’t insure against new issues in a new product.
Another way is usage of Test Cases from previous project. If project was developed accurately then every idea, every business rule, every potential issue was reflected in proper Test Case. Usage of Test Cases from previous product version helps control quality from the start.
The third problem is should you use or not some parts of code from previous project. On the one hand you save time by reuse already developed and tested code, on the other hand you developing from scratch to stay away from the mess of old code. In most cases you should refactor before reuse that will solve the problem.
In general development from scratch is not recommended, but to be frankly, usually we do not start new version of product completely from scratch. We have documentation, user’s requests, issues database, project backlog, test cases and many other useful stuff from previous project which can be and should be used. We just re-writing code :-)
With years the software development becomes more and more complicated. I remember 8bits CPU assembler for home computers. You only need to understand very few basic principles to write a program on it. Also there weren’t many syntactic constructions in it. However, assembler allowed creating any program you want. Assembler is easy to learn. I doubt that experienced developer who hadn’t know asm before will not learn it in one or two days to write programs.
As for me, Assembler has only one problem: to write even simple program you need to type many lines of unobvious code, which is hard to read and understand. This brings us to a higher level: Pascal and C were really powerful languages. They were simple, almost like assembler. But a problem appeared on the scene. The name of the problem was ‘libraries’. First libraries were simple, but to be effective you had to know these libraries.
The next step was made with appearing of Object Oriented languages such as C++. OOP is great paradigm and improves development performance. However it needs additional knowledge beside the language. To learn OOP (from my point of view) one needs 2-3 years of development experience. With appearing of OOP many libraries were born. To be effective you had to know something monstrous such MFC.
Time passed and new language extensions appeared. I mean templates in C++ and libraries written with them. From one side these libraries greatly improved developers’ performance by covering common programming patterns such lists, arrays etc. From other side you need to learn new library. Understanding of templates and learning standard template library will takes more than a year.
As shown above to be effective with C++ you need 5+ years of experience (3 year of OOP paradigm and 2 years for language itself and common libraries). Modern languages C# or Java require a year or two less. So, to be effective programmer in one of the modern language (such C++, Java or C#) you need 3-5 years of experience.
Also I have a feeling that all code we are writing with help of fashion features (such as drag and drop with AJAX) is like repairing an engine through exhaust. I am asking myself why Microsoft or someone else doesn’t develop a technology which allows writing web application from start to finish using only one base language. Let it be completely new browser, new Windows and new DevStudio, but please, please, please only one language…
1.5 years ago I’ve posted about NEO. NEO is .NET based O/R Mapping Framework. It is interesting what was changed in NEO since 2005. In general, not so much. Almost all old problems are there and very few (but handy) improvements have been introduced.
Not so great performance for complex domain models. Maybe it is a common problem for all O/R mappers, but I think NEO lacks some features that help to speed up things, like aggregates, paging and cache.
No way to create things like paging with one query. In fact NEO forces you to write most logic in the domain model, which may be good for one, but not good for another. With NEO you have no choice.
Intrusive ObjectContext spreads through all application layers, so migration to other persistence mechanism is hard. I think this problem may be resolved, but I don’t know how at the moment.
Still no inheritance… That hurts.
annoying problem with TEXT field for SQL Server (does not work out of the box, can be fixed in NEO code though)
Slow development. NEO progress is quite slow, I understand that it is an open source, but NHibernate is incomparable with NEO.
Strength (new during last 1.5 years)
‘Spans’ feature helps hit database less often (very useful!). It allows select related entities in a single query. For example, you have a list of projects and each project has several releases. With spans you may retrieve all projects with releases in a single query with sub-select.
As you see, with years NEO becomes better, but very slowly and can’t compete with major frameworks like NHibernate.