It’s been a long, long time since I posted programming-oriented stuff to ironSoap. A lot of it is because I haven’t had much call to do a lot of programming-related work for some time now, focusing more on other technology tasks. However, while my current job is not in development, it does often call for scripting and automation of common tasks.
A few people at my work like Python, which I admire but have never felt was really as intuitive as its supporters claim. If I were told I needed to complete a Python script by the end of the week or I’d lose my job I could make it happen, but it wouldn’t be as fun as if I were allowed to use Perl.
And of course nothing would be as good as if I were given the chance to write in my beloved PHP.
But here’s what’s strange: PHP is not a great language. Perl has it’s faults, too, but I can tolerate it. Meanwhile other languages that are arguably more elegant and refined are less appealing to me and, until this week, I had no idea why.
What led to my epiphany was my recent project which, on the urging of an engineering co-worker, is to be built with another language, Ruby.
Ruby reminds me a lot of Python: It isn’t built on a long legacy of shifting priorities and structured with it’s foundation on the sands of time. These are relatively modern languages built to be all-purpose from the beginning, to read cleanly and to avoid some of the pitfalls of other—flawed—languages I find more comfortable and preferable. They’re also supposed to be easier to learn and pick up on for the beginning to intermediate programmer (a class I slide into smoothly).
And don’t let me lead you off-course entirely: I said I admire Python and I actually really like Ruby and what it’s doing. These languages aren’t the problem. What drives me batty and makes me want to run screaming back to PHP is the lack of usable, coherent online documentation.
Nothing has ever been as useful to me as PHP.net for getting actual programs to work. And maybe that’s just PHP’s strength, to have solid documentation and a robust set of built-in functions to do almost everything you’d ever want to do already. Perl has a similar, if less friendly system, because it’s so popular with Web-folks that it’s been documented like crazy on about fifty different sites. If you have a question about Perl, chances are you can simply type the exact question into Google and someone else has asked the exact same question in the exact same way sometime before you. Plus, with CPAN, most common problems have already been solved in Perl so just like in PHP you’re rarely reinventing the wheel.
Which isn’t to say those same constructs don’t exist in Python or Ruby. In fact I’m pretty sure they do. The problem is the documentation, because there is no clearly written place to find answers about exactly how to use the standard modules and the best written documentation for the languages is all in tutorial or primer or narrowly focused pockets. What PHP (and to a lesser extent Perl) offers is plenty of places like that online, but also a central repository of clear, concise reference material that makes even O’Reilly volumes really redundant.
It’s frustrating because there is always this one blocking point where I’m sufficiently familiar with the new language’s syntax to start applying my basic programming knowledge but the language’s advanced features are relegated to technical references that are no more enlightening than man pages and I end up visualizing how I could write my scripts but unequipped to transform those concepts into functioning code.