4 ms·
I have to recommend ruby if only for Ruby Version Manager and bundler. Ruby also has multiline lambdas (code blocks). Python only has single line lambdas. Disc
by epochwolf 16y ago
I have to recommend ruby if only for Ruby Version Manager and bundler. Ruby also has multiline lambdas (code blocks). Python only has single line lambdas.
Disclosure: I've been using ruby (and rails) for 2 years and I am absolutely addicted to it.
- JonnieCache 16y agoI've been using ruby (and rails)... I am absolutely addicted to it. This experience is pretty common. I think that says a lot.
- btilly 16y agoPython only has single line lambdas. Rumor control. While it is true that the lambda construct in Python is only one line, Python allows you to define functions in any scope, and pass those functions around. They are full closures. So anything you wanted to do with multi-line lambdas you can.
- epochwolf 16y agoYes, but I've found it to be rather cumbersome compared to ruby and under utilized. The standard library doesn't seem to make much of an attempt to pass around functions whereas in ruby you are often using code blocks to replace loops. Ruby's ability to hijack the scope of a given block via class_eval is amazingly useful in creating DSLs. Creating DSLs in ruby is trivial. The router for Rails 3 is a perfect example of this. Python makes this far more difficult.