My children, listen closely, for the ritual practice of today’s message will bring you all one step closer to salvation. The software world of today (specifically, web-software) sucks. There are hundreds — no, thousands — of web “programmers” creating scripts and programs that automate every little task, and implementing every small and large application imaginable. There are guestbooks, webstats, photo galleries, weblogs, directories, email gateways, paging gateways, news readers, friends lists, web-comic archives, update notification scripts, discussion forums, chat clients, online journals, stock quote grabbers, weather information retrievers, bathroom occupancy notifications, webcams, and many many more. This is great. This is wonderful. This is what God wants. Many of these scripts and applications are being released to the Internet public as shareware, under the GPL, or as open-source software in one way or another. This, too, pleases the Lord. However, all this effort is futile when the finished product is incapable of integrating or communicating with anything else, and when it is designed in such a fashion that, unless a user chooses to rewrite massive amounts of the code, all instances of the application look exactly the same, or very similar. Nothing angers our God more than this.
There are hundreds of programming languages employed to make websites come alive with less effort, more dependability, and higher usability. Languages like PHP, Perl, Python, Ruby, C, bash, and others. Some of these languages make developing reusable, customizable code a breeze. Yet the programmers do not use these features, or use them so poorly, they may as well not use them at all. Our Lord understands that applications developed in different programming languages may not communicate and integrate with one another. He accepts this, for now, as a deficiency in our technology and will provide us with proper tools when we are ready. But applications built in advanced, modular programming languages should be capable of integrating with other applications of the same language with ease. And when they don’t God cries. Listen to me, my children. Do you want to make God cry? Of course not.
Modern programming languages are Object Oriented, at least to some degree. If you are building code that you intend to release to the public, and you aren’t authoring it using such modern concepts, you are doing the software world an injustice and, because of this, God hates you. Yes, it may seem like a lot of extra work to write your small script that steals the current stock price of RedHat (RHAT) from Yahoo!’s finance page to display proudly on your own in a way that allows customization and modularity, but it is worth it.
You may be thinking, “Why bother? Plenty of people will benefit from the use of this script as it is.” This may be true, but think ahead just a little, my child. After your first 10 users follow your instructions of mashing your script into their web root, changing the extension of their homepage to .php and adding <?php include("myshittyscript.php"); ?>, you’ll, no doubt, receive an email asking how to make it pull a different stock quote. This will be no problem. You’ll modify your script to get the stock quote to grab from another file and tell the users to place their ticker symbol in there. But the requests and alterations won’t end. After several months, and many more users, your script will most likely enable users to get information on any stock they want, display historical data and graphs on its progress, cache the information to promote quicker display times, and display all of this information in pretty HTML. You’ll even include a nice admin interface for adding new stocks and deciding what information should and shouldn’t be shown.
Your script is large, very useful, and you’ve put a lot of work into it. Go you. But it still sucks. And God still hates you. Why? Because, your script only works your way, it only looks the way you want it to look, and anyone who uses your script must do things your way. If there is a user who only wants to look up the current market value of RedHat, they will be forced to have this information formatted your way, and configured as you see fit. Additionally, let’s assume that another programmer is working on a piece of stock portfolio management software. With your script as it is, it is useless to him. He must reimplement all of your hard work in order to provide stock lookup features in his application. However, had you, from the beginning, written your application modularly, and allowed the output of it to be customizable, the world would be much happier. Stupid users would still have the stock quote, and it would still look exactly as you designed it. More advanced users would retemplate the stock quote and customize it to include the information they want to see, and the programmer creating the stock portfolio management software would be able to reuse your lookup code in his own application with little to no work. You’re happy, your users are happy, programmers are happy, website developers with dreams to include stock quotes on their pages choose your script over others, and, most importantly, God doesn’t hate you any more.
Today’s message is this, my children: modularity and customization are the keys to good, reusable programming. They make the world happy, and they put a nice big smile on God’s face.
To use a more realistic example, take forum software created in PHP as an example. There are at least 50 different software packages to choose from. That means at least 50 people (most likely many more) have taken the time and effort to develop a very valuable tool. They have invested many hours thought, and programming, and debugging to create the application that does everything they need it to do. The funny thing is, all 50 of these applications do just about the same thing. If the very first application of this type were written modularly, it is possible that every author thereafter would have merely used this initial piece of code, customizing it for their own use. If that author found a better, faster way to do something, those changes could be made and then communicated back the original author who would upgrade the software package providing the world with an even better tool in their hands. Users who just want a forum, would download the software and use it right out of the box. Those who want the forum to integrate more closely with their website would customize it appropriately. Programmers could reuse the forum code to enable a commenting system in weblog software, or implement a ticket tracking system for helpdesks.
The world is better when code is reusable. This allows all users to be happy, and allows programmers to make the wheel better, as opposed to inventing it all over again. And, most importantly, if you write reusable code, God wont hate you anymore.
Think about it.