Monday, July 14, 2008

What I've learned about programming, part 4

Building a large application is complicated and most of what I've learned about programming is ways to try and make those complicated systems simpler. One powerful way is to build a container that factors out some aspects of your program so that you don't have to worry about those aspects while writing programs. 

For example, memory management can be factored out of your program by running your software in a garbage collected environment. Application servers like Websphere and Tomcat factor out protocol processing and concurrency control. Portals factor our UI design and authentication/authorization. Cron lets you factor out scheduling when your program should run. CICS and transaction monitors factor out the complexity of dealing with transactions. Going even further, operating systems externalize naming, hardware abstraction, physical memory size etc.

Usually, I find that what I'm writing is not that unique. Someone has written something like it before and if I can find some sort of container to run my code then I'll end up writing less boiler plate code myself. Or, if it's a large project it may be worth writing my own container and other people on the project can write code that plugs into the container.