DrOOPal Dreams

Craig A. LanceI have a dream that one day Drupal will embrace OOP(Object Oriented Programming).  There!  I said it!

 Before I continue, a brief history of my programming background.  First, Bally (as in Arcade) BASIC, IBM 360 BASIC, Atari BASIC XL, Fortran, Cobol, Pascal (mainframe and Turbo), APL, Prolog, C, UniBasic (IRIS BASIC emulator), C++, Java, Perl, and PHP.  My programming paradigms grew from imperative to procedural (Pascal), with a brief diversion in functional programming, finally settling on OOP.

Languages I’ve loved would include Atari BASIC XL (for the Atari 800), Pascal, C++, and Java.

Atari BASIC XL is easy to learn on your own and there was a book written by the creators on how language tokens are compiled, stored, and interpreted.  This helped tremendously when I was hired by Dynamic Concepts to develop UniBasic in C for UNIX platforms.

In college, back in the early `80s, Pascal was the chosen teaching platform.  Now a days, they seem to have switched to Python, which I will be taking online in September with my niece.  My instructor was John R. Clark, the best.  I fell deeply in love with Pascal, my puppy love.  She taught me structured procedural programming, with a hint of functional programming thrown in for idealistic fervor.  I convinced John Clark to switch from using UCSD Pascal on IBM PC platform to Turbo Pascal.  But, like any puppy love, they always hurt you; I no longer program in Pascal.

This led me to Turbo C.  I actually made money writing programs free-lance this way.  C is like Pascal with training wheels removed.  C is mostly an expression evaluator with programming constructs.  I loved all those pointer, reference, logical, and boolean operators; and how you can combine them in completely unreadable (by others) ways that harkens back to APL days.  String manipulation was as simple as incrementing a pointer.  In C, a programmer really knew, and had to know, how his data was stored.  God, I miss those days!

Then came C++, my introduction to OOP.  And not a very disciplined one.  Don’t get me wrong, I love C++, but she’s still a mistress to me.  There’s not much you can do in C that you can’t get away with in C++, but you shouldn’t.  C++ is built on C with heavy backwards compatibility, with strong type checking (from Pascal), and powerful OOP constructs; much stronger than PHP (which doesn’t support destructors, multiple inheritance, etc.).  Today, I’ll definitely choose C++ for certain jobs over any other language.  But still, C++ is a mistress for a booty call.

If C++ is my mistress, Java would be my wife…or better, my first wife.  I’ve since been divorced; but we still see each other on the side.  What I love about Java is that everything is an object and it’s self-documenting.  All one needs to do to create documentation for Java classes is to comment everything; classes, methods, constants, etc.  Then run JavaDoc and it will create HTML documentation for you and other developers.  Java even has a scripting language, JSP (Java Server Pages); which really are compiled into servlets, I mean who writes servlets anymore?  The Android platform has chosen Java to implement apps on smart-phones.  Why Apple chose Objective C for apps I’ll never understand.  And don’t get me started on the Apple v. Samsung lawsuit.

So, why am I having an affair with PHP?  Because Drupal is married to PHP.  And like James Bond, I’m only attracted to married women.  However, Drupal is not PHP’s only spouse.  Most popular open source CMS (Content Management System) software, i.e. WordPress and Joomla,  are written in PHP.  Which begs the question:  Why choose PHP when there are so many stronger languages available?  It’s probably the same reason why Facebook uses it: PHP programmers are a dime-a-dozen.  Other reasons include the following.  PHP borrows the best from many languages.  It’s easy to learn, like BASIC.  But, unlike BASIC, it has one standard.  It borrows OOP, from which language I’ve yet to determine.  It gets its operator expressions from C++, mostly (why .= instead of += for string concatenation I’ll never…oh, that’s right: no strong type checking).  It borrows JavaDoc style documentation in the form of Doxygen.  It’s open source, like the popular Apache Web server, MySQL database server, and Drupal.  I’m probably missing a few other reasons, but there’s no denying PHP’s popularity.  And I have to admit, PHP is fun to play with.

Joomla is the only open source CMS that is Object Oriented.  I do have experience with Joomla.  I’ve developed a web site, modified core code, and stepped through page loads using a debugger many times.  That’s why I am interested in learning Drupal 7.  Joomla, IMHO, sucks!

So, I’m learning PHP, MySQL, and Drupal 7 all at the same time.  And what I’ve determined is that PHP is improving faster than Drupal.  You can OOP in PHP, but just not in Drupal.  I mean you can, but you’re on your own.  To my disappointment, the following article does not spell out any future OOP plans: What's Going to Be New in Drupal 8?  The author Ed Andrea describes six initiatives for the next version and none of them include OOP aspirations.  Drupal 7 does introduce PDO (PHP Data Objects), which is PHP’s OO database abstraction, but other than that, I’ve yet to learn of other OO initiatives.

In retrospect, if I were to create a CMS from scratch, I’d choose Java (like these people).  It would be called DrOOPal, the COOMS (Content Object Oriented Management System).  Seriously, Java was around when Drupal was initially conceived, so why wasn't it chosen?  I can only imagine it falls back on the dime-a-dozen PHP programmer community availability for the reason to choose PHP over Java.

So, my concern is why isn’t there more of an Object Oriented initiative to bring Drupal into the future?  I mean this is the year 2012.

Comments would be greatly appreciated.


-=- PalaDolphin (a.k.a. Craig A. Lance)


Just testing out :) By the way Drupal is SOOOO over my head :D - for now

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
By submitting this form, you accept the Mollom privacy policy.