4 ms·
Somehow these "real language" extensions for Ruby remind me of the XML craze for Java. To feel right, everything had to be configured in an XML file for Javaist
by Tichy 17y ago
Somehow these "real language" extensions for Ruby remind me of the XML craze for Java. To feel right, everything had to be configured in an XML file for Javaists. In the same way, Rubyists apparently feel uneasy if something doesn't read like nice natural language.
I suspect both things are just cleverly masked procrastination....
- chc 17y agoI agree in most cases, but Cucumber is one of the few times when it really felt beneficial to me. In most cases, I'd rather have straightforward Ruby code like we all understand or a simple YAML config file. But for a declarative spec framework, Cucumber works nicely. Try looking at a Cucumber spec vs. a Steak one and I think you'll see what I mean. Then again, I am a vegetarian.
- jrockway 17y agoWhy is writing "oh hai, i want my blog to be totally teh awesome. it must have no posts initially, and then should have one post after i add a post with the text OH HAI." better than writing "my $blog = Blog->new; is $blog->post_count, 0; $blog->post("OH HAI"); is $blog->post_count, 1;"?
- chc 17y agoSince I was speaking about this specific case and not similar DSLs in general, all I can say is that neither of those is valid Ruby with either of these frameworks.
- jamesbritt 17y ago" Rubyists apparently feel uneasy if something doesn't read like nice natural language." Include me out. With rare exception do I want to spend time trying to get something to read like English; it won't. And I get tired of guessing which idiomatic "natural" phrasing is to be used for such things in other people's libraries. Funny you should compare it to XML + Java, because it makes me think, "So you need to write an API. You've decided to make it read like natural English. Now you have two problems."
- binspace 17y ago+1 I really like rspec because it reads nice and has a nice object model, however, I'm not really compelled to use Cucumber because it seems like a there is overhead involved and I havn't had the case where the project manager needed to read the specs with the developers.
- jrockway 17y agoBoth are YAGNI. Java programmers want the non-programmers to configure their application, but of course, the XML files are actually critical code, so this can't happen. Similarly, Rubyists want "anyone" to write tests, so they figure that a natural language interface will allow that. The reality is that you are the only person working on your app, and this is all a waste of your time. Just write regular code -- it's more readable and more concise.