Live data from Hacker News

Ruby 2.0.0 Released

ruby-lang.org

151–160 of 303 posts

Re: Ruby 2.0.0 Released

#151

Anyone have any thoughts on why python and ruby are so similar, yet so far apart? They are obviously very close, because people switch between them all the time. And they are compared on everything (languages features, libraries, tooling...). I think it's a healthy competitive environment.

Ruby is Perl as it always should have been. Python is a dynamic variant of a better Java.[1] These result in two very expressive and potent languages with many similarities and with a lot of the best ideas of modern programming languages included (pure functions, lambdas, list comprehensions, etc.) but with fundamentally different core "belief systems" and zeitgeists. Ruby is very, very much a "there's more than one…

If you want a better java look at c#, its statically typed with minor type inference but it has some support for dynamic types(http://msdn.microsoft.com/en-us/library/dd264736.aspx).

Neither python nor ruby have any special support for pure functions, I suppose you could use some sort of decorator marking pure functions which one of those python subset compilers(or pypy) could use for performance optimization but I'm not aware of anything like this happening right now.

Also I don't think ruby supports list comprehensions it supports oo styled higher order functions, c# without the special syntax does the same thing. You may argue this is just a syntax but list comprehensions are just syntax that , you can rewrite them with nested for loops and appends(yields in the case of generator expressions)

I think in many although not all ways ruby is more of a smalltalk(but more practical).

Python doesn't exactly have an exact idealogical parent, although it has ABC as a historical parent(http://en.wikipedia.org/wiki/ABC_%28programming_language%29). Python outside of core imperative freeform do your own thing, want to write a oo based solution sure, want to write large imperative functions, go ahead, want to use modules to organize those go ahead. Want to use named function arguments or kwargs or objects or dictionary args go ahead. You can choose to use itertools, or your own yielding functions, or generator expressions sure.

Re: Ruby 2.0.0 Released

#152
post #131

Earlier quoted context omitted.

Just as note: I don't really would call "len(o)" a "legacy call", as in "something it's here just for backward compatibility, but it's ugly and please don't use it". It's more "the good way to do it" :D len() is a perfect example of the duck typing and the "protocol-based" philosophy of python: its implementation it's something like def len(object): return object.__len__() as in "just return the result of invoking th…

You see, you wrote a bunch about how len is so cool in Python. But in the face of dynamic typing and polymorphism I didn't expect it to be any different really. Languages like Go that are statically typed make more of an issue about interfaces. Even in Dart they dropped explicit Interface usage in favor of implicit interfaces, considering that Dart is more explicit about matters than Ruby is. Switching those function…

I don't get the last part...

in python a class is written as

    class InPython:
       def aMethod(self):
           pass
but... what I'm missing? I can't follow the reasoning...

regarding the C extensions... I didn't really needed to write one, but from http://docs.python.org/3/extending/extending.html#a-simple-e... I see

    static PyObject * 
    spam_system(PyObject *self, PyObject *args)
    ...
so I assume also on C level the python objects are mapped on some structs in OO fashion...

I honestly have no idea on how is (or if it has some meaning) to extend python in rpython on pypy, but in this case I assume there are some objects involved :D

Re: Ruby 2.0.0 Released

#153
post #111

I do wonder about the long term success of Ruby. Rails is easily the most visible project for Ruby. Rails is big, and all that code represents a high barrier to entry for any framework in a different language that wants to compete. However, a lot of people I talk to are moving to pure JS front-end + REST backend. In this world Rails doesn't deliver any particular value (in my opinion). Ruby also has utility for doing…

As a Ruby user that finds Rails annoying and not something I like working with, I don't think that's all that relevant. A lot of people have come to Ruby because of Rails, but a lot of Ruby people dislike Rails too. There's a plethora of web frameworks for Ruby that have sprung up exactly because of people who want to use Ruby but don't like Rails. In terms for barrier to entry with Python, the issue is that a lot of…

You seriously would turn down a good job or other opportunity if the only downside was having to write in a whitespace-sensitive language?

Most of the good developers I know have their preferences for sure, but can be productive in all sorts of languages.

Re: Ruby 2.0.0 Released

#155

I do wonder about the long term success of Ruby. Rails is easily the most visible project for Ruby. Rails is big, and all that code represents a high barrier to entry for any framework in a different language that wants to compete. However, a lot of people I talk to are moving to pure JS front-end + REST backend. In this world Rails doesn't deliver any particular value (in my opinion). Ruby also has utility for doing…

> I just think it will slowly become less relevant. That's true for virtually anything. Do you think C/C++ or Java or JS will be mainstream 30 years from now. They will be in the same situation FORTRAN is today: important because of lots of legacy code, but not a viable choice when starting a new project. Of course some of them will never die. LISP comes to my mind. :-)

The rumours of Fortran's death are greatly exaggerated.

People still write new code these days in Fortran for scientific computation. Fortran compilers are still markedly better at optimizing numerics, multi-dimensional arrays, etc, partially because of the effort invested in the compilers and partially because the language is easier to optimize.

It's definitely a niche language.

Re: Ruby 2.0.0 Released

#156
post #81
post #10

Today, I'll lose at least 50 karma points, but it's worth: Why people still use Ruby? 1. Because they get dream day rates for maintaining rusty slow legacy systems 2. Because they do not want to learn new languages and can stay in their comfort zone 3. Because they think it's still 2005 and nobody cares about slow server response times And now Ruby lovers, click on downvote or give your reasons why you still use Ruby…

Ruby lovers are all about "feelings" and "style", they don't care if their language of choice is objectively worse than, say, Python or Lua. Ruby truly is the Apple of the programming world.

> Ruby truly is the Apple of the programming world.

No fucking way.

Re: Ruby 2.0.0 Released

#157
post #57
post #10

Today, I'll lose at least 50 karma points, but it's worth: Why people still use Ruby? 1. Because they get dream day rates for maintaining rusty slow legacy systems 2. Because they do not want to learn new languages and can stay in their comfort zone 3. Because they think it's still 2005 and nobody cares about slow server response times And now Ruby lovers, click on downvote or give your reasons why you still use Ruby…

Should we learn some 'new' and 'fast' language, then code slow service?

Now tell me, did you initially learn to code just because you liked fast things? There is more to it.. it's sad when these "once-IT-lovers" forget about this part completely.

I believe that Ruby was born in the first place with a kind of a sentiment of not wanting at all to become the speed optimization guy if that ever means sacrificing the part in itself that allows for so much freedom and creativity! And I guess this is exactly how the community around it feels it.

You get the good milliseconds stats, plus money.

A Rubyist might respond with a bunch of more ms. here and there(for now); he gets the same money; he has much more fun.

Is it so hard to understand ?

Do you still enjoy programming like you did in the first days? If not, take a look at Ruby, seriously :)

Probably, better Ruby performance will come with time, but if Ruby will fail in the long term, then it will happen just because of a new more performant, but equally (or more) fun/smart language.

In conclusion I think that Ruby has the merit of having woken up the feeling that programming can always be as fun as the first days and.. that it doesn't have to transform you into a sad, dissociative geeky looking person anymore.. :P

No offense intended!.. :)

Re: Ruby 2.0.0 Released

#158

Earlier quoted context omitted.

What do you mean by "so far apart"?

I think they are very different too... I just can't explain how or where. Some people SWEAR by one of the two, and refuse to use the other. That's pretty harsh for languages that similar. There must be a reason... (The simplicity vs elegance argument makes sense) Edit: I think I mean the communities are far apart.

If Python vanished/became closed source/stopped being used tomorrow, I'd most likely switch to Ruby as it's the closest available language. Ironically, this similarity is exactly why I am least motivated to get into it. Why invest the time and effort to learn a new language, idioms and ecosystem that have almost 1-1 equivalents in a platform I know inside out for 8+ years?

Re: Ruby 2.0.0 Released

#159
post #23

Anyone have any thoughts on why python and ruby are so similar, yet so far apart? They are obviously very close, because people switch between them all the time. And they are compared on everything (languages features, libraries, tooling...). I think it's a healthy competitive environment.

I was thinking about this lately a lot as I started doing some Python after almost 10 years of Ruby, I think it boils down to the simplicty vs. elegance tradeoff. If you want to have elegant, very high-level APIs that hide a lot of details, like Rails with has_many :posts in class definitions etc. you have to sacrifice simplicity and transparency - this is what defines Ruby in comparison to Python, in hundreds of pla…

I think maybe different communities attract and cultivate people with different sense of aesthetics. I originally learned Django and have been picking up a little bit of RoR. I never found the additional context-specific RoR "magic" to be particularly elegant. It definitely reduces the number of lines of code, but I think to be elegant you need be as concise as possible while still remaining clear.

Re: Ruby 2.0.0 Released

#160

Earlier quoted context omitted.

I think they are very different too... I just can't explain how or where. Some people SWEAR by one of the two, and refuse to use the other. That's pretty harsh for languages that similar. There must be a reason... (The simplicity vs elegance argument makes sense) Edit: I think I mean the communities are far apart.

I'm a rubyist. I have nothing against python at all, but I have zero interest in learning it. Why? Simply because if I'm going to devote mental capacity to a new language I want it to be more different. Haskell is my current choice because as far as I can tell it is the opposite of Ruby in every way except the one that is my primary criteria for interest in a language: concision.

I think the true measure of a language is how little it makes you swear when trying to make changes to your own code that you wrote a year ago.
Post reply on HN