Live data from Hacker News

Comparing PHP, Perl, Python and Ruby

hyperpolyglot.org

51–60 of 92 posts

Re: Comparing PHP, Perl, Python and Ruby

#51
post #49

Earlier quoted context omitted.

Why are there so many language wars-lovers in some open source communities...? Probably the same reason the French don't like the English or the Indians don't like the Pakistanis. The closer two things are to each other, the more passionate people are about the differences. My experience is that all the languages are identical. Python has a culture of cleanliness at the core, but there is a lot missing from the langu…

Learning a language is an investment. People defend their investment strategies lest they be considered a fool. Attacking alternatives is a form of defense. I fear it's as simple as that.

The original question was -- why do some communities seem to be more oriented towards language wars than others?

Re: Comparing PHP, Perl, Python and Ruby

#52
post #30
post #25

Earlier quoted context omitted.

It also means you have to stumble upon Moose to start using objects in a reasonably sane way. The average new Perl programmer is not going to go looking for a library that does object-oriented behavior until it's too late. They'll probably have some crazy idea that the language should be doing OO for them. If you were to navigate a largish Perl codebase today, you'd encounter the old-school bless, Moose trickiness, a…

>>The average new Perl programmer is not going to go looking for a library that does object-oriented behavior until it's too late. Sigh, please don't start language wars by stuff like assuming new programmers sits alone in an ivory tower and don't talk to people, read blogs or browse a new book. (Modern Perl discuss Moose before the old standard, for instance.) Edit: I'm just not going to touch where you assume all P…

>>Why are there so many language wars-lovers in some open source communities...?

Honestly, I think that the reason is simple: because it's entertaining. Yeah, sometimes I'm tired of reading the same arguments over, and over, and over again. But sometimes, an OP is particularly eloquent in his trashing a language, and I like that, even if the language he's trashing is my favorite.

The same goes with rants. I can't understand people debating over Linus Torvalds rant on C++. Honestly, I found it hilarious and well written. That's it, I'm looking no further because I know that this type of argument has no end.

I would certainly not care to debate the relative merit of my favorite language in one of those troll topics, but I do enjoy reading heated programmers exercising their writing skills against each other.

Re: Comparing PHP, Perl, Python and Ruby

#53
post #3

Earlier quoted context omitted.

PHP5.4 also has the short syntax array initializer: $array = [1, 2, 3]; Edit: While PHP still has it's fair share of issues, a lot of the same complaints people had 5-8 years ago aren't valid, and it probably has no more or less oddities than any other scripting language at this point.

The problem with PHP is that 99.99% of the code in circulation today isn't the shinier cleaned-up versions. It's PHP4 and PHP 5.0 and it's still chock-a-block with the storied mind-bending nastiness of yore.

It really depends on what types of place you're working at. In the past 6 years or so, I've worked on a lot of PHP, and nearly all of it was pretty high-quality, because I don't like working at companies that don't care about code. My point is, if you have the luxury of the same filter in your job choices, PHP isn't necessarily the big red flag it could be.

The only exceptions for me have been when I've had to deal with someone else's codebase, or with Wordpress (and Django once), but again, I wouldn't personally take a job where those were the main responsibilities.

Re: Comparing PHP, Perl, Python and Ruby

#54

sed begat awk. awk begat perl. perl begat python and ruby. python will get you a job at google. ruby will get you a job at twitter. php will get you a job at facebook.

I'm pretty sure the companies that you mentioned know enough about recruiting that they won't hire people solely based on the languages that they know. Skills transcend programming languages; especially among those similar-enough scripting languages.

Re: Comparing PHP, Perl, Python and Ruby

#55
This is a really great effort, but I noticed a handful of areas where the PHP example was off. I wonder if people with more experience with the other languages noticed the same thing for their language.

Some examples:

Null test:

    $var === null // omitted
    isset($var) // actually checks if $var exists and is not null (apparently--
        I actually didn't know about the not null part)
Undefined variable access: it's a notice. Many people consider it best practice in PHP to treat notices as error, because things like this are notices.

Add time duration

    strtotime('+10 minutes') is more typical than the objects
Array out of bounds behavior again issues a notice.

Re: Comparing PHP, Perl, Python and Ruby

#56

Earlier quoted context omitted.

not true at all. Maybe if you're looking at old sites, but PHP5's been out for a long time now, and most of the code in circulation is made for 5.2 or higher. No serious MVC framework, for instance, will run on anything less than 5.2.

Serious MVC frameworks are not the backbone of Wordpress, phpBB or dozens of other hairy monsters that make up the majority of CPU time spent on PHP execution. I mean Wordpress flat out resisted PHP 5.0 for years. Years . Everything had to be done in PHP4.

The latest Joomla Platform requires PHP 5.3, includes tests, and is actually a half-decent MVC framework.

https://github.com/joomla/joomla-platform

Re: Comparing PHP, Perl, Python and Ruby

#57
post #32

Earlier quoted context omitted.

> I mean Wordpress flat out resisted PHP 5.0 for years. Years. Everything had to be done in PHP4. I presume that's because of the size of Wordpress' install base. The number of people who run their software on $9/month shared hosting environments is staggering. Many of those are late to upgrade PHP versions. Wordpress gets a lot of crap for being poorly written but the truth is that it's an example of software that w…

Wordpress gets a lot of crap for being poorly written because it is poorly written . There's no great mystery here. Yes, they deal with lots of different configurations. This is not unique in the history of software development. It's called "portability" and many organisations seem to be able to achieve it without compromising quality. My searing, eye-boiling hatred for Wordpress comes from administering it for what…

You probably have more experience with Wordpress than I do so I won't try to argue with that :).

Re: Comparing PHP, Perl, Python and Ruby

#58
post #25

Earlier quoted context omitted.

That being said, it would also be useful to characterize features that are completely unique to a given language. Perl has all these features. 1) a unique and powerful version of super() for working with multiple inheritance Perl (with Moose) has before, after, around, override, and augment in addition to super. And, it has "Roles" so you don't have to resort to hacks like multiple inheritance to implement mixins or…

It also means you have to stumble upon Moose to start using objects in a reasonably sane way. The average new Perl programmer is not going to go looking for a library that does object-oriented behavior until it's too late. They'll probably have some crazy idea that the language should be doing OO for them. If you were to navigate a largish Perl codebase today, you'd encounter the old-school bless, Moose trickiness, a…

I'm not a Perl programmer, but I'm aware of Moose. It's frequently mentioned in beginner tutorials on how to do OO.

Re: Comparing PHP, Perl, Python and Ruby

#59
post #17

[I wonder if this is a personal watershed for Hacker News?] These languages are essentially the same thing. I often write code in at least 3 of these languages most days, and I simply translate the minor differences between them in my head. "Hyperpolyglot" -- excess in many tongues -- I don't think so. Learn at least some static languages, assembler and some functional languages, and then post something interesting o…

Nothing I love more than watching someone try way too hard to act "grizzled" and in the process make an idiot out of themselves. http://hyperpolyglot.org/

Was that in response to his exhortation to learn different languages, or do you actually believe that Perl and its self-proclaimed successors have any profound differences?

Re: Comparing PHP, Perl, Python and Ruby

#60

sed begat awk. awk begat perl. perl begat python and ruby. python will get you a job at google. ruby will get you a job at twitter. php will get you a job at facebook.

ruby will get you a job at twitter. I heard that twitter are moving from ruby to scala.

that was more then a year or two ago, they changed their mind in the meantime. they do have some cool software developed in scala I think.
Post reply on HN