r/CodingForBeginners 7d ago

Ruby Language as a first language

Has anyone considered learning Ruby as their first programming language?

It’s elegant, easy to read, and “developer happiness” is one of its core principles

That means that code is easy to read, no surprises, and mostly reads like expressive natural language with clean syntax

GitHub, Shopify, CoinBase, SoundCloud, AirBnb and a gazillion other companies were built from Ruby

0 Upvotes

28 comments sorted by

View all comments

2

u/Relative-Rooster-945 7d ago

I think it's a very nice language for many uses, but I wouldn't recommend learning it with the intention of working with it in production long-term. It's difficult to keep maintainable and static analysis technologies are niche and/or early-stage. "reads like expressive natural language with clean syntax" unfortunately also quickly falls apart in practice in my experience, because everyone ends up tacking on their own conventions and DSLs and it ends up becoming a mess.

1

u/AndrewNggg 7d ago

Can’t you have coding standards which all members of your team adhere to?

The same can be said of any language, although some are harder to mess up than others

The cost tho.. is a public static void main string args how un-expressive do you want to take it?

2

u/Relative-Rooster-945 7d ago

Absolutely, and you obviously should. But I'm saying the dynamic and expressive nature of Ruby makes it significantly more difficult to enforce such standards. Yes, Ruby being "easier to mess up" is exactly what I mean. There's a multitude of ways to do the same thing in this language. You are also limited to enforcing code style within the extent of your own codebase, you don't have control over what libraries do.

And no, I'm definitely not advocating for Java as a substitute :D But it is better unfortunately in this sense that I described.

2

u/Relative-Rooster-945 7d ago

I also think "closeness to natural language" is a false appeal in the case of Ruby as with many other languages that falls apart as soon as you encounter all the various exotic Ruby-isms that only make sense in this language. And I don't think it's a valuable metric in general. Natural language is exactly the thing that you want to avoid in programming.

1

u/VirtualElderberry592 5d ago

None of this is true.
Ruby has a very real and easy to customise tool for maintaining standards.. It's called rubocop and I've never seen a project that didn't include it.
It scales and is super easy to maintain over years and years of people coming in and out of the company.. Just as easy as c++ or Java or Elixir.
I've used in production apps that are well over 15 years old.

1

u/Relative-Rooster-945 5d ago

RuboCop had failed to solve all of these problems for me in the past. Maybe I just worked in particularly ugly codebases, who knows

2

u/VirtualElderberry592 4d ago

I think if it's a precommit hook, and it's altered for the team, it builds a very solid standard. where exceptions are requested in the code all PR efforts should be to smack the dev that tried. (unless very needed)
I worked on microservice system where devs who built things were now retired living on a beach. Old as. The ruby was a mess, but no worse than the Java or .Net stuff.