Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> After getting comfortable reading code with so many parentheses

I never managed to get over the ().

Ruby has a very flexible syntax, compared to many other languages, in that you can omit syntax in many cases. For instance, using () for method calls is largely, for the most part, optional. So when I have the python code:

    cat = Cat()
    cat.meow()
I find it worse than the ruby code:

    cat = Cat.new
    cat.meow
(Though you can use () in ruby there too; but most people won't do so as there is little point in that.)

This is a superficial issue though. Python's biggest mistake is to require implicit self. It always feels as if I need to hand-hold python and trying to explain to it what an object is and what self is. In ruby I don't have that issue. Note that I find both languages fine, but ruby is "more" object oriented than python is, for many reasons.

Lisp is quite different though. I had some exposure to it via scheme and while it can be fun, I feel that lisp is a worse programming language than either ruby or python. The old game haxima/nazghul was given up eventually, primarily due to lack of time, but also because the author was no longer convinced of scheme (the core of the engine is in C if I recall correctly). He tried to switch to python, though, which did not work (but, again, I think it was mostly due to lack of time). The scheme code in haxima/nazghul was quite interesting (https://sourceforge.net/projects/nazghul/ if you want to look at the scheme code there), but I much prefer either ruby or python there. Although it would be interesting to have DSLs that would really focus on the game or project at hand, like in the old Zak McKracken game.



> the ruby code: ``` cat = Cat.new cat.meow ```

As a non-Ruby user, this confuses me. Why can't `Cat.new` be a function reference? Does Ruby explicitly disallow this (i.e. passing around a function)?


You can do this, but there's no syntax. Instead, call the `method` method with `:new` as its argument.




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

Search: