ALT.NET
If there is dissatisfaction with the status quo, good. If there is ferment, so much the better. If there is restlessness, I’m pleased. Then let there be ideas, and hard thought, and hard work. If man feels small, let man make himself bigger – Hubert Humphrey
A few years ago I was fortunate enough to turn a corner in my programming career. The opportunity for solid mentoring presented itself, and I took full advantage of it. Within the space of a few months, my programming skills grew exponentially and over the last couple years, I’ve
continued to refine my art. Doubtless I still have much to learn, and five years from now I’ll look back on the code I write today and feel embarrassed. I used to be confident in my programming skill, but only once I accepted that I knew very little, and likely always would, did I start to actually understand.
My Foundations of Programming series is a collection of posts which focus on helping enthusiastic programmers help themselves. Throughout the series we’ll look at a number of topics typically discussed in far too much depth to be of much use to anyone except those who already know about them. I’ve always seen two dominant forces in the .NET world, one heavily driven by Microsoft as a natural progression of VB6 and classic ASP (commonly referred to as The MSDN Way) and the other heavily driven by core object oriented practices and influenced by some of the best Java projects/concepts (known as ALT.NET).
In reality, the two aren’t really comparable. The MSDN Way loosely defines a specific way to build a system down to each individual method call (after all , isn’t the API reference documentation the only reason any of us visit MSDN?) Whereas ALT.NET focuses on more abstract topics while providing specific implementation. As Jeremy Miller puts it: the .Net community has put too much focus on learning API and framework details and not enough emphasis on design and coding fundamentals. For a relevant and concrete example, The MSDN Way heavily favors the use of DataSets and DataTables for all database communication. ALT.NET however, focuses on discussions about persistence design patterns, object- relational impendence mismatch as well as specific implementations such as NHibernate (O/R Mapping), MonoRail (ActiveRecord) as well as DataSets and DataTables. In other words, despite what many people think, ALT.NET isn’t about ALTernatives to The MSDN Way, but rather a belief that developers should know and understand alternative solutions and approaches of which The MSDN Way is part of.
Of course, it’s plain from the above description that going the ALT.NET route requires a far greater commitment as well as a wider base of knowledge. The learning curve is steep and helpful resources are just now starting to emerge (which is the reason I decided to start this series). However, the rewards are worthwhile; for me, my professional success has resulted in greater personal happiness.
Goals
Although simplistic, every programming decision I make is largely based on maintainability. Maintainability is the cornerstone of enterprise development. Frequent CodeBetter readers are likely sick of hearing about it, but there’s a good reason we talk about maintainability so often – it’s the key to being a great software developer. I can think of a couple reasons why it’s such an important design factor. First, both studies and firsthand experience tell us that systems spend a considerable amount of time (over 50%) in a maintenance state – be it changes, bug fixes or support. Second, the growing adoption of iterative development means that changes and features are continuously made to existing code (and even if you haven’t adopted iterative development such as Agile, your clients are likely still asking you to make all types of changes.) In short, a maintainable solution not only reduces your cost, but also increases the number and quality of features you’ll be able to deliver.
Even if you’re relatively new to programming, there’s a good chance you’ve already started forming opinions about what is and isn’t maintainable from your experience working with others, taking over someone’s application, or even trying to fix something you wrote a couple months ago. One of the most important things you can do is consciously take note when something doesn’t seem quite right and google around for better solutions. For example, those of us who spent years programming in classic- ASP knew that the tight integration between code and HTML wasn’t ideal.
Creating maintainable code isn’t the most trivial thing. As you get started, you’ll need to be extra diligent until things start to become more natural. As you might have suspected, we aren’t the firsts to put some thought into creating maintainable code. To this end, there are some sound ideologies you ought to familiarize yourself with. As we go through them, take time to consider each one in depth, google them for extra background and insight, and, most importantly, try to see how they might apply to a recent project you worked on.