Live data from Hacker News

Comparing PHP, Perl, Python and Ruby

hyperpolyglot.org

61–70 of 92 posts

Re: Comparing PHP, Perl, Python and Ruby

#61
post #51
post #49

Earlier quoted context omitted.

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?

Can't speak for all of them, but if a language has "there's more than one way to do it" as its main motto, I guess the people from the ecosystem are less likely to attack other languages.

Re: Comparing PHP, Perl, Python and Ruby

#62
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…

I agree with another comment in reply to yours that this is a tired argument. But ignoring that; someone who is new to programming is not going to understand the value of any of these concepts anyway, so it doesn't matter that they don't discover them immediately. At about the same time people figure out how to do OO cleanly, they will start hearing about libraries too. If you were to navigate a largish Perl codebase…

Fork Perl 5, package it so that Moose is default, and call it Perl 7.

Re: Comparing PHP, Perl, Python and Ruby

#63
post #40
post #19

Earlier quoted context omitted.

True, but PHP 5.4 doesn't even have a stable release yet & many people haven't even adopted 5.3.

5.3 Come out in 2009, I has a small list of backwards compatibility breaking changes ( http://www.php.net/manual/en/migration53.incompatible.php ), no reason for anyone really not to have adopted it.

my hosting is still on 5.2.17 and are in the "security testing" phase of 5.3.

Re: Comparing PHP, Perl, Python and Ruby

#64
post #38

The Perl described in this article is COMPLETE SHIT. He calls deprecated and improper libs for some functions, unnecessary libs in others, assumes improper or unoptimal syntax in other examples. The list goes on. Learn languages before releasing articles on them. He never even uses Perl's foreach in equivalency examples!! WTF.

Not sure it's a "he", it's a wiki-type thingie.

Also, you can report bugs on the table if things are not correct.

Re: Comparing PHP, Perl, Python and Ruby

#65

Wonderful reference for comparison! I admittedly haven't had time to pursue the whole table, but wanted to point out that there is indeed an increment and decrement in python: x += 1 x -= 1

An increment/decrement operator is unary and doesn't give you the ability to change the value by any more than one.

Re: Comparing PHP, Perl, Python and Ruby

#66

Very, very thorough. A great resource, thanks!

  Empty comments can be ok if they're positive. There's 
  nothing wrong with submitting a comment saying just 
  "Thanks." What we especially discourage are comments that 
  are empty and negative—comments that are mere name-calling.
--http://ycombinator.com/newswelcome.html

Re: Comparing PHP, Perl, Python and Ruby

#67

Earlier quoted context omitted.

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.

Do you have any support for this statement? Last time I checked they moved all of the api and backend infrastructure to Scala and were quite happy with it.

Re: Comparing PHP, Perl, Python and Ruby

#68
"Passing by reference" section is wrong about Ruby (not sure about Python). Ruby passes everything by reference, it's only that integers are immutable so that the function can't alter them. Strings, though, are mutable:

  def foo s
    s.concat 'foo'
  end
  a = 'bar'
  foo a
  a
  # => "barfoo"

Re: Comparing PHP, Perl, Python and Ruby

#69
post #63
post #40

Earlier quoted context omitted.

5.3 Come out in 2009, I has a small list of backwards compatibility breaking changes ( http://www.php.net/manual/en/migration53.incompatible.php ), no reason for anyone really not to have adopted it.

my hosting is still on 5.2.17 and are in the "security testing" phase of 5.3.

I wonder what they mean by security testing? What exactly are they testing and how? BTW given that there's no security patches released for 5.2 anymore (while bugs are still being found and published of course) - their understanding of security is certainly unorthodox.

Re: Comparing PHP, Perl, Python and Ruby

#70
post #68

"Passing by reference" section is wrong about Ruby (not sure about Python). Ruby passes everything by reference, it's only that integers are immutable so that the function can't alter them. Strings, though, are mutable: def foo s s.concat 'foo' end a = 'bar' foo a a # => "barfoo"

In python, strings are immutable as well.
Post reply on HN