Log in

No account? Create an account
color cycle (slow)

Kistaro Windrider, Reptillian Situation Assessor

Unfortunately, I Really Am That Nerdy

Previous Entry Share Next Entry
In which a dragon learns Perl
anger, burn it with fire, RARRRGH
I have, over the course of the last several days at work, learned enough Perl to be able to read, trace, and edit existing sources, and with a library reference I could probably write software reasonably competently. I have also learned enough to feel very secure in my conclusion that Perl is not my favorite programming language.

It probably doesn't help that the code I'm tracing through for work uses global variables to auto-increment an index (starting at undef) to provide "unique" "standardized" names for a quadratic number of sequence cross-alignment records, which are calculated in an order derived from the iteration order of a hash table. Because we all know variably sized hash-table order is a great way to normalize data.

This is not why I dislike Perl. This would have been absymal code in any language; it is possible to write illegible, bad code full of functions that take 14 parameters and use 3 globals and care about call order in almost any language, and it will never be good style. Perl does tend to encourage this, given that specifying how many parameters your subroutine takes is actually a new feature (as is the "return" keyword) and it encourages heavy use of its $_ "the last thing" automatic variable, but it is possible to write clear code in Perl. I don't like the stupid things Perl does with variable binding- specifically, how $foo, @foo, and %foo are three different variables with no relation to each other, and $foo, $foo[0], and $foo{0} is the proper way to refer to one element from each of them in turn, because the type prefix refers to the type of the data being pulled out, and indexing an array or hash nets you a scalar. It also means I can't read left-to-right and know what the hell variable I'm working with when there's been such a namespace collision. Which is clearly bad style, and happens left and right in this code.

Anyway, I think I'll continue to use Python when I need a scripting language. I might be tending to use Java less for a compiled language, if Cython works as well as advertised; I really do develop about ten times as quickly in Python as Java, and if annotating a few types lets it compile to C that runs about as fast as Java code, I'll take that and, if you'll pardon the pun, run with it. I'm practical; I'll use which language meets my needs best. I suspect Perl will be that language when and only when my needs include "work with existing Perl code".

It did teach me something else, though! My first reactions to things are still very dragon-shaped. That code had me, quite literally, hissing and snarling at my computer as the atrocity unfolded line-over-line. With the occasional deep, threatening growl, baring-of-teeth, and a quadrupedally tense posture over my swivel chair.

This isn't too abnormal for computer programmers, so I don't think my co-workers noticed.

I've migrated to DreamWidth. The original post is at http://kistaro.dreamwidth.org/481953.html. View comment count unavailable comments at http://kistaro.dreamwidth.org/481953.html#comments; go ahead and use OpenID to post your own, or you can comment here.

  • 1
I've been drawn to learn Silverlight, for most of the past year, but haven't taken the step of downloading anything or studying the language behind it (C# if I remember correctly).

I suspect I'll like C# about as well as I like Visual Basic (a step above Java, but not so beloved as Python), but we'll see once I get there.

C# is fairly similar to Visual Basic spoken with a strong Java accent. I prefer it very strongly over VB, and it has a handful of constructs that Visual Basic doesn't, but if you know Visual Basic and Java both, C# should be almost trivial to learn.

  • 1