Live data from Hacker News

Ruby 2.0.0 Released

ruby-lang.org

71–80 of 303 posts

Re: Ruby 2.0.0 Released

#71
post #49

Overall, a good feature set. I only see some utility for keyword arguments, admittedly, but I tend to write very functional code, so maybe other people will get more mileage. Refinements, as I understand them, are a bad idea. I understand the motivation, but this is not the way to go about it. There's now a new scope all over the place (the set of refinements applied to any given class). This means that the behavior…

Agreed regarding refinements. I will personally stay away from them until some braver souls find best practices for them in long-term projects. Even then it will take some convincing.

I have been awaiting Ruby keyword arguments for a very long time, but the first time I heard them brought up (relating to 2.0), the person explaining had some qualms with how they were implemented. For the life of me I cannot remember what bothered them, but if that rings a bell for anyone else, please chime in.

Re: Ruby 2.0.0 Released

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

You don' know what you're talking about. I lead the web team for local.ch, we have 4mil unique clients a month and handle 10k requests per minute in peak traffic. Our site is developed in Ruby on Rails, with average response times from in the 150ms range. We replaced our legacy PHP system last year and will never look back. Ruby 2.0 will be our future, and I'm happy about that.

Re: Ruby 2.0.0 Released

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

You might as well ask why people still use Java. Because it works for their purposes, is popular (i.e. has market demand), and there aren't enough perceived incentives to move to a newer/better language yet. I'd very much like to learn the next great framework and its language - I just haven't been convinced by any of the front-runners quite yet (especially in terms of ecosystem resources). When that happens, you can…

> why people still use Java

I am not into Java but I'd rather prefer using Java the next 10 years than Ruby 1 month. At least I get a perfect language implementation (the JVM) with Java.

Re: Ruby 2.0.0 Released

#74
post #49

Overall, a good feature set. I only see some utility for keyword arguments, admittedly, but I tend to write very functional code, so maybe other people will get more mileage. Refinements, as I understand them, are a bad idea. I understand the motivation, but this is not the way to go about it. There's now a new scope all over the place (the set of refinements applied to any given class). This means that the behavior…

> but I tend to write very functional code

A bit offtopic, but since you said that and you seem to be both fond of functional programming and in touch with latest ruby developments, you're probably a good person to ask: How the heck do you do "normal/proper" currying in Ruby? And how do you do it with keyword arguments? (I'm trying to compile a list of functional-idiom examples in popular dynamic language, and when I reached Ruby and currying, all the snippets I found made me go "WTF?!"...)

Re: Ruby 2.0.0 Released

#75
post #50

Earlier quoted context omitted.

I use Ruby some, but I'm not sure I'd describe it as clean exactly. I've used Python a bit recently and was struck by just how clean it seemed. (I'm not sure Python has anything that quite replaces blocks, though. I don't claim Python's all better than Ruby.)

Cleanliness is subjective, but: * Everything is an object, without exception. * The object model is pleasingly orthogonal and its behaviour is easy to understand and predict once you know how it works. * The syntax is high on alphanumerics and low on punctuation. * Most of the core library method names strike a good balance between brevity and clarity. * `Enumerable` is simple and powerful.

Amusingly, you could be talking about Ruby or Python on all of these points (if you swap swap "Enumerable" for "the iterator protocol").

Re: Ruby 2.0.0 Released

#76
post #75

Earlier quoted context omitted.

Cleanliness is subjective, but: * Everything is an object, without exception. * The object model is pleasingly orthogonal and its behaviour is easy to understand and predict once you know how it works. * The syntax is high on alphanumerics and low on punctuation. * Most of the core library method names strike a good balance between brevity and clarity. * `Enumerable` is simple and powerful.

Amusingly, you could be talking about Ruby or Python on all of these points (if you swap swap "Enumerable" for "the iterator protocol").

Arguably so. :)

In my opinion Ruby pips Python to the post (however slightly) in each respect, but it's clearly a question of taste.

Re: Ruby 2.0.0 Released

#78
post #49

Overall, a good feature set. I only see some utility for keyword arguments, admittedly, but I tend to write very functional code, so maybe other people will get more mileage. Refinements, as I understand them, are a bad idea. I understand the motivation, but this is not the way to go about it. There's now a new scope all over the place (the set of refinements applied to any given class). This means that the behavior…

Totally agree about refinements. Hopefully the community pushes back enough on that experiment so it gets deprecated and removed. A better design approach to achieve this effect is wrapper objects (similar to jQuery and Underscore.js) where I can add functionality to existing objects. Ruby has everything we need for this already, and makes it quite easy to do.

Aren't refinements a "fixer feature", i.e. something 99% of developers should just ignore it until they really get into a problem with badly done monkeypatching, then use it to solve the problem and just move on? Why do people get so excited about them, both in a good and in a bad way? Just use them inside your library code and make sure people using your lib/framework can just pretend they don't exist, keep monkeypatching "chained inside" as your dirty little secret:P)

Re: Ruby 2.0.0 Released

#79
post #74
post #49

Overall, a good feature set. I only see some utility for keyword arguments, admittedly, but I tend to write very functional code, so maybe other people will get more mileage. Refinements, as I understand them, are a bad idea. I understand the motivation, but this is not the way to go about it. There's now a new scope all over the place (the set of refinements applied to any given class). This means that the behavior…

> but I tend to write very functional code A bit offtopic, but since you said that and you seem to be both fond of functional programming and in touch with latest ruby developments, you're probably a good person to ask: How the heck do you do "normal/proper" currying in Ruby? And how do you do it with keyword arguments? (I'm trying to compile a list of functional-idiom examples in popular dynamic language, and when I…

Ruby only has built-in support for currying procs:

  >> add = -> x, y { x + y }
  => #
  >> add.call(3, 5)
  => 8
  >> add.call(3)
  ArgumentError: wrong number of arguments (1 for 2)
  >> curried_add = add.curry
  => #
  >> add_three = curried_add.call(3)
  => #
  >> add_three.call(5)
  => 8
If you want a no-brainer way of currying methods, you're SOL.

Re: Ruby 2.0.0 Released

#80
post #49

Overall, a good feature set. I only see some utility for keyword arguments, admittedly, but I tend to write very functional code, so maybe other people will get more mileage. Refinements, as I understand them, are a bad idea. I understand the motivation, but this is not the way to go about it. There's now a new scope all over the place (the set of refinements applied to any given class). This means that the behavior…

Have they removed any features?
Post reply on HN