6 ms·
The one thing I've learned as a consultant working outside the startup world, in the boring world of everyday business is just how much of the computerized worl
by noonespecial 14y ago
The one thing I've learned as a consultant working outside the startup world, in the boring world of everyday business is just how much of the computerized world still runs on perl. I've seen some fantastically made systems and some real stinkers.
In the HN echo chamber, it seems like everyone who's anyone has moved on to ruby, rails, python, django, etc. Look into the every-web. My god, it's full of perl.
- knighthacker 14y agoI agree. It is a misconception that Perl is "dying". It powers a lot of the web. It had a bad rep a few years ago due to cryptic-looking codes that were written as a throw away code and somehow spread all over the web :). I was one of the skeptical developers at some point, but then I got hooked :). Modern Perl changes the old rep alltogether. I encourage people to write well architected, maintainable, extensible code and follow design patterns regardless of the language of choice.
- ralph 14y agoRegardless of the structure of modern usage its syntax is still very noisy for the reader. It seems the majority prefer the cleaner syntax that doesn't use punctuation to define the type of access a la BASIC.
- jonathansizz 14y agoYes, the sigils can make Perl code look noisy, especially as Perl uses curly braces and semicolons too. However, they do have a couple of nice benefits: firstly, they make variable interpolation easier (and less noisy!) than in other languages like Ruby and Python. Secondly, sigils make it easy to see what kind of data you are dealing with, obviating the need to scroll through your program to the variable declaration.
- thecoffman 14y agoThe sigils make variable interpolation easier only in the most generic case "interpolate $me". Anything more sophisticated requires a temporary variable.
- raiph 14y agoI am not especially enamored of variable interpolation, but for those that are, Perl 6 does a much cleaner job than Perl 5 imo.
- draegtun 14y agoYou can avoid using temporary variables with the @{[...]} and ${\...} idioms: my $x = 1; say "$x + 1 = @{[ $x + 1 ]}"; sub plus1 { $_[0] + 1 } say "$x + 1 = ${\plus1($x)}";
- hobbified 14y agoWell... arguably they make it easier in the half-dozen simplest cases. Which just happen to be what's needed 90% of the time.
- encoderer 14y agoI've not touched Perl aside from modifying and using basic scripts for process automation and administration tasks. But since you called-out Python and Ruby, I'm curious what you meant. In Python, for example, interpolation would look like: print "I ate a %s for %s" % ('banana', 'lunch) (or the newer way with nominally more keystrokes) print "I ate a {0} for {1}".format('banana', 'lunch') I've done plenty of PHP work and I get that I can do "{$varhere}" but for strings of any length or complexity it was totally common to use sprintf() an I have to assume the same readability principles apply in Perl?
- ionforce 14y agoIn Perl you could write print "I ate a $fruit for $meal" Or printf 'I ate a %s for %s', $fruit, $meal
- 14y ago
- rhizome 14y agoAs a self-trained programmer who cut his chops on Perl, I find it a bit humorous that people complain about reading Perl, while every coding test at a job interview involves some five-way algorithm or other generally-arcane CS concept that CS people spend two years practicing and that the business will never use. Two forms of complexity, one valued much higher within the industry.
- knighthacker 14y ago+1 It is so hard to know that @ means array and % means a hash (key/value pair) haha.
- slurgfest 14y agoIt's not that hard to know the types of the variables you created without punctuation in the identifiers, either.
- prawks 14y ago>you created Agreed. However, working for a company with more than one developer...
- dllthomas 14y agoWell, it's not just the type of the variable but also how you're treating it - world's most concise cast... Also, it means one doesn't have to dodge keywords in naming their variables. Doesn't count for a lot but is nice.
- Ralith 14y agoWho cares about the syntax? The real problem is the weak typing.
- zby 14y agoIt might look noisy - but it is just easier to parse in your head when you know what is a variable and what is a function or a keyword. I have came to believe that much of the 'Perl is ugly' notion comes from the fact that the $ character does not have nice typefaces (http://perlalchemy.blogspot.com/2011/01/is-responsible-for-ugliness-of-perl.html http://perlalchemy.blogspot.com/2011/01/is-responsible-for-u...).
- cafard 14y agoAnd this would be why PHP is so popular?
- jjn1056 14y agoYou know Perl gets hassled because of the variable sigils, but when I've taught Perl to newcomers it didn't seem to be much on an issue. Maybe this is because Modern Perl tends to be more clean and OO, there's not the sigil busyness you might see in old Perl code used by admins in the mid 1990's. I think this is really just something people that use other languages are bothered by. I know we all have preferences. When I do Javascript I tend to miss the sigils a bit :)
- 16s 14y agoVery true! It seems fashionable to make fun of Perl and C++, but in the real world, they are everywhere, doing everything and they work extremely well.
- sliverstorm 14y agoWorkhorses are never fashionable.
- EvanKelly 14y ago"There are only two kinds of languages: the ones people complain about and the ones nobody uses" - Bjarne Stroustrup
- ralph 14y agoHe was very biased; it counts for little.
- biot 14y agoThere are only two kinds of people: the ones others complain about and the ones nobody cares about.
- knighthacker 14y agoYou, sir, will be quoted some day :)
- jtraj 14y agoWah! :) Is there a like button here?
- ralph 14y agoNot sure why it got all the down votes. Since Visual BASIC faded away there's been two mainstream languages that have come in for much complaint; C++ and PHP. All languages suffer some valid criticism as none are perfect but the weight of criticism for these two suggest much is deserved, it is in my opinion. Consequently, that the author/facilitator of C++ has a fun quote to dismiss the large-scale criticism is fun but "counts for little" as he's biased.
- protomyth 14y agoIt's really not that surprising when you think of how much of corporate programming is taking data in format A and outputting format B. Perl is fast and well suited to data transformations.