Live data from Hacker News

Ruby 2.0.0 Released

ruby-lang.org

231–240 of 303 posts

Re: Ruby 2.0.0 Released

#231
post #175

Earlier quoted context omitted.

I think that ruby, perl, python and javascript are similar only in purely theoretical way. Python - is "executable pseudoscript". It does not have ruby elegance, perl "worse is better", javascript ... minimalism(?) I'm using python for prototyping. As communication tool. I can describe all python scetches to every programmer, be it javer, c-sharper, C-developer or SQL-er. Can I use perl/ruby/CSharp/Java/F#/Haskel? An…

> Perl: sigils, regexp everywhere (when it not needed), parameters passing, "use strict", strange OOP - all those features makes it impossible for prototyping. > Ruby: it's the same as for perl Nothing you said about Perl can be applied to Ruby.

"The same" means "ruby as pseudocode is the same as perl".

You need to explain that 0 is True.

You need to explain blocks, (int_number).times and other cute things.

And I heard a lot of complains for whitespace, but begin-end is more irritable for many.

Re: Ruby 2.0.0 Released

#232
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 have a valid question, you didn't have to ask it so sneeringly.

I am a fan of Ruby in big part because of how it handles objects. In Ruby, everything is an object. Objects' only public interface is their methods. These methods don't require a pair of parenthesis to call them, so you can call them as you would access a public variable in other languages. You can easily set up getter/setter methods for an instance variable via an "attr_accessor :instance_variable" call within the class definition, or you can define its "instance_variable" and "instance_variable=" methods yourself.

This combination of things is I think Ruby's killer feature and makes for a very elegant workflow. You should give Ruby a chance :)

Re: Ruby 2.0.0 Released

#233
post #152

Earlier quoted context omitted.

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…

Exactly. In Python you still pass "self" to the method. In Ruby and Dart it's not needed. In Python I've seen Python users discourage the use of classes. I haven't seen the same distrust of classes in Ruby for instance. It's as though Python has unresolved OO issues. Python could take pride in being "multi-paradigm", whereas languages like Ruby and Dart could take pride in being more OO. Regarding the C extensions of…

>>Say we can't find anywhere in Python where Objects don't exist.

You're correct - we can't find a place in Python where Objects don't exist. Python and Ruby are exactly same in this.

>>Then welcome on board of true OO. Now show OO some love and stop discouraging the using of classes.

What do you mean by true OO?

It does not matter if you "love" objects or not. You can't write in python without OO. Every python module is an object, defs and vars - members of object. (Even classes and other modules are members of module object).

Re: Ruby 2.0.0 Released

#234
post #97

Earlier quoted context omitted.

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…

that's about 3.3k requests per second. How many hosts is that spread across?

Maybe too many, I guess. Not giving any real numbers, but I suppose with JVM this could be much less. Oh hell, even with some refactoring here and there we reduced the overall CPU usage a lot. Like I said, with real traffic, the bang methods are a much better choice even though the functional programmer in me is against them.

Re: Ruby 2.0.0 Released

#235
Basic Ruby 2.0 benchmarks calculating pi from gist [1]

$ ruby --version

ruby 1.9.3p385 (2013-02-06 revision 39114) [x86_64-darwin12.2.1]

$ time ruby pidigits.rb 10000 2>&1 > /dev/null

17.51s user 0.11s system 99% cpu 17.639 total

$ ruby --version

ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-darwin12.2.1]

$ time ruby pidigits.rb 10000 2>&1 > /dev/null

4.64s user 0.27s system 99% cpu 4.927 total

That's a significant difference in speed. Going from 17.51 seconds to 4.64 seconds

1. https://gist.github.com/thoughtpolice/5025417

Re: Ruby 2.0.0 Released

#236
post #224
post #111

Earlier quoted context omitted.

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…

Pythons whitespace usage, for example, makes it DOA for me. I'm not touching it. If it works for you, great. It doesn't work for me. This has to be up there with people claiming they don't like Lua because array indexing starts at 1 instead of 0. Of all the weaknesses of Python, focusing on something so superficial just seems lazy. Perhaps in the future just say that you're experienced and comfortable with Ruby and h…

Python's whitespace-as-logic means that, for any given project, every editor used by every developer needs to have the same the same definition of what a "tab" is, because mixing tabs and spaces can introduce logic errors.

You can reasonably argue that a project team should already have and enforce a coding style guide, so specifying a "tab" isn't a big deal. But what if you're part of two separate projects which different coding standards? Do you use Editor A for Project A, and Editor B for Project B? Or do you maintain separate configuration profiles, one for each project? Granted, this also isn't a big deal: Just "git checkout ProjectA" in the directory where you keep your preferences before you start coding. But it is an extra step in your workflow.

You can use the "-t" or "-tt" flags to spit warnings or errors if someone mixes tabs and spaces, so any conscientious group can easily catch whitespace incompatibility problems. But Python's whitespace usage has organizational consequences, and it can affect a developer's choice of tools and/or workflow. For some people, this is not a superficial impediment.

Re: Ruby 2.0.0 Released

#237

Basic Ruby 2.0 benchmarks calculating pi from gist [1] $ ruby --version ruby 1.9.3p385 (2013-02-06 revision 39114) [x86_64-darwin12.2.1] $ time ruby pidigits.rb 10000 2>&1 > /dev/null 17.51s user 0.11s system 99% cpu 17.639 total $ ruby --version ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-darwin12.2.1] $ time ruby pidigits.rb 10000 2>&1 > /dev/null 4.64s user 0.27s system 99% cpu 4.927 total That's a significan…

If we see these sorts of improvements overall, then this is a very exciting update

Re: Ruby 2.0.0 Released

#238

Earlier quoted context omitted.

C and C++ will very likely still be "mainstream" 30 years from now. Essentially every important piece of software today, from operating systems to programming language implementations to server software to applications, is written in one or both of them. All of these systems are not just going to go away. C is over 40 years old, and C++ around 30, yet in that time nothing has come along that can compete with them. So…

Go is making a strong go at it. No pun intended.

Go hasn't really seen much success. It isn't as obscure as many other languages, and being supported by GCC does help it out, but we haven't seen any major adoption of it. Maybe that'll change at some point, but it doesn't look very likely.

Re: Ruby 2.0.0 Released

#239

Basic Ruby 2.0 benchmarks calculating pi from gist [1] $ ruby --version ruby 1.9.3p385 (2013-02-06 revision 39114) [x86_64-darwin12.2.1] $ time ruby pidigits.rb 10000 2>&1 > /dev/null 17.51s user 0.11s system 99% cpu 17.639 total $ ruby --version ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-darwin12.2.1] $ time ruby pidigits.rb 10000 2>&1 > /dev/null 4.64s user 0.27s system 99% cpu 4.927 total That's a significan…

If we see these sorts of improvements overall, then this is a very exciting update

Agreed. Testing against some of my production apps now to get a better feel.

Re: Ruby 2.0.0 Released

#240
post #224

Earlier quoted context omitted.

Pythons whitespace usage, for example, makes it DOA for me. I'm not touching it. If it works for you, great. It doesn't work for me. This has to be up there with people claiming they don't like Lua because array indexing starts at 1 instead of 0. Of all the weaknesses of Python, focusing on something so superficial just seems lazy. Perhaps in the future just say that you're experienced and comfortable with Ruby and h…

Python's whitespace-as-logic means that, for any given project, every editor used by every developer needs to have the same the same definition of what a "tab" is, because mixing tabs and spaces can introduce logic errors. You can reasonably argue that a project team should already have and enforce a coding style guide, so specifying a "tab" isn't a big deal. But what if you're part of two separate projects which dif…

This is a non-issue. Just follow PEP 8, which clearly suggests to "Use 4 spaces per indentation level."

PEP 8 has been around for over a decade, so there's no excuse for not following its recommendations.

Post reply on HN