by nnq · 13y ago · 0 comments
...cause the lack of an answer to such a question has only one conclusion: the language is dying, even if this is not already happening in a visible way!
(don't get me wrong, I'm not a Perl hater, and fyi, I think the world would be a much better place if Rasmus Lerdorf would have learned Perl and written a nice Perl web framework instead of inventing PHP :) )
...cause the lack of an answer to such a question has only one conclusion: the language is dying, even if this is not already happening in a visible way!
(don't get me wrong, I'm not a Python hater, and fyi, I think the world would be a much better place if David Heinemeier Hansson would have learned Python and written a nice Python web framework instead of inventing Rails :) )
The Python community is made up of some very smart and talented experts. Their emphasis is on developing high-quality software, and doing things properly. Egos are kept in check, and there are always many people willing to offer a helping hand to those who are new to Python.
The Ruby community is generally quite different. There is a much bigger emphasis on celebrity and ego, and being "trendy". The attitude toward software development is different, too, with much more emphasis on producing a lot of code quickly, even if it has security flaws or other serious problems. It's more about being seen and heard, rather than doing.
I'd put the Perl community somewhere in between the Python and Ruby communities. Back when it was more prominent, it had a more lively set of participants than we than we find in the Python community, but a much higher degree of technical aptitude than we find in the Ruby community.
It sounds like you're talking about the most prolific speakers and code authors in each community who may in fact have their own personalities, but they don't define everyone who are simply using the best tool they can to accomplish their goals.
I like it, but I have given up hopes that one day it will become mainstream.
| Their emphasis is on [...] doing things properly
Too bad that doesn't extend to a better solution to packaging / deployment. :PThat is a really fun -- and typical! -- claim when your GP is a Python troll arguing that another open source language should just die... :-)
Frankly, I've never seen so much language trolls as Python trolls. (And no one needs multi line lambdas and hence real map functions, anyway...)
I don't know much about the Ruby community, but I have a hard time believing they can be worse.
Edit: But sure, the language trolls here might just a few idi... people. There are lots of you with just a few hundreds karma.
Those are hardly equivalent (aside from the obvious differences in prominence, scale and relative importance between Blekko and Twitter).
Scala shops attracts developers curious about new paradigms (FP / FP hybrid) whereas Perl shops tends to repel forward-looking developers who view it (accurately or not) as an ugly throwback to the year 2000.
Put plainly : Scala sells itself (to a certain crowd) whereas Perl needs to be be sold almost across the board. Scala is viewed as an up-and-comer, Perl as a has-been.
People are learning Python? Really? That was probably true in 2006-2009. Python is no longer the new hotness. Scala and Clojure may be.
The fact of the matter is Perl has a massive niche(Text processing, Unicode, CPAN, Regular expressions, Fast prototyping, TIMTOWDI, Ability to add new syntax rapidly[Moose, Devel::Declare etc], Automation, Testing culture, Documentation, Unix, Parsing, Getting things done real fast... I can go on.. but I will stop here), If you look at what Larry Wall has been saying over the years about Perl 6 in various talks you will note that he designed Perl to fill a niche which continues to be totally unoccupied till today's date. The only competitors Perl has in its design space are tools like sed and awk with a additional few Unix utilities thrown around. In other words Perl doesn't have any credible competition. What's more? Any language that is designed to replace Perl will largely look like Perl(Read: Ruby, Perl 6). And yes, Php and Ruby do have their niches.
Python doesn't have a niche. All Python has is- "Tab indent your code." And sorry to break the bad news to you. Merely forcing indentation on a bad programmer doesn't magically transform him to a good programmer. Rather it make the situation more worse. It gives him a free pass to sit amidst good programmers.
Leaving all about Python aside, what exactly is that niche? I'm not being ironical or anything, I really want an answer to this question, that's why I started this piece of the discussion. Seeing that things like Metasploit, that I would have expected to be written in Perl, end up being coded in Ruby, makes me unable to see any "special niche".
(About what people are learning: indeed we programmers pursue the new hotness, but of people that just started learning how to code, I bet 80% of them are learning Python, Ruby or Javascript, and since this the language they will first learn, this is more likely to become and remain their "go to scripting language" - bar Javascript...).
When we use APL, everything is one line long and code doesn't ever need indenting.
However, Python is still my main language and I am very happy with that. The numpy/scipy stack and everything building around that is incomparable to anything in Perl of Ruby. Also for the last month or so I have been doing work in the IPython notebook. It has really helped my productivity and documentation efforts. And it looks really cool.
For someone who hasn't used any of those, I'd say give each of them a few hours and see which style suits you best. Of course, try to find modern examples to learn from. When it comes to Perl that means:
* Mojolicious [1] (or Dancer [2]) as the web framework
* DBIx::Class [3] as the ORM (maybe with some sugar [4])
* Moose [5] (or Mouse or Moo) as the object system
[2] http://www.perldancer.org/
[3] https://metacpan.org/module/DBIx::Class
It's the only high-level language I know of that only has reference counting for memory management.
It's also the only high-level language I know of that can't really be parsed ("only Perl can parse Perl" they say).
It's a dead language really, you can also see this from the number of noisy evangelists vs. professional users nowdays (and that comes from someone who has used Perl almost exclusively for the past 10 years), if you couldn't see it from the diminishing quality of important modules on CPAN (e.g. I pulled my hair today over JSON::XS generating '-inf' from values on one side and crashing on the other side while trying to parse it).
So, I'm learning Go now and improving my JS skills.
Actually, where I work, we use Perl almost exclusively. I don't know a single person who I would consider a "noisy evangelist" - we just quietly get stuff done.
I was bit quite nastily by the lack of garbage collection in Perl just a couple of months into using it.
However, perl proved itself as an invaluable tool for quickly trying out ideas, and I was loyal to it for at least 10 years. Perl just wasn't able to grow as strong as the alternatives did.
I think that Ruby would be a better choice for some of the scripts that come up here and there at work, but inertia keeps much of it in perl. When I've taken the effort to install something for scripting, it has usually been Scala or Groovy, so as to make use of application code within the scripting.
The Perl community is software's Maker subculture [1]. They have a "heck yeah, we'll give that a try" perspective lacking from other subcultures. The the larger software ecosystem ever lost this Maker/Perl worldview, it would be a huge lose.
Taking a step back: In some ways, I think languages get larger adopted because of their culture. Their technical implementation is just a manifestation of the culture. (And, I think this explains why LISP has never broken out. It isn't a language problem, it's a cultural problem).
- efficient and compact regex scripts
- one-liners.
Of course, some of these could be considered a reason NOT to use Perl depending on your specific circumstances.
the only argument I can extract from this is "Perl has a much nicer syntax for working with regexps", and I agree with this (and I hate it when other languages don't fully embrace regexps and treat them as first class citizens).
but that's the thing, not even the "reasons not to use it" are unique to Perl any longer: heck, if you want to write incomprehensible code for "job security" reasons, Ruby gives you enough rope to hang the whole neighborhood (and Python too has a "dark side", but fortunately most people don't know or want to learn about it)
I have used CPAN for many years and it is so much more rock solid and automagic. If a mirror is down it jumps to the next one without a beat.
The CPAN modules are great too. I was using XML:Simple recently, but the XML files got too big. So I looked around a little and started using XML:Twig, which works great. Then I needed to sort alphabetically words in a variety of languages. So I went with Sort:ArbBiLex which allows me to create my own sort dictionary and has suggested Western language dictionaries on the documentation page. And yes, it has a cmp call which allows for easy multi-column sorting. For whatever problem I have, it seems someone has already written a module for it, which I can get going with little effort.
I can open up a text editor and start writing C, or Java, or Perl, or PHP - all without that much thought on whitespace, indentation etc. I can later run indent -kr, or perltidy, or astyle and so forth and make the code I banged out look nice and tidy. Sometimes I feel like doing the nice indentation myself while coding, sometimes I do not and let the scripts do it. With Python "there is one way to do it" and you have to think about indentation while coding. It is annoying. It is like Java and exceptions, forcing me to put try/catch loops everywhere and messing up my scope - even for a little prototype program which will be run once and will never need to catch an exception. It is treating me like I am an idiot and forcing me to work in a regimented manner.
When I first learned Python, at one point I decided to put a do/while loop in my program. I was not able to discover how this was done in documentation. I go on IRC #python and am told Python has no do-while loops (which I later confirmed is true). I was told, and I am assuming the source knows more than me, that this is due to the indentation system. One screwy thing done as a result of another screwy thing.
There are a lot of nice things about Python. The code is clean and understandable. It sometimes allows you to do in 2-3 lines what might take 10 lines in another language. And so on. But some programmers feel certain aspects of it are drawbacks, and these things are not easily dismissable. If they were, they would not be brought up again and again.
while(some_condition):
do_stuff do_stuff
while(some_condition):
do_stuff
The advantage of do/while in this situation is avoiding the duplicate code. while True:
codeHere()
if shouldStop():
break do_stuff
while(some_condition):
do_stuff[1] E.g.:
int main() {
}
vs. int main()
{
}
This is an apt analogy because most companies will have some sort of code style guide that you have to follow, which doesn't make "coding at company X where bracket placement is enforced" much different from "coding in Python where whitespace is enforced."I've yet to come across someone that had a severe hatred of Python due to the significant whitespace that was a programmer I respected. The last person that I knew (who had a visceral hatred of Python whitespace) wrote Perl code like this:
sub func1 { shift->func2(shift)->func3(@_) }
or sub func1 { grep { $_[0]->func2($_) } $_[0]->func3() }
Note: These are literally code samples with the function names changed.I don't know any Perl programmers that would condone this sort of code. It's a maintenance nightmare, especially since these were not one-off instances. Seems to me that the people that have a hatred of Python's handling of whitespace don't like being 'constrained' by their language, and are probably happier with Ruby or Perl.
For most things as an hiring manager I'm OK with people working with their favourite language on whatever project I assign them to (as long as it isn't too esoteric; OCaml is OK, but Haskell is probably pushing it a bit too far, for instance), except when they have to work on an existing code base, in which case I wouldn't want to hire someone hating it; they'd be miserable and the resulting code would be awful.
I think it's quite reasonable to be suspicious of a interviewee who is against Python solely because it enforces sensible code indentation.
There are a numbers of things to dislike about Python; however, after you used the language for a while, you realize significant white space isn't one of them. It is like saying lisp's parentheses are ugly: sure, you might not like them, but they are a huge reason the language (and, really, the way of thinking about code) is so powerful.
(Non)Problem solved.
Not to mention you should indent your code exactly the same way (in a consistent format, either tabs or spaces) with how you'd indented Python code.
print(reduce((lambda x, y:
x + y), xrange(10)))
print(reduce((lambda x, y: x + \
y), xrange(10)))
HINT: It runs.I'm using Python from time to time, but I wouldn't spontaneously use it for my personal projects, I prefer Perl for that.
The only languages I really wouldn't want to work with is Java.
doesn't
care
how
much
whitespace appears between words, only that there's more than none. Python definitely cares how much.
Don't get me wrong -- I like Python and I use it a lot, but its reliance on syntactically significant whitespace isn't in the plus column.
English has well-defined whitespace rules, as does nearly every programming language. Every programming language style guide I've ever read has talked about indentation, so you have to indent according to rules no matter which language you use.
Have you ever thought to yourself, "wow, there's no way I'll be able to finish this task on time because I have to indent according to Python's rules"? I'm guessing no.
Python has a few 2.x versions depending on the Distros. Some distros may opted to go 3.x only.
Ruby isn't necessarily universal on NIX systems.
Perl is.
I am currently looking for a couple software developers (https://news.ycombinator.com/item?id=5203736) for positions where Perl is the dominantly used language.
But there are other ways something like a language can die in: no new projects get written in it, no new programmers learn it etc. ...this is a slow "death in silence and darkness" (think Pascal).
It feels closer to Firefox, which is showing some renewed vigor lately, than to e.g. Tcl (sadly…).
This isn't really the only presentation/post about this. After all, it's not like Django and Rails receive the same amount of hype as they did in the beginning, so if you're just going by that, we probably all should switch entirely to Go and Node…