It’s one of those days where too little sleep leaves me unwilling to work, yet not tired enough to go sprawl out in bed. Such is the season of gas-powered leaf blowers wielded by morning-fixated do-gooders, who you can’t really condemn because their sheer weight in numbers grants them some ephemeral right to produce blaring noise outside your window.
So I’ll kill some time writing about something most of you will find completely uninteresting.
Not long ago I started another big project that requires the use of programming languages. I was a late-comer to object-oriented programming, and never really understood it until I gritted my teeth and dug into the formal structures. This, despite several times asking Anthony to explain it to me, which he tried, valiantly to do. It is, perhaps, like the concept of recursion – it just happens to you one day, and from that day forward, it just makes sense.
I would have explained it better than Anthony, though, I think, who focused upon the semantics. Object oriented programming is almost exactly like procedural programming, except that your functions have their own namespace (class), and multiple functions can be grouped together within that namespace (methods), sharing variables (properties) between them, or with a scope limited to a given function (method).
I think that would have made me understand object-oriented programming much easier, but through hindsight, it’s impossible to say. My apologies, Anthony, if I drove you nuts back then, trying to get me to understand the concepts and their relevance.
Object-oriented programming has become fairly well the de-facto way of programming for most applications. The sales pitch is, you can create logical objects that can be re-used easily by other programs, and it helps keep your code organized, both physically and logically, simply by adhering to the tenets of object-oriented programming. And, you can make changes in one place, without worrying that it will break other parts of your system, as long as you adhere to your defined interfaces and abstractions. It’s almost like utopia, really. Well, until you get there.
Like just about anything, it sounds great until you bring it home and live with it for a while. Then you like it, and you hate it, and helps you, and it gets in your way, etc., etc. What it does do, more than anything, is force you to think in terms of fitting blocks together, rather than flows. Oh, certainly, you can think in terms of flow to some degree with object-oriented programming, but only as much as blocks are allowed to flow. It becomes a balance, and a trade-off. Creativity can be messy, while organization can be restrictive. And one can come up with all sorts of reasons why one thing is worth the costs within the other.
Java is the language I was most interested in working with for this project, mostly because in all these years, I have never bothered to learn it. When it arrived it was meant to represent the pinnacle of the object-oriented approach to programming, with a minimal set of syntactical requirements, and the rest of the language’s functionality coming from the objects people would begin creating. After a while, people made quite a few objects, and they were put into various libraries. And marketing forces caused some of these libraries to be the more complex, “premium” libraries, while others remained in the core. However, after years of accumulating objects that represent the way things are to be done, there are so many objects, so many libraries, so many different standards that overlap, or duplicate effects, or are wholly incompatible, that Java appears to have reached an odd state of senility through its adherence to these organizational precepts.
That’s all well and good, I suppose – I don’t mind senility that much. But I do find it very difficult to chart a good course through the maelstrom of methodologies and standards that does not leave me in a position of reaching some dead-end to the path I have chosen to adopt, if contingencies might come into play along the way. Of course, you can always wrap this object in that one, and connect it over to here, when the original two were incompatible, but who knows what mammoth-sized baggage you’ll have to pick up and bring in along the way. It leaves me wishing, somewhat, that I could have grown senile along with it. But more, I think, happy that I did not. I’ve spent some good time with it and have learned it takes a good deal longer to accomplish many things with Java than it does using other languages. But it’s performance, after the fact, is almost worth it. For this project, no.
It’s so easy to fall back on PHP. You know why. It just fits right into web servers. No muss, no fuss, no effort. But it’s hideous, and clunky. I considered Perl as well, for the free and open fields, being object-oriented where you want, procedural, or even functional. Nothing is more versatile, even after all these years. Unfortunately, its use has become arcane to most, and I am not at all fond of ModPerl, which lets it run fast in web servers. Python is still transitioning between versions, and is fascist. Scala looks wonderful, but carries a good deal of Java baggage along with it, in the libraries, which some consider a huge benefit, while others consider it a nightmare. I’m left with the same, sad question from last year: where is my Perl 6? I’ve loved every bit of how it’s coming together. It’s gorgeous.
I’ll shamefully confess I decided to at least prototype in PHP. I’m telling myself, for prototyping, it’s just too damn convenient. Yet I also know, after having so much prototyping done, laziness will likely keep me with PHP. I need to be kicked in the head, shaken by the throat, then delicately caressed into doing something better, and more aesthetically enjoyable.
It may well be that I should back out, and just enter into the dark, murky swamp of Java, with all its quicksand and grabbing tendrils. Even though creating things is more time consuming, there is a final, satisfying quality to it, when complete. But I also don’t like company logos hanging off the various approaches I decide to take, and Java is packed with them.
The road through senility might just be the best path.