5 ms·
Ask HN: How widely used is Ruby without Rails?
Is anyone using Ruby for web development without Rails? If so, what were using your reasons for not going down the Rails route and how have you found the experience?
If you aren't doing web development, what non-web tasks are using Ruby for and how have you found the experience?
- sethammons 7y agoWe have Ruby for our sensu checks that run on our zounds of nodes. Ops folks seem to enjoy it. I dislike Ruby, and my dislike compounds every time I touch chef, nspec, mini test, or any Ruby test framework. So much magic and custom DSLs.
- theflyinghorse 7y agoIm in the same boat. The language seems to do nothing but encourage questionable behaviour. And tooling is just gross!
- vanilla-almond 7y agoInterested in learning more about 'so much magic and custom DSL'. I'm learning Ruby at the moment and find the syntax very readable but I haven't ventured into more complex topics and I certainly want to avoid 'magic' methods.
- sethammons 7y agoI can get more specific, sure. I'll preface this as a minor rant. I work with between 4 and 6 languages at work. I don't work with some of those languages daily or even monthly. That means that I am not an expert in Ruby by any means. Ruby is the only language where I've accidentally copy-pasted unicode whitespace and the language decided that that character must be an undefined function: puts "hello" <main>': undefined method ` ' for main:Object (NoMethodError). An example of magic. In our chef helper methods, you might see "company_app_helper_verify_app_started myApp". Naturally curious, you look for that function. It exists no where in your entire organization. Why? Because it is actually defined in two different files, one function is "company_app_helper" and the other is "verify_app_started," but because Ruby is amazeballs, you can create new functions on the fly and so something somewhere is conjoining the two methods into one method and doing magic to make it work. You can argue "yeah, but that is not Ruby's fault." And I would say that there are many Rubyists who love to do strange things like this. Optional Parenthesis. Now it is hard to tell what is an argument and what is a function call. Testing. `expect(foo(4)).to be_nil`. You have to memorize a whole testing DSL to know your options. What can go after "to_"? `expect{ stock.increment }.to change(stock, :value).by(100)`... Like, while you can read it, you have no idea how to compose it without knowing the testing DSL. And the following: describe "order" do it "is marked as complete" do expect(@order).to be_complete end it "is not yet shipped" do expect(@order).not_to be_shipped end end I can't see any value add to that over the following made up syntax that looks like most other tests I'm familiar with: func TestOrder(): order = new(Order) if order.is_complete != "complete" fail("expected to be complete") if order.is_shipped == true fail("should not be shipped yet") The only difference being that in the second example, you just need to know your language's normal code to do the tests. No need for a framework full of custom extensions. Tests are just code. I think a lot of programmers love to build up an encyclopedia of obscure knowledge on how to do things in their languages. It gives them a sense of dominance or something. Personally, I don't want strange syntaxes that help in some obscure case. I want straight forward code that is both straight forward to read and to write. I don't want custom DSLs, strange test structure, and such. I want a new person on my team who is basically familiar with C-like syntax to be able to be productive quickly.
- vanilla-almond 7y agoAppreciate the reply. I don't feel experienced enough in Ruby to make an informed judgement yet on the language, but I like what I have learned so far. I wonder if the use of DSL reflects a poor choice for solving the problem rather than an inherent problem in Ruby? > I think a lot of programmers love to build up an encyclopedia of obscure knowledge on how to do things in their languages. It gives them a sense of dominance or something. Personally, I don't want strange syntaxes that help in some obscure case. I want straight forward code that is both straight forward to read and to write. I agree 100% and this behaviour can be found in programmers across all languages.
- brudgers 7y agoThere's Sinatra for Ruby web development without Rails. http://sinatrarb.com/ http://sinatrarb.com/
- SamReidHughes 7y agoI sometimes use Ruby as a Perl replacement, where I'd use Perl as a Bash replacement. Little scripts that invoke shell commands and the like, such as one I made to build my website. It's a superior Perl replacement. I wouldn't use it for serious, big software, because it's dynamically typed, and worse, it has a grievously dynamic runtime.