Hacker News new | ask | show | jobs
by what2build 2006 days ago
Anecdotally, since I got away from Ruby, working on software became way more productive and tolerable.

Maybe it was something with the corner of the Ruby world I fell into, but the syntax sugar options and “cleverness” that enabled was maddening to deal with, and permeated that crowd.

Code bases with mixed styles are a thing in any language, but the Ruby-ists around me found a way to make one project look like half a dozen languages were involved.

Insert Confused Jackie Chan meme.

7 comments

Interesting, I'd say the opposite. In a Rails app that was written consistently with the styles and APIs documented in the Rails docs I have never been more productive. In other micro-framework type environments, regardless of the language, Ruby/Sinatra, Python/Flask, Javascript/Express. Most codebases I've encountered are a mess of inconsistencies introduced by various developers over the years. With a lot of the mess, effectively re-writing the core features of Rails and it's most popular gems.

Rails, if done correctly, is a remarkable tool to allow developers to focus on the business logic and UI of their app and forget about the "filler features" that pretty much every app needs implemented. On the other hand if you write Rails code without reading the docs and re-invent the wheel rather than doing things the Rails way, essentially running an app in the framework without using the framework methods, you can create yourself a monstrous unmaintainable codebase like no other.

Rails is not vanilla Ruby. And web apps are not the only software that needs to be written.

I moved on from Ruby land right as AWS was blowing up, and admitted I have never worked in Rails.

You're correct, Rails is not Ruby. But in my experience 80%+ of the Ruby ecosystem is Rails. But now I'm even more curious what problems you encountered with Ruby because I find it to be an excellent scripting language, especially if performance is not a major concern.
To be fair, it’s probably not Ruby, but the clever linguists I was working with 2008-2012 era.

Everyone brought their preferred syntax and there was much less of a “let’s solve the problem, not be clever” sentiment back then.

That said, Python almost makes such things impossible. Decorator patterns are the only thing I can think of in Python that ever made me really think.

6 to one, half dozen to another. How we start out thinking about problems has an impact on what syntax works for us best later on. I’m in my 40s and started in electronics, designing boards that shipped in Nortel kit.

I started with C and little else, not digging into OOP until hardware work went overseas. Perhaps my brain is over specialized to prefer a particular way of visualizing code I need to write.

Could you please stop creating accounts for every few comments you post? We ban accounts that do that. This is in the site guidelines: https://news.ycombinator.com/newsguidelines.html.

You needn't use your real name, of course, but for HN to be a community, users need some identity for other users to relate to. Otherwise we may as well have no usernames and no community, and that would be a different kind of forum. https://hn.algolia.com/?sort=byDate&dateRange=all&type=comme...

Rails is great if out of the box with devise + active admin it gets you at least 80% of the way to what you're trying to build. Once you start writing loads of background jobs and business logic it becomes a quagmire pretty quick. I've seen this happen over and over again on projects I've worked on.

I mention Rails specifically because I can't think of any other reason I'd use Ruby these days.

> Anecdotally, since I got away from Ruby, working on software became way more productive and tolerable.

Oddly enough I found myself becoming less productive when I tried Elixir and Phoenix for a bit (compared to Ruby).

You could look at code written by 10 people and end up with 10 drastically different looking code bases. Not just the organization of files but the logic behind the functions. It makes it very hard to read other people's code unless you know every pattern they use very well.

Here's an example of that where I wrote something one day, asked if there's a better way to do it and someone else wrote their own version[0]. Take a look at the 2nd code snippet vs the 3rd. The first code snippet happens to be Python btw. Even after a year of casually working with Elixir I can't understand the 3rd snippet of code at a glance. When I first tried to parse it mentally I spent literally an hour picking it apart just to see what everything did and I forgot almost all of it a week later.

I also found myself much less productive mainly because the language tends to be quite verbose compared to Ruby, especially when you compare things like ActiveRecord vs Ecto. Ecto is one of those tools where it sounds unbelievably good on paper with great abstraction ideas but in practice it's pretty complicated because there's tons of different syntactical ways to do the same thing, the docs aren't inconsistent and every blog post you read has people implementing things in a different way. Then you combine that with it being fairly low level and you end up having to write huge amounts of very tricky code to do the equivalent of what you can do in AR.

At least with Rails, most projects look the same and unless someone dives off the deep end with meta programming, you can generally follow the code. I guess this is a testament to how good Rails is when it comes to developing its APIs. You can go such a long ways and develop fully featured apps based on Rails without really having to do anything crazy.

[0]: https://nickjanetakis.com/blog/formatting-seconds-into-hh-mm...

I've done Rails full time for around six years on two different teams. A big chunk of that time involved working on a codebase whose size rivaled some of the largest in the world.

Rubocop (with some tweaked rules; it's IMO too restrictive out of the box) was a big lifesaver in terms of steering both teams toward a common, readable coding style and mostly eliminating debates over style at PR review time.

> since I got away from Ruby, working on software became way more productive and tolerable.

Did you have a look at https://crystal-lang.org/?

I agree 100%. Ruby is my favorite language but for anything that isn't purely a solo project I've moved to harder-to-misuse tools for exactly this reason.
Using RuboCop should help a lot having an homogeneous codebase.