<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet href="http://www.majordojo.com/projects/FeedManager/atom.xsl" type="text/xsl" media="screen"?>
<feed xmlns="http://www.w3.org/2005/Atom" 
      xmlns:thr="http://purl.org/syndication/thread/1.0">
  <link rel="alternate" type="text/html" href="http://www.majordojo.com/2006/11/programming-language-vs-programming-language.php" />
  <link rel="self" type="application/atom+xml" href="http://www.majordojo.com/2006/11/programming-language-vs-programming-language.php" />
  <id>tag:www.majordojo.com,2010://3/tag:www.majordojo.com,2006://3.1980-</id>
  <updated>2010-02-26T09:30:51Z</updated>
  <title>Comments for Programming Language vs Programming Language</title>
  <subtitle>A blog about Movable Type, technology, geek-dom, science-fiction and yes, sometimes my personal life.</subtitle>
  <generator uri="http://www.sixapart.com/movabletype/">Movable Type 4.261</generator>
  <entry>
    <id>tag:www.majordojo.com,2006://3.1980</id>
    <link rel="alternate" type="text/html" href="http://www.majordojo.com/2006/11/programming-language-vs-programming-language.php" />
    <link rel="service.edit" type="application/atom+xml" href="http://www.majordojo.com/cgi-bin/mt/mt-atom.cgi/weblog/blog_id=3/entry_id=1980" title="Programming Language vs Programming Language" />
    <published>2006-11-13T16:08:32Z</published>
    <updated>2007-01-15T22:33:43Z</updated>
    <title>Programming Language vs Programming Language</title>
    <summary>Tim Bray offers a wonderful analysis of the three most popular programming languages out there right now: PHP, Ruby on Rails and Java. Here are some highlights and some thoughts. Good apps, once built, tend to be in production for...</summary>
    <author>
      <name>Byrne</name>
      <uri>http://www.majordojo.com/</uri>
    </author>
    
    <category term="Programming" />
    
    <content type="html" xml:lang="en" xml:base="http://www.majordojo.com/">
      <![CDATA[<p>Tim Bray offers a <a href="http://www.tbray.org/ongoing/When/200x/2006/11/10/Comparing-Frameworks">wonderful analysis of the three most popular programming languages</a> out there right now: <a href="http://www.php.net/">PHP</a>, <a href="http://www.rubyonrails.org/">Ruby on Rails</a> and <a href="http://java.sun.com/">Java</a>. Here are some highlights and some thoughts.</p>

<p><a href="http://www.majordojo.com/images/Comparison-1.jpg"><img alt="Comparison-1.jpg" src="http://www.majordojo.com/images/Comparison-1-thumb.jpg" width="430" height="282" class="photo" /></a></p>

<blockquote>Good apps, once built, tend to be in production for an astonishingly long time. Which means that they have to be maintained for an astonishingly long time. Which means that maintainability is important. There are a lot of things that go into maintainability, but I suggest that the biggies are object-orientation, MVC architecture, code readability, and code size (less is more, a lot more). 

This is PHP’s Achilles’ heel, of course. Yes, it is possible to write clean, object-oriented, modular, MVC-style PHP applications. But most people don’t; the majority of apps that I’ve seen have spaghetti PHP code wrapped around spaghetti SQL embedded in spaghetti HTML. Also, a lot of the people who really understand O-O and MVC and maintainability would rather work in Java or Rails.</blockquote>

<p>This observation couldn't come at a better time - especially after I spent an evening mashing at the keyboard sharing in my experience trying to get some PHP sample code to work.</p>

<p>I am not a PHP-hater by any account. Hell, I choose PHP for a lot of my web work. But there is no getting around the fact that the incredibly flat learning curve for the language naturally leads to a lot of code written by amateurs. That code then gets contributed to open source directories, promoted on blogs, and/or in <a href="http://pear.php.net/">Pear</a> and then gets included in other people's applications because it is generally the case that most developers will just integrate carte blanche any open source code into their application if it solves their problem. If you are a developer reading this, let me ask you, when was the last time you audited the code you downloaded from Pear or CPAN or Sourceforge? </p>

<p>This is of course at the heart of why PHP has developed such a bad reputation among <a href="http://www.developer.com/lang/article.php/918141">security experts</a>. Amateur developers by their very nature don't have the experience or knowledge of how to write solid code <a href="http://www.amazon.com/Writing-Solid-Code-Microsofts-Programming/dp/1556155514">#</a>, and thus tend to write code that does not conform to best practices and often has a number of security issues within it. </p>

<blockquote>In recent years things like PHP and Rails have taught us that development speed is more important than we thought it was. On top of the obvious business value of delivering functions faster, there’s the Agile/XP view that you really don’t understand a feature till you’ve built it, so the faster you can build them the faster you understand them.</blockquote>

<p>I couldn't agree more. I think the debate of which language is better as Tim rightly points out, is a red herring. The answer depends upon too many variables, and I really don't think there is a right or wrong answer. The only wrong thing to do is write crappy code that you later have to completely rewrite and re-architecture. But even that is inevitable in a way.</p>

<p>But I agree - if there is one thing I have learned in two years is the importance shipping. If you can whip together an app in PHP in half the time you can in Java, then that should, no - it <em>must</em> heavily influence your decision.</p>

<h2>On Perl</h2>

<p><a href="http://www.majordojo.com/images/Comparison-byrne.png"><img alt="Comparison-byrne.png" src="http://www.majordojo.com/images/Comparison-byrne-thumb.png" width="430" height="227" class="photo" /></a></p>

<p>I am sad that Tim didn't profile <a href="http://www.perl.com/">Perl</a>, but then again he didn't profile .NET or Python either. For me, it is a toss up between PHP and Perl every time. What keeps me in PHP at all is inertia. I have a lot of personal libraries I have written in PHP that make me more productive there. But I am aching to make the switch to 100% Perl. Why? Because <a href="http://www.sixapart.com/">Six Apart</a> has shown me just how scalable a language it is. With <a href="http://www.catalystframework.org/">Catalyst</a>, <a href="http://search.cpan.org/dist/Data-ObjectDriver/">Data::ObjectDriver</a>, <a href="http://www.danga.com/perlbal/">Perlbal</a> and <a href="http://www.danga.com/memcached/">memcached</a> (not all of which are written in Perl BTW) it is actually <em>not</em> difficult to write some of the <a href="http://www.livejournal.com/">most scalable</a> <a href="http://tour.vox.com/">applications on the Internet</a>.</p>

<h3>Dev Tools</h3>

<p>I would argue that all you really need to work on Perl is emacs or vi. But to be fair and consistent with Tim's appraisal, I think it is important to consider the lack of really <em>well integrated</em> developer tools for Perl. Granted, there is <a href="http://www.activestate.com/">Active State</a>, but that is for Windows only and thus doesn't score a lot of points with me.</p>

<p>What Perl has going for it is probably one of the <a href="http://www.cpan.org/">largest repositories of open source libraries</a> for any programming language. And these are perhaps the most valuable tools at a developer's disposal because it allows them to build on the shoulders of giants as opposed to re-inventing the wheel over and over.</p>

<h3>Maintainability</h3>

<p>This is both Perl's strength and weakness. Perl's has a lot of the same challenges as PHP in regards to the accessibility of the language. But it also has the opposite problem that there are a lot of ubersmart people out there writing Perl code, and their code is often quite obscure to say the least. A perfect example is <a href="http://www.soaplite.com/">SOAP::Lite</a>. I dare anyone to try and make heads or tails of that code. Granted, <a href="http://www.perl.com/pub/au/Kulchenko_Paul">Paul</a> is a genius, but every time I have to get into that code I feel like I am unraveling some long unsolved mathematical proof. It hurts.</p>

<p>But there are also coders out there that write incredibly solid code. But in the end, this complaint is true about every language, that there exists a spectrum of good and bad code, and that maintainability is <a href="http://www.sixapart.com/pronet/weblog/2006/06/post_1.html">not a function of the language</a>, but a function of the developer at hand.</p>
]]>
      

    </content>
  </entry>

  <entry>
    <id>tag:www.majordojo.com,2006://3.1980-comment:40394</id>
    <thr:in-reply-to ref="tag:www.majordojo.com,2006://3.1980" type="text/html" href="http://www.majordojo.com/2006/11/programming-language-vs-programming-language.php"/>
    <link rel="alternate" type="text/html" href="http://www.majordojo.com/2006/11/programming-language-vs-programming-language.php#c40394" />
    <title>Comment from Jeffrey Thalhammer on 2006-11-18</title>
    <author>
        <name>Jeffrey Thalhammer</name>
<!--        <uri>http://perlcritic.com</uri> -->
    </author>
    <content type="html" xml:lang="en" xml:base="http://perlcritic.com">
	<![CDATA[<p>
I've been developing in Perl for about eight years, and I have wrestled with many of the isssues you mentioned.  I had almost given up on Perl when I discovered Damian Conway's <a href="http://www.oreilly.com/catalog/perlbp/" rel="nofollow">Perl Best Practices.</a>  His book really helped me improve the maintainability of my code.  
</p>

<p>
Conway's book also inspired the <a href="http://search.cpan.org/dist/Perl-Critic" rel="nofollow">Perl::Critic</a> project.  Perl::Critic is a static source code analyzer that checks your code for violations of Conway's guidelines.  And it is easy to configure and extend to suit your own tastes.
</p>

<p><p>
The Perl::Critic <a href="http://perlcritic.com" rel="nofollow">webservice</a> is also available if you want to try it out without installing anything.
<p></p>

<p>Cheers.</p>
</p></p>]]>
    </content>
    <published>2006-11-18T18:13:42Z</published>
    <updated>2006-11-18T18:13:42Z</updated>
  </entry>

</feed>

