4 ms·
The Ruby story in Europe is very similar to the American one: Rails, Rails and Rails. However the last thing I wrote in Ruby is a scraper for a web site, a few
by pmontra 9y ago
The Ruby story in Europe is very similar to the American one: Rails, Rails and Rails. However the last thing I wrote in Ruby is a scraper for a web site, a few hours after patching a Rails app I've been maintaining for a customer for at least five years.
About more non Rails stuff, I started writing small text processing scripts in Ruby a few years ago. I wrote them in Perl before, but I eventually got more at ease with Ruby, notwithstanding the compact convenience of Perl's while (<>) loop and the implicit input variable. I also made a mruby program run on AWS Lambda just because I could. Interesting but probably not extremely useful in that context (pun intended).
I wonder if there will be a second Ruby wave from Japan, if their community keeps growing and their use cases start reaching abroad. Remember that the first wave (Rails) was actually from the USA.
- holydude 9y agoHopefully! The problem with ruby is it's just fine as in good enough but not better or more compelling than X or Y. I hope Crystal changes this or there will be some breakthrough in the mri.
- ZenoArrow 9y agoI expect a second wave is most likely to come if TruffleRuby takes off (perhaps when it has full support for Rails). https://pragtob.wordpress.com/2017/01/24/benchmarking-a-go-ai-in-ruby-cruby-vs-rubinius-vs-jruby-vs-truffle-a-year-later/ https://pragtob.wordpress.com/2017/01/24/benchmarking-a-go-a...
- ksec 9y agoThere is a new VM with Method JIT coming to MRI. https://news.ycombinator.com/item?id=14576077 https://news.ycombinator.com/item?id=14576077
- abrowne 9y agoSUSE re-wrote their setup/config tool YaST¹ in ruby a few years ago. 1: https://en.wikipedia.org/wiki/YaST https://en.wikipedia.org/wiki/YaST
- SOLAR_FIELDS 9y agoI'm a non-typical consumer who simply has used Ruby as a Python drop-in for text manipulation and interacting with API's. Overall I found the philosophy to Ruby to be a bit more elegant than Python's, but I struggled with some of Ruby's philosophies about what an object is and how to store them. In general I enjoy Ruby as a general purpose language, but code I wrote to interact with REST APIs was eventually replaced with Python at my work because "not enough people know Ruby". What is Ruby's killer feature to help drive adoption in situations such as these? By "these" I mean as a general-purpose scripting language.
- pmontra 9y agoThere is no clear cut killer feature for Ruby over Python in that context, and viceversa. Both are fairly good compared to the alternatives. The only true killer feature of Ruby is Rails, much better than Django and Web2py I had to work with in the last year, but that's out of the scope of your question. If your team knows Python you're likely to stay there. I find Ruby to be much easier to read and understand than Python but I have 10 years of customers paying me to write Ruby vs one in Python. I assure you that it would be the other way around if I had worked in Python for 10 years. I never picked Python for my own projects in all those years because I find many of its design choices weird and painful (I joke saying it's Ruby for the masochist), but that is very subjective. People liking Python consider good even what I find to be objective weaknesses of Python (example: only one line lambdas.) This means that probably both languages are good enough.
- SOLAR_FIELDS 9y agoGood answer. Our discussion sort of touches on the ingrained biases organizations can have toward a particular language, whether for the good or bad. Ideally I would push towards learning new languages and approaches to problems, but organizations (mine included) push towards the principle of least astonishment and it can be difficult to break that barrier. There's good business sense in doing so. Or, to rephrase, if your organization is ingrained in doing things a particular way the tradeoff of attempting to adopt something newer and/or different had better be justified. This is nothing particularly insightful on its own, of course, but this philosophy in terms of "what language do I write my code in" is worth a retread every now and then.
- vidarh 9y agoYou may be aware of this, but for those who aren't: Ruby has much of this. Perl is perhaps Ruby's other "parent" besides Smalltalk, for good or bad, and there are a lot of stuff stolen from Perl that sees relatively little use in Ruby today. The "-n" switch adds an implicit "while gets; ....; end" loop, leaving the input line in $_. "-a" will do "$F = $_.split", which means it splits on the contents of "$;" which can be set with "-F" like with awk. E.g.: ruby -naF[someseparator] -e '[some ruby expression]' Is equivalent to wrapping [some ruby expression] in: $; = [someseparator] while gets $F = $_.split($;) end Which incidentally also gives a halfway decent awk impersonation given that Ruby also supports awk-like BEGIN {} and END{}.
- rjeli 9y agoMore on this: https://robm.me.uk/ruby/2013/11/20/ruby-enp.html https://robm.me.uk/ruby/2013/11/20/ruby-enp.html https://robm.me.uk/ruby/2013/12/03/argf-ruby.html https://robm.me.uk/ruby/2013/12/03/argf-ruby.html https://robm.me.uk/ruby/2015/10/31/dollar-underscore.html https://robm.me.uk/ruby/2015/10/31/dollar-underscore.html and his book: https://pragprog.com/book/rmtpruby/text-processing-with-ruby https://pragprog.com/book/rmtpruby/text-processing-with-ruby