top | item 25495539

(no title)

what2build | 5 years 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.

discuss

order

ritchiea|5 years ago

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.

what2build|5 years ago

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.

cageface|5 years ago

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.

nickjj|5 years ago

> 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...

JohnBooty|5 years ago

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.

Rochus|5 years ago

> 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/?

tylersmith|5 years ago

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.

marcandre|5 years ago

Using RuboCop should help a lot having an homogeneous codebase.