News for hackers. Stuff that matters.
Re:Why Did I Choose Perl When Building Crowdtilt? by noonespecial on Friday August 31, 2012 @04:23PM (#4461527)
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.

Re:Why Did I Choose Perl When Building Crowdtilt? by knighthacker on Friday August 31, 2012 @04:29PM (#4461548)
I 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.

Re:Why Did I Choose Perl When Building Crowdtilt? by ralph on Friday August 31, 2012 @06:46PM (#4462005)
Regardless 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.
Re:Why Did I Choose Perl When Building Crowdtilt? by rhizome on Friday August 31, 2012 @07:08PM (#4462076)
As 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.
Re:Why Did I Choose Perl When Building Crowdtilt? by knighthacker on Friday August 31, 2012 @07:30PM (#4462132)
+1

It is so hard to know that @ means array and % means a hash (key/value pair) haha.

Re:Why Did I Choose Perl When Building Crowdtilt? by slurgfest on Friday August 31, 2012 @10:36PM (#4462494)
It's not that hard to know the types of the variables you created without punctuation in the identifiers, either.
Re:Why Did I Choose Perl When Building Crowdtilt? by dllthomas on Saturday September 01, 2012 @03:14AM (#4462926)
Well, 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.

Re:Why Did I Choose Perl When Building Crowdtilt? by prawks on Friday August 31, 2012 @11:37PM (#4462589)
>you created

Agreed. However, working for a company with more than one developer...

Re:Why Did I Choose Perl When Building Crowdtilt? by jonathansizz on Friday August 31, 2012 @06:52PM (#4462030)
Yes, 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.
Re:Why Did I Choose Perl When Building Crowdtilt? by encoderer on Friday August 31, 2012 @07:53PM (#4462188)
I'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?

Re:Why Did I Choose Perl When Building Crowdtilt? by ionforce on Friday August 31, 2012 @08:03PM (#4462205)
In Perl you could write

print "I ate a $fruit for $meal"

Or

printf 'I ate a %s for %s', $fruit, $meal

Re:Why Did I Choose Perl When Building Crowdtilt? by e12e on Saturday September 01, 2012 @07:31AM (#4463424)
"This is %(adjective)s readable Python in %(genetive)s opinion" % {"adjective":"more", "genetive":"my"}

> 'This is more readable Python in my opinion'

edit: variable names

Also, I agree that for this simple case, perl (and other's) simple dollar substitution is nicer.

Re:Why Did I Choose Perl When Building Crowdtilt? by e12e on Saturday September 01, 2012 @07:45AM (#4463448)
Since there was a mention of extending the language in this thread, there's also:

http://lfw.org/python/Itpl.html

Re:Why Did I Choose Perl When Building Crowdtilt? by thecoffman on Friday August 31, 2012 @07:20PM (#4462112)
The sigils make variable interpolation easier only in the most generic case "interpolate $me". Anything more sophisticated requires a temporary variable.
Re:Why Did I Choose Perl When Building Crowdtilt? by draegtun on Saturday September 01, 2012 @07:04AM (#4463366)
You 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)}";
Re:Why Did I Choose Perl When Building Crowdtilt? by raiph on Saturday September 01, 2012 @04:44AM (#4463132)
I am not especially enamored of variable interpolation, but for those that are, Perl 6 does a much cleaner job than Perl 5 imo.
Re:Why Did I Choose Perl When Building Crowdtilt? by hobbified on Wednesday September 05, 2012 @05:25PM (#4481542)
Well... arguably they make it easier in the half-dozen simplest cases. Which just happen to be what's needed 90% of the time.
Re:Why Did I Choose Perl When Building Crowdtilt? by Someone on Saturday September 01, 2012 @05:18AM (#4463193)
Huh? That will tell you wether foo is a hash or not, but not what kind of things it contains. So, as soon as you subscript you $foo or @foo or €foo, you are lost again.

A good IDE would be of much more help (and strong typing makes writing such an IDE way easier, but that is a different issue)

Re:Why Did I Choose Perl When Building Crowdtilt? by jjn1056 on Tuesday September 04, 2012 @10:36AM (#4474706)
You 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 :)
Re:Why Did I Choose Perl When Building Crowdtilt? by zby on Saturday September 01, 2012 @02:51AM (#4462883)
It 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-u...).
Re:Why Did I Choose Perl When Building Crowdtilt? by Ralith on Friday August 31, 2012 @07:52PM (#4462187)
Who cares about the syntax? The real problem is the weak typing.
Re:Why Did I Choose Perl When Building Crowdtilt? by cafard on Saturday September 01, 2012 @09:48AM (#4463644)
And this would be why PHP is so popular?
Re:Why Did I Choose Perl When Building Crowdtilt? by 16s on Friday August 31, 2012 @05:38PM (#4461801)
Very 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.
Re:Why Did I Choose Perl When Building Crowdtilt? by sliverstorm on Friday August 31, 2012 @06:21PM (#4461928)
Workhorses are never fashionable.
Re:Why Did I Choose Perl When Building Crowdtilt? by EvanKelly on Friday August 31, 2012 @06:33PM (#4461964)
"There are only two kinds of languages: the ones people complain about and the ones nobody uses"

- Bjarne Stroustrup

Re:Why Did I Choose Perl When Building Crowdtilt? by ralph on Friday August 31, 2012 @06:46PM (#4462007)
He was very biased; it counts for little.
Re:Why Did I Choose Perl When Building Crowdtilt? by biot on Friday August 31, 2012 @07:26PM (#4462126)
There are only two kinds of people: the ones others complain about and the ones nobody cares about.
Re:Why Did I Choose Perl When Building Crowdtilt? by jtraj on Saturday September 01, 2012 @06:24AM (#4463304)
Wah! :) Is there a like button here?
Re:Why Did I Choose Perl When Building Crowdtilt? by knighthacker on Friday August 31, 2012 @07:43PM (#4462167)
You, sir, will be quoted some day :)
Re:Why Did I Choose Perl When Building Crowdtilt? by ralph on Sunday September 02, 2012 @05:04AM (#4466601)
Not 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.
Re:Why Did I Choose Perl When Building Crowdtilt? by protomyth on Friday August 31, 2012 @10:48PM (#4462513)
It'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.