Live data from Hacker News

Ruby 2.0.0 Released

ruby-lang.org

91–100 of 303 posts

Re: Ruby 2.0.0 Released

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

People program in what they know and what gets the job done in the most optimal way for them. Learning a new language without a good reason past certain users not liking it is silly.

Plenty of people criticize Notch for using Java in all of his games, but Notch gets things done. It's hard to ridicule someone making so many useful things (well you can, but most end up looking like jerks lacking tact). Might not be in the coolest or most efficient language, but the results speak for themselves.

People use x language because x gets things done for them, their business and it shows results. People that spend much of their day thinking about how they dislike a particular language and its users generally are not the ones being productive with their more enlightened language(s) of choice.

Re: Ruby 2.0.0 Released

#92
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.

but ruby culture is already one of modifying builtins, so using wrappers while arguably better, does not solve the issue which refinements solve.

Re: Ruby 2.0.0 Released

#93

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.

[deleted]

Re: Ruby 2.0.0 Released

#94

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 way to do it" language, while Python utterly rejects that and adopts the "there should be one, and preferably only one, obvious way to do it" philosophy.

[1]: Obviously this is a very slap-dash comparison which isn't meant to be taken 100% at face value and is merely meant as a way to help illuminate the ideological differences between Ruby and Python, it's not an invitation to start a flame war.

Re: Ruby 2.0.0 Released

#95
post #44

Earlier quoted context omitted.

Is that actually true that PHP is slower? Say something like Symphony2 vs rails for a reasonably complicated app. Is there much out there in terms of benchmarks? (I think we are both coming from that it really doesn't matter most of the time side but would be interesting to know if PHP is actually slower).

I don't know about Rails, but as a Symfony2 user, it's actually a bit on the slower side compared to other PHP frameworks. But ~300ms server response times is nothing if your end user has to wait 5-6 seconds for the page to render due to suboptimal frontend code. Plus, throw in varnish/nginx microcaching and requests drop to ~10ms regardless of your framework.

> But ~300ms server response times is nothing if your end user has to wait 5-6 seconds for the page to render due to suboptimal frontend code.

True for a single request, but once you start getting lots of concurrent requests all those ~300ms server response times start adding up quite quickly.

When Twitter started out, their use of ROR wasn't a problem. Once the service started to become popular, however, it was.

Re: Ruby 2.0.0 Released

#97
post #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.

We're having millions of unique clients per month and our peak traffic is above 200k requests per minute. Ruby delivers, although you need to be very careful what you deploy to the main app codebase. Especially to realize the speed differences between stuff like uniq vs. uniq! or the cost of creating new objects. It's enormous with big traffic.

There are some things I wouldn't do with Ruby here. Like some concurrent background jobs; better solution would be Clojure, Erlang or any language where the concurrency constructs are better thought and easier to manage. Although we're having threaded Ruby running, it's not very elegant and you can do pretty nasty bugs in there.

Re: Ruby 2.0.0 Released

#98
post #74

Earlier quoted context omitted.

> 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.

That's pretty much it; the only other way is to build a function combinator from a Proc or Lambda:

irb(main):004:0> multiply = -> a, b { a * b } => #

irb(main):006:0> square = -> a { multiply.call(a, a) } => #

irb(main):007:0> square.call(3) => 9

Re: Ruby 2.0.0 Released

#99
my personal best new feature is:

"The UTF-8 default encoding, which make many magic comments omissible"

because i'm from Germany and we had to add: # coding: utf-8

in every freaking controller to get our german stupid letters (öäüß) to run without problems.

so i'm looking forward to my next project where i can use 2.0 from the scratch.

thank u!

Re: Ruby 2.0.0 Released

#100
post #88

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.

I am a pythonista by hobby... and I've seen many times in these too many ruby / python comparison, that only in ruby "Everything is an object, without exception." but... I cannot find a "thing" that isn't an object, in python neither... care to tell me, or point to a link regarding to, what is the difference in this context between the two languages? Just an example or something like that. Thanks.

Trying to guess how Python works is quite hard if you're used to Ruby and other languages closer to Java.

As I don't know much Python myself, it's hard to tell where Python fails the "everything is an Object" check. But in Python some legacy calls were more procedural than OO, like "len(o)" rather than "o.len". I think eventually Python got to support both approaches.

I think Ruby is all objects even in its C abstractions. In Ruby, people create classes and so on in the RubyC abstractions that are visible to the Ruby language too. Not sure how Python does those.

I know Python has reference counting for Garbage Collection, so there are differences to their approaches in that regard and more.

Like Guido Van Rossum said, from 10,000 feet both Ruby and Python are more alike than different. He was saying that people should appreciate them more even if they belong to the community of the other one. That the real enemy is languages like Java that switch around the priority by making code that compilers prefer rather than programmers prefer.

I think Python has a Functions legacy that could not be as OO as they would be in Ruby.

Right now I'm more "in love" with Dart than with Ruby. Ruby was my first real love though.

Post reply on HN