{"id":82,"date":"2010-03-06T13:39:36","date_gmt":"2010-03-06T18:39:36","guid":{"rendered":"http:\/\/sam.tregar.com\/blog\/?p=82"},"modified":"2010-03-06T13:56:03","modified_gmt":"2010-03-06T18:56:03","slug":"on-python-present-and-perl-past","status":"publish","type":"post","link":"http:\/\/sam.tregar.com\/blog\/2010\/03\/06\/on-python-present-and-perl-past\/","title":{"rendered":"On Python Present and Perl Past"},"content":{"rendered":"<p>I&#8217;ve been working in Python almost exclusively for the last 8 or 9 months.  It&#8217;s been a fun challenge learning a new language, and being able to do it along with the rest of the <a href=\"http:\/\/wawd.com\">We Also Walk Dogs<\/a> crew has made it even better.  A dip back into Perl has given me a chance to reflect on my progress with Python.<\/p>\n<p>The past couple weekends I&#8217;ve been helping a friend with a small project &#8211; a textual analysis problem finding similarities between disparate documents in a large database.  I immediately reached for Perl because I&#8217;ve done projects like this in Perl before and I knew all the tools I&#8217;d need.  I indexed phrases from the docs using <a href=\"http:\/\/search.cpan.org\/~GAAS\/Digest-MD5\/MD5.pm\">Digest::MD5<\/a>, storing the index in MySQL with <a href=\"http:\/\/search.cpan.org\/dist\/DBD-mysql\/lib\/DBD\/mysql.pm\">DBD::mysql<\/a>.  Then I whipped up a quick web-app with <a href=\"http:\/\/cgi-app.org\/\">CGI::Application<\/a> and <a href=\"http:\/\/search.cpan.org\/~samtregar\/HTML-Template-2.9\/Template.pm\">HTML::Template<\/a>, with a bit of help from <a href=\"http:\/\/search.cpan.org\/~tjmather\/HTML-FillInForm-2.00\/lib\/HTML\/FillInForm.pm\">HTML::FillinForm<\/a>, <a href=\"http:\/\/www.blueprintcss.org\/\">Blueprint CSS<\/a> and <a href=\"http:\/\/search.cpan.org\/dist\/Config-General\/General.pm\">Config::General<\/a>.  With the exception of Blueprint (which I find indispensable these days), this is pretty much the toolkit I learned (and helped build) at Vanguard Media working for <a href=\"http:\/\/www.erlbaum.net\/\">Jesse Erlbaum<\/a> over ten years ago!  It all worked great and the app was up and running in just a day and a half.<\/p>\n<p>This experience makes it obvious to me that I still have a long way to go with Python.  Perl syntax is second nature to me &#8211; I almost never make an error and everything works the way I expect it to.  I&#8217;m not looking up basic Python syntax anymore but I am still making plenty of mistakes.  More to the point, the tools I needed to use for this project are all still completely ingrained in my memory, and behave exactly the way I expect them to.  Compared to the Python tools I use daily (<a href=\"http:\/\/www.djangoproject.com\/\">Django<\/a>, <a href=\"http:\/\/ask.github.com\/celery\/getting-started\/introduction.html\">Celery<\/a> and <a href=\"http:\/\/sourceforge.net\/projects\/mysql-python\/\">MySQLdb<\/a>, for example), the difference is really impressive.  My Python tools often surprise me and I find myself going back to the docs, and failing that the source, frequently.<\/p>\n<p>It&#8217;s also interesting to think about how little has changed in the past 10 years.  I can pick up the same tools I used then and construct something that most people would recognize as a modern web app.  Mix in just a little <a href=\"http:\/\/jquery.com\/\">Jquery<\/a> and it would probably pass for Web 2.0.  On the other hand, I think I can say I&#8217;ve gotten better as I&#8217;ve aged &#8211; this project would have taken me quite a bit longer 10 years ago, if I could have completed it at all.  I probably would have gotten stuck on some completely insane plan like loading all the documents into memory at once.  I really didn&#8217;t know how to properly use a database back then!<\/p>\n<p>I am looking forward to making my first open-source Python release soon.  Who knows, maybe there&#8217;s a book about writing Python packages for <a href=\"http:\/\/pypi.python.org\/pypi\">PyPi<\/a> in my future!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve been working in Python almost exclusively for the last 8 or 9 months. It&#8217;s been a fun challenge learning a new language, and being able to do it along with the rest of the We Also Walk Dogs crew has made it even better. A dip back into Perl has given me a chance [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-82","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/sam.tregar.com\/blog\/wp-json\/wp\/v2\/posts\/82","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/sam.tregar.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/sam.tregar.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/sam.tregar.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/sam.tregar.com\/blog\/wp-json\/wp\/v2\/comments?post=82"}],"version-history":[{"count":12,"href":"http:\/\/sam.tregar.com\/blog\/wp-json\/wp\/v2\/posts\/82\/revisions"}],"predecessor-version":[{"id":94,"href":"http:\/\/sam.tregar.com\/blog\/wp-json\/wp\/v2\/posts\/82\/revisions\/94"}],"wp:attachment":[{"href":"http:\/\/sam.tregar.com\/blog\/wp-json\/wp\/v2\/media?parent=82"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/sam.tregar.com\/blog\/wp-json\/wp\/v2\/categories?post=82"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/sam.tregar.com\/blog\/wp-json\/wp\/v2\/tags?post=82"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}