OK, so this isn’t really about the design and implementation of large projects.? Rather it is about the perception of the design and implementation of large projects.? Just to put numbers to things, lets assume that in this context I am referring to a 10 developer project that has been under development for 3+ years.
Now imagine for a moment that you are a new developer assigned to this project.? You come in and open the project for the first time and all you see is a mess of code.? Huge methods with interlocking dependencies.? Even the simplest task seems to involve multiple areas of the code.? Changes you make seem to cascade into unrelated areas of code.? The project seems headed for disaster.
When faced with this problem, there are generally 2 responses.?
The first approach is to assume that you are basically an idiot.? I rarely see developers take this approach, and I can’t really blame them.? We all want to be the super-star.? We all want to be the guy/gal with the answers.? That is why the next approach is so seductive – you can become the one with the answers by default.
The other response is to immediately begin a campaign of improvement.? You talk to management.? You promote aggressively refactoring and rewriting the entire code base.? You suggest simplification.? You point out unnecessary code.? You demand unit tests so that the suggested rewrite won’t break anything.? You tirelessly work to point out all the flaws in the design and how they can be fixed.
You attempt to enlist others in your campaign, but can’t seem to find any supporters, except for maybe that other new guy who joined last month.? When you approach the more experienced folk they just shrug their shoulders and claim that “it works”.? Frustrated by the experience, you transfer over to a smaller team where they do things *right*.
This happens so often it has almost become a cliche.? Large projects are littered with awful code and design, while small projects excel at being lean and simple.? Of course, I happen to think that is absurdly false.? Small projects have just as many inconsistencies as large projects do, its just the scale of the project reduces the total number.?
If you were to take the first approach suggested, and assume that there is a historical context to the project, you would then be able to put the design and development into that context.? Suddenly, you might understand why the GUI layer talks directly to the database during a save instead of via the business layer (because when you moved to version 1.3, you found that the overhead of the new business object translation caused an unacceptable degradation in performance).
Suddenly, you might notice that the more experienced members of the team are able to make changes in a reasonable amount of time with little or no side-effects.? You might notice that they are able to add new features without introducing defects or regressions.? Over time, you might even notice that you are able to make changes more efficiently.?
You might even come to understand and respect the stability and well-understood nature of the mature code base.
The idea that you can come into a large project and suggest meaningful large-scale design improvements within a month or two of joining is laughable.? In just the hypothetical project I mentioned there is over 30 years of development-hours embedded in the code.? To suggest that you can understand that well enough to embark on a redesign and/or a rewrite of the code in such a short period of time is to suggest that you don’t even understand the context of the problem, much less what is needed to fix it.
So when confronted by a large project that seems to be a complete disaster, give it time.? Learn the code.? Watch the more experienced developers and learn how they view the code.? Once you think you understand the code base, keep learning.? Wait an equivalent amount of time and re-evaluate where improvements could be made.? If after all this, you still feel the code is in need of a major overhaul, then go ahead and embark on your campaign to improve it.?
Now you are operating from a position of experience and understanding.? You are not simply making suggestions you don’t fully understand.? The rest of the team will be able to see that and will no longer simply dismiss your ideas as naive.?
Of course, you may find you have become one of those old developers who shrug their shoulders at the new guy who keeps spouting off about this and that.