Hacker Newsnew | past | comments | ask | show | jobs | submit | akehurst's commentslogin

Add WebWare to the list.


no default case?


not having a default case actually makes a message: silence. as in I already forgot about cuil because the media is silent about it.


Why I hate ruby.


Since I don't use ruby either...I tried a web based interpreter.

   >> (1..100).inject(&:+)                                                 
   TypeError: wrong argument type Symbol (expected Proc)                   
     from (irb):1         
I also am not a fan of doing things a thousand different obscure ways. I like doing things one way, and having that way highly optimized. Typing 10 characters or 20 characters doesn't impact my programming speed, I spend far more time thinking about how to do things the right way.

edit:

Ok, did his monkeypatch and it worked. You get 5050. So it is equiv to sum(range(101)) in python, and much less readable. I fail to see why this is a good thing.


"I fail to see why this is a good thing."

Why what is a good thing? Why that line of code is a good thing? maybe it isn't, maybe arrays need a sum method, maybe you could just write:

(1..100).inject { |acc, n| acc + n }

...and get the same result. But the article has nothing to do with why that line of code is a good thing, it is about the fact that being able to modify the Symbol class in this manner is what makes a langauge like Ruby evolve from the bottom up.

So... do you think that is a good thing? Or a bad thing?


I think that style of code is rather hard to read and really doesn't add any functionality that couldn't be done in a much more readable way in the same number of characters.

So I am wondering why the author thinks its so fantastic.

As for developing the language, I am usually for flexibility and allowing anything to be modified, however this type of change strikes me as not very useful.


"I am usually for flexibility and allowing anything to be modified, however this type of change strikes me as not very useful."

That's entirely the point. If you are in favour of flexibility, you have to accept that people will use it for all sorts of things, not just ones you like.


I was talking about the fact that they are making that change on the core language. Providing the flexibility is different from putting it in the language.

Anyways, I don't really care, saying anything other than 'I love ruby' is shunned anyways.


"saying anything other than 'I love ruby' is shunned anyways."

Well... I welcome criticism of Ruby. Please say whatever you like in a comment right on the post.

I've never shied away from writing about the things in Ruby that irritate me. How else will we progress if we don't scratch when we have an itch?


It won't work unless your web-based interpreter runs Ruby 1.9, or you also paste in his monkeypatch to the Symbol class.


I refuse to be blamed for Symbol#to_proc, it's a part of Rails and also Ruby Facets.


Yeah I didn't mean to blame you... I actually like it, so consider it a complement, but it was just the easiest way to describe what patch I was talking about, since you had it in your article.

Any idea who specifically wrote it initially?


The post? Or the quoted snippet of code?

;-)


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: