Hacker News new | past | comments | ask | show | jobs | submit login

When I first encountered Python, it was as an alternative to Perl.

Given the choice between Perl and Python, I think it's clear why the latter won out.




> When I first encountered Python, it was as an alternative to Perl.

Me too

I am amazed that Python won out against Perl

Perl is much easier to use. Does not have the incredibly irritating treatment of whitespace

Perl was a disrupter, whereas Python was "computer sciencey". A false dichotomy but it really mattered to people


Perl being easier to use is a joke... Ruby suffers the same issue as Perl does - you can do the same thing a million different ways, that's too many.


a million different ways, but all with liberal use of human-unfriendly symbols like dollar signs, at signs, pound signs, etc.


Some people (me included) LOVED the whitespace-as-a-feature. I had swam through too many scripts where everything (regardless of nesting level) was all on the first character of a line or otherwise spaced randomly where my first step was to properly indent just to understand what it was doing. A language that enforced that was a Godsend.


Nowadays in languages like C/C++/Go/etc we typically enforce the use of an autoformatter to convert source code to a canonical style. It's also great for removing all discussion of such formatting from code reviews.


Goes to show there is no pleasing everybody


“masterstoke” was the term I used when I discovered it.


I loved Perl. I _loved_ it. It was so much fun. It felt like vim in how you could guess weird corners of the language.

But every reason that made it fun is also an actual reason why it's a nightmare unless you are very strict in how its used. Strict on things like whitespace.


I was about to say, as much as I enjoy python.

Perl is more effective than Python. You can do some pretty amazing things in Perl in a few lines. You can also do amazingly readable scripts in Perl.

But... if you aren't careful how you write perl, it's a very bad pit to fall down to.

Python just forces you to write code that's better for the team.


Whitespace strictness is the biggest downside of python.


The use of whitespace in Python was controversial 20+ years ago. These days it seems like no big deal.

The only annoyance is when copy-and-pasting code from one place to another, the indentation can get screwed up, which is a small annoyance.

But other than that, this seems like an argument that was settled 20 years ago.


In my experience, Python has way bigger warts than something that's just automatically handled by my IDE.


It’s the biggest upside.


A bizarre opinion to be sure. Python is vastly more readable then Perl and is far easier to write as well, hence so many educators in schools reaching for it.


I can understand a love of Perl by folks who love a good puzzle, or who are interested in "code golf" (trying to get something done in the fewest number of characters).

But those are not great traits for a general-purpose programming language. I agree with the other response: "Python just forces you to write code that's better for the team."


Perl is a write-only language, whereas Python almost reads like pseudocode. They're on absolutely opposite ends of the readability spectrum.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: