Back in the day computer programming was more of an ordeal than it is now.
A computer programmers job is to take an idea, turn it into a set of instructions, and write code in a programming language that tells the computer what those instructions are. The computer then takes the resulting program and does whatever it was told to do. All of these instructions contained in this program, at their lowest level, boil down to “stick these numbers into these memory locations, do some addition on them, stick the result in this memory location, rinse, repeat.” It often all appears to be much more than that but that is a computer programmers mission in life.
In most older languages– C comes to mind– a programmer had to first allocate the memory they wanted to use. After they were done using it they had to deallocate the memory. This was especially important because memory was expensive and, as a result, computers of the day did not have much of it. It was common for tricks, or hacks, to be used that were not ideal solutions because there was simply no other way with such a limited resource.
Fast forward to years ago when I first started with this discipline. The people who I had learned from– both in the form of teachers but much more commonly in the form of over-the-Internet searching– were the product of this era. As a result I have an almost religious obsession with managing resources myself. I tend to shy away from libraries that do a lot of the work for me simply because I can not see what they are doing, how they are doing it, and when they are doing it. In addition I do not control their resource usage which just irks the crap out of me. In an age when desktops with multi-gigabyte amounts of memory can be had for under $300 is this still a logical habit?
Many languages today have a feature called garbage collection. Very popular and common languages like PHP, Java, and the various .NET Framework languages all implement this. Not only do they implement it they nearly demand you rely on it. This always seems like the job of a programmer to me and not the machine. After all, the program needs to, in addition to whatever code I write, keep track of all memory allocated, variable types, scope of said variables, ect for garbage collection to work. It just seems like a lot of work being done using a lot of resources I could easily use somewhere else and a bad case of wag the dog. It is also worth mentioning that none of the above languages come anywhere near the speed and efficiency of C.
What brings all this up is a project I have had in the back of my mind for a year now. This project requires a lot of JavaScript. JavaScipt, for anyone who is unfamiliar, has a surprising amount of functionality missing from it. It can not, for example, trim excess whitespace from a string nor can it pad a string. These would be common programming tasks which you would have to write yourself.
I want to do something more complex than basic string manipulation. I want to create a scrolling, Google Maps-esk interface among other things. I could write all of the code myself (which I already did for some of another project) or I just could use a library like jQuery. jQuery has a lot of the smaller bits of what I need to do already done. Not only that but so many people who use it that one can safely assume that most of the bugs I would be likely to hit would already have been ironed out. It really seems like a win-win for both jQuery and myself.
Perhaps Jeff Atwood makes a good point when he says I am dangerous. Perhaps I have already answered my own question just by writing about it. The logical solution is to use the time-tested, rave-reviewed jQuery but there is just something inside me that does not want to give up the control. It just seems… wrong. I should be able to control every aspect of my software as to make it as efficient as possible. I should put in the work and have everything the way I know it should be without any questions about the guts or inner workings of something. On the other hand if I were a mechanic I would not be building my own combustion engine just because I could…
… I should stop being such an anal control freak.