Live data from Hacker News

Survey: Python vs Ruby Test Ecosystems

nvie.com

11–16 of 16 posts

Re: Survey: Python vs Ruby Test Ecosystems

#11
post #7

I know he made a little "bait" comment but at least he admits the simple inability for python to seriously host DSLs. If you look at any python port of a DSL (sinatra clone, cucumber clone, whatever) it's just simply ugly. It's STILL python code.

Ruby DSLs still look like Ruby code, too; it just has a laxer lexer. For a reality check, look at DSLs in Forth or Prolog sometime. Many Ruby DSLs are :covered with? accent "marks", though, like Romanized Vietnamese* . You're probably just used to it. * e.g. http://en.wikipedia.org/wiki/Cà_phê_sữa_đá

Fair enough. Sinatra and Chef are good examples of "ruby code" DSLs.

In contrast, however, I give you Cucumber scenario files. Yes, Given/When/Then are methods but it's still a very elegant DSL.

I'll do some poking into prolog and forth-based DSLs. You've peaked my interest.

Re: Survey: Python vs Ruby Test Ecosystems

#12

A common thing I have heard is that Python people are obsessed with documentation and Ruby people are obsessed with testing. Not saying that one or the other is 'better', just that the culture around each of the languages has created these stereotypes.

Doctest (http://docs.python.org/library/doctest.html) seems like an interesting crossover point, though.

Re: Survey: Python vs Ruby Test Ecosystems

#14
post #11

Earlier quoted context omitted.

Ruby DSLs still look like Ruby code, too; it just has a laxer lexer. For a reality check, look at DSLs in Forth or Prolog sometime. Many Ruby DSLs are :covered with? accent "marks", though, like Romanized Vietnamese* . You're probably just used to it. * e.g. http://en.wikipedia.org/wiki/Cà_phê_sữa_đá

Fair enough. Sinatra and Chef are good examples of "ruby code" DSLs. In contrast, however, I give you Cucumber scenario files. Yes, Given/When/Then are methods but it's still a very elegant DSL. I'll do some poking into prolog and forth-based DSLs. You've peaked my interest.

Cucumber is not really a native DSL. The scenario files are simply text files that are parsed (pattern matched) by Cucumber, which is a parser that's written in Ruby. It could well be written in Python, too.

If you look at Steak (https://github.com/cavalle/steak), however, this is a real native Ruby DSL, and such a thing is impossible to ever do as elegant in Python.

Re: Survey: Python vs Ruby Test Ecosystems

#15

A common thing I have heard is that Python people are obsessed with documentation and Ruby people are obsessed with testing. Not saying that one or the other is 'better', just that the culture around each of the languages has created these stereotypes.

I find this quite ironic, since some of the key properties in the Ruby language IMHO lead to an increased demand for documentation. For examples, see this comment on the blog post: http://nvie.com/posts/python-vs-ruby-survey/#comment-9820952...

Re: Survey: Python vs Ruby Test Ecosystems

#16
post #14
post #11

Earlier quoted context omitted.

Fair enough. Sinatra and Chef are good examples of "ruby code" DSLs. In contrast, however, I give you Cucumber scenario files. Yes, Given/When/Then are methods but it's still a very elegant DSL. I'll do some poking into prolog and forth-based DSLs. You've peaked my interest.

Cucumber is not really a native DSL. The scenario files are simply text files that are parsed (pattern matched) by Cucumber, which is a parser that's written in Ruby. It could well be written in Python, too. If you look at Steak ( https://github.com/cavalle/steak ), however, this is a real native Ruby DSL, and such a thing is impossible to ever do as elegant in Python.

Maybe, but my enthusiasm for DSLs in ruby has diminished a lot in the 6+ years I've been doing ruby work. DSLs don't compose well and it's usually easier to learn a new api than yet another new mini-language.
Post reply on HN