Hacker News new | past | comments | ask | show | jobs | submit login

What's great about Rails ? Serious question from someone who landed into a mature Rails app and is now decidedly running away from that ecosystem after a year working in it.

Rails looks like an early take on MVC that was setup around fast project creation and encourages unmaintainable code - concerns are straight out retarded (a design pattern that encourages breaking encapsulation and makes dependencies impossible to trace) and fat models encourage coupling things that don't need to be coupled.

Then there's Ruby which in my opinion goes against Zen of Python which I'm a fan of - aliases all over the place for same thing, pointless name shortening and stuff to sacrifice readability, rails breaking conventions of standard library...

In the context of when it got popular I understand why it got the hype - replacing the PHP SQL in views garbage and Java 6 verbosity with XML configure everything, and the horrible ASP monstrosity.

These days I'd take Python as a more popular language, that I would say is better designed and has far better Windows support.

NPM/TypeScript and structural static typing is getting really good as well but is not as mature - but code sharing between client and server is a real thing.

Go emerged since the time of Rails hype.

.NET and JVM languages and frameworks got a lot better and scale far better with big code bases.

I don't really see where Rails is great compared to alternatives, it feels like legacy at this point. I'm not saying you can't write good maintainable apps in Rails either - I'm just saying other frameworks and languages will make it easier IMO.




> What's great about Rails ? Serious question from someone who landed into a mature Rails app and is now decidedly running away from that ecosystem after a year working in it.

Rails provides a mature system to quickly "get the job done" in a way that can be easily maintained and generally "just works". It's especially good if you want to have a small team manage an application. More details below.

> Rails looks like an early take on MVC that was setup around fast project creation and encourages unmaintainable code - concerns are straight out retarded (a design pattern that encourages breaking encapsulation and makes dependencies impossible to trace) and fat models encourage coupling things that don't need to be coupled.

That hasn't been my experience. Used well, Rails code tends to be relatively easy to follow. It's true that concerns can be easily overused. But that's true of many power tools; I use concerns sparingly, and then they work just fine.

> Then there's Ruby which in my opinion goes against Zen of Python which I'm a fan of - aliases all over the place for same thing, pointless name shortening and stuff to sacrifice readability, rails breaking conventions of standard library...

This is an odd argument. I know both Ruby and Python. No, Ruby doesn't follow Python conventions. That's because Ruby is not Python. The shortening can in some places increase readability; YMMV.

Rails does extend the standard library in a few ways, but if you're using Rails, that's already baked in & you never see it otherwise. So again, that seems irrelevant. If you're using Rails... then you're using Rails.

> These days I'd take Python as a more popular language, that I would say is better designed and has far better Windows support.

Python & Ruby are similar in many ways, it's hard to argue one is objectively far "better".

I've heard from others that Rails runs great on Windows 10, just use Windows Subsystem for Linux (WSL). I don't know how well Rails runs on native Windows. I know at one time that was important for many people. But for many people today, "run on native Windows" is irrelevant. The web application that I maintain that uses Rails runs on a Linux system, and while it would probably work on any Unix-like system, there's no interest in getting it to run on native Windows. Why do that? There's absolutely no justification for ever running that application on Windows, it would just cost more & crash more. If I want to run it on Windows for debugging, VirtualBox is great. Windows is disappearing completely from many server-side environments. Even Microsoft's own Azure runs Linux more than Windows: https://www.zdnet.com/article/microsoft-developer-reveals-li...

> NPM/TypeScript and structural static typing is getting really good as well but is not as mature - but code sharing between client and server is a real thing.

In many situations the sharing is so minimal as to be not worth it. I've only found a single function that would make sense on both client & server, and it was trivially implemented twice. That's not, by itself, a reason to force both sides to be the same language.

In many applications, "not as mature" means "don't use it". I don't have time to waste debugging someone else's framework, especially when I'm implementing a relatively straightforward CRUD application. I'll gladly use an immature system if it provides a vital capability unavailable elsewhere, but for simple CRUD applications that's absurd. I loathe fad-based engineering.

> I don't really see where Rails is great compared to alternatives, it feels like legacy at this point. I'm not saying you can't write good maintainable apps in Rails either - I'm just saying other frameworks and languages will make it easier IMO.

I think the main advantages of Rails are that it is:

- mature - a lot of work has been spent to make sure the "special cases" work, and a large amount of functionality is there for immediate use. Like anything it has bugs & missing functions, but in general, if it's a common need it's easily available, easily works, and rarely has bugs.

- integrated - while Rails is implemented as a set of libraries, they're conceived as a whole, so there's no effort to "make the parts work together" - they already work together.

- simplifies & speeds development by making a lot of convention decisions for you, via "convention over configuration". For example, database tables use snake_case with plural names; model class names use CamelCase and are singular. Yes, Rails automatically does the singular/plural conversion! The conventions eliminates arguing & deciding conventions, doing the work to configure it, and makes the code more regular, but it's more painful if you hate their conventions & want to override them all.

Of course, there are many worthy alternatives. Rails isn't the be-all (what is?). But Rails is still a fine choice for many applications today; GitHub and GitLab are both Rails applications. E.g.: https://about.gitlab.com/blog/2018/10/29/why-we-use-rails-to...

The biggest problem with Rails is that Ruby, like Python, is an extremely slow language. In most applications this is irrelevant; the correct way to speed things up is to cache things, and then it really isn't a problem. Rails comes with a very easy-to-use caching system. So folks, like GitLab, have found that they can identify just the hotspot & reimplement just that small part. The same happens with Python, by the way; if you want fast Python, you either call "Python" code that's actually written in C, or rewrite your hotspot Python code into C. There's no such thing as a free lunch.

In particular, Rails has a large set of conventions. If you're willing to accept those conventions, a lot is done automatically for you. If you will continuously fight the conventions, then it's going to be a pain to work with.


>But for many people today, "run on native Windows" is irrelevant.

Developing RoR on Windows is still a pain in the bottom. WSL doesn't work well, WSL2 solves this, but isn't widely available. Not everyone could afford a Mac, and Linux machine just throw off majority of people new to programming. Considering 90%+ people uses Windows as their PC, I dont think it is irrelevant or small issues at all.


They might use a Windows PC as their client, but they can easily develop & deploy on something else. VirtualBox is free, as are Ubuntu & Fedora. Deploying Rails apps to systems like Heroku is worlds easier than a typical Windows deploy.

I don't think Linux throws off many people. For many people that is the future. I've written batch scripts & worked around Windows nonsense, and Linux is generally a better experience. Middle schoolers don't seem have problems using Raspberry Pis running Linux.


As someone who started with Rails in 2010, rode the JS/Node hype train for 5 years, and now working with Rails again:

I was one of those guys that blamed Rails hard for encouraging bad code. But now that I'm a much better software developer, I've discovered Rails is actually fantastic for writing highly maintainable code. This is thanks to several things:

[A] Standard patterns. Yes, "The Rails Way" may seem to encourage bad code at first glance. But that's because it doesn't hand-hold you in your software design decisions. It's a solid foundation that 1. Takes care of the most common stuff so you don't have to reinvent the same crap over and over again, and 2. Leaves room to extend with an architecture (in plain old Ruby code) that fits your app's specific needs.

[B] Testing. A lot of people opt to use Rspec, but Rails's built-in testing is actually really great. My absolute favorite is their "Fast Integration Tests", which lets you write a few lines of code to test a big chunk of your app in a single test case.

[C] Ruby. Yes, it's actually a good language. But man, is it a double-edge sword. Used well, you can write some of the most simple, elegant, and maintainable code in your career, while only mildly pushing the boundaries of The Rails Way.

[D] Everything your app needs. So much stuff is built-in, and stays out of your way until you need it. And the fewer gems you need to install, the more maintainable your code tends to be.

Indeed, Rails is not legacy at all. Well, maybe if you think monoliths are legacy :) But it keeps up with the good trends. Version 5 introduced webpack, so now you can build your fancy JS frontends... without configuring webpack! Or be like me and only use JS as a last resort :)

To be honest, the only framework I can see doing better than Rails is Phoenix. At the moment it doesn't have everything Rails has to offer, but it does have (IMO) a superior foundation that has great potential to supersede. Until then though, I'll keep pumping out projects using the best tool on the market.


> Zen of Python

You lost me there. If you're coming from a Pythonic point of view you are doing Ruby wrong. It will never compare on that standard because it's not Python and it doesn't need to. Python's pillars are opinions, just like Ruby's.

Ruby's got it quirks but I consider Python to be the wrong one. Ruby's my zen (and luckily it pays good). Python syntax is wordy and awkward to me, and "Pythonic" might be great for newbies but I find its principles slow me down.

To each their own.


I would identify as a .NET developer primarily as that's most of my professional background, but I've used Python a lot and while I also prefer the syntax, the main thing for me is design decisions. Ruby has "10 ways to do the same thing, some identical and aliases some subtly different" and the worst part is nobody tells you "this is the preferred way" so you end up with everyone using their own preferred aliases, syntax approaches, etc. This just decreases maintainability and increases cognitive load.

Stuff like Pythons "one right way to do things" is something I see in other good frameworks, I just identify it with Python in this comparison because it's closes to Ruby. Most of Zen of Python is good SW engineering practices and Ruby gladly goes against those - which, predictably, leads to messy code base I've witnessed.


Again, they are different approaches. Ruby derives heavily from Larry Wall's Perl, where multiple ways to do things was a feature. (Wall is a linguist and Perl reflects this) The way you manage this with a team is enforcing a "house style". This is how we did it when I worked at a Perl shop, it's how we do it at the Ruby shop I work at now, and it's how other teams manage their language's sprawling featuresets.

Python is unique in that it is one of the few languages to really hold "only one way to do things" as a pillar. I think it makes writing code more brainless and leaves less room for nuance and artistry, plus it forces you into weird syntax corners that you have no other way of getting out of. The python syntax for so many things is such a mess, I still cannot recall off the top of my head what the correct way is to do different kinds of iterations over a dictionary without looking it up. (And whenever I had to I remember hating it)

I've worked professionally in Python and it's not a bad language. (In fact I use it or its derivatives in a lot of personal projects.) It just so happens that I don't understand why people hold it up as this paragon of virtue, when it's literally just another tool, with another tired opinion.

> and the worst part is nobody tells you "this is the preferred way"

That's on your manager/team lead. In a good shop they'll tell you the preferred way.


Regardless of one's views on Rails (not a fan, personally), I think we can all agree that there is plenty of room to criticize it without using ableist slurs.


I've been using Rails for the past 6 or 7 years. The biggest positive is that almost any feature you need is available as a gem. We're using for an early stage startup right now, and it's crazy how quickly we've been able to crank out features. I've looked at the JS and Python ecosystems, and haven't seen the same mature ecosystem.

I don't disagree with your point around large Rails apps becoming un-maintainable. I think as long as you have a few developers who have dealt with big Rails app and know what to avoid (concerns, fat models, etc), it's not too hard to write a maintainable app in Rails.


Rails 2.0 came out and hundreds of people were able to get their own little slice of what the web could offer internally.

I made roughly $140,000 one year just because someone wanted a build for something that made them close to $10,000,000 in profit without having to do custom Windows / Mac development.

It was the fastest method to get something online and only go better through Rails 3 through 5. Yes, the mature code bases are a pain because people try upgrading in place and don't want to rewrite anything so you have Rails 3 code in a Rails 5 codebase because 'it works'


I’ve recently come back to a big Rails project after doing React/TS for a while and I feel exactly the same way. I feel like we’ve learned a lot about what kinds of tools help make programmers productive and help them write correct code since the original Rails heyday and none of those lessons have been absorbed into Rails.

Rails is a reasonable choice if by installing Rails and some gems you’re already 90% of the way to your goal. Every line of code you write after that is another step down the road to unhappiness.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: