I stopped using Ruby and Rails and opted for Python when I started teaching at university, because I realized Ruby wasn't ideal for teaching novice programmers. But I've recently picked up Rails again for some freelance work and have been delighted at how easy it is to get back into. My sense is that Ruby and RoR are no longer as dominant or competitive compared to Python, but it still seems to be a very high in-demand skill because of all the apps/startups that used RoR from the time I learned it back in 2009. That said, learning RoR was less about having the specific skill on my resume, and more about my first exposure to professional and open-source application development, which I'm embarrassed to say I had virtually no experience with when majoring in computer engineering.
Today, I personally would recommend people learn Python and do Django, even though I've personally never used Django myself, but feel confident that it's not much different than my RoR experience.
Care to elaborate? I work with both of them lately, consider me a novice programmer since I rarely write anything complex, but which part of ruby is not ideal for teaching?
I find the ruby syntax much more self-explanatory than python.
An example: recently, I had to use private methods in a python project. I went for the _method() convention, but priv methods don't exist in py.
Yes and no. Consider that these are different in Ruby but the same in almost every other language:
f(x)
f (x)
Ever had to debug code that relied on this behaviour? Or had to explain why exactly to someone unfamiliar with yacc?I love the elegance possible in Ruby syntax, but it allows for way too much ambiguity, and if you don't understand how parsing/interpreters fundamentally work, it will seem like Ruby is as loose and permissable as regular English syntax, which is a huge stumbling block for people entirely new to programming. I admit to slamming my fist on my desk the first time I tried writing Python only to get an indentation error, but Python's explicitness is incredibly helpful in making clear the exactness needed for computation.
And Python's design helps prevent many of the kinds of catastrophic/difficult to debug errors that do not throw exceptions in Ruby. For example, the following situations are acceptable in Ruby, but in Python, will raise errors:
if x = 9
puts x + 1 # prints 10, because x is assigned to 9 first
y = {}
z = y["this doesn't exist"] # z is set to nilOne of the core Rails developers José Valim created his own language Elixir built on top of Erlang and web framework Phoenix.
Ruby is a beautiful language - well written code can bring a tear to your eye like Haiku. But its not designed for concurrency so you have to bend over backwards to add caching and scale your web server a lot more than other languages.
Learning Ruby/Rails and being part of a team that followed Sandi Metz 5 Rules and TDD made me a better programmer in other languages.
Most companies are moving towards microservice architure where each service runs separately and can use whatever language makes sense for that service. We replaced our monolithic Rails web app with 20+ microservices, most of which use Golang, some Python and Node and Java. The main web server service renders one html page (about 20 lines!) that simply renders a React app that communicates with our API server (API server router then routes to the correct microservice).
We don't need Rails view templates or localisation support as most dynamic websites do this clientside. Doing lots of Javascript in Rails was always clunky and poorly supported until a year or so ago when they caught up and added modules and hot reloading support.
We have found Golang very easy to learn, ridiculously fast to compile and run tests and very robust. Google said it was designed for Programmer enjoyment and it really shows.
I think if you're looking for something new, look for things that you (or others) get excited about, because they are way better then the current way. Learning Rails was because it was 10x better than the PHP spaghetti shit that I was personally coding in early 2010s.
I think this can apply to a lot of trends. For me, Golang was a much much better way to handle concurrency. Add typing, strong performance, compilation. It's also on an upward trend that I was on the leading edge of.
These days I'm learning Rust because I think the borrow checker is an interesting and much better way to handle memory than manually allocating/freeing, pointers, or slow GC. However, who knows if it will take off.
Similar things have happened with frontend. From what I understand React is much much better than coding together stuff with jQuery and random plugins.