7 ms·
Yes there are definitely some weird syntax quirks, but it all depends on your perspective. Coming from something like Java, C# or Typescript, the syntax indeed
by rezonant 3y ago
Yes there are definitely some weird syntax quirks, but it all depends on your perspective. Coming from something like Java, C# or Typescript, the syntax indeed feels strange, but from other languages with similar idioms (like Python), it's a lot less weird. Some examples of Ruby's quirks: `elsif`, singular `include?` instead of `includes?`.
But the benefit of RoR is not really Ruby, its Rails. When you embrace the convention-based approach of Rails, you can move very quickly. A lot of the evolution of Rails over the years has been making it possible to have that cake and eat it too; being able to override the conventions when needed while the conventions keep the boilerplate you must write to a minimal level. And ActiveRecord is by far the best ORM I have ever used.
That being said, some of Ruby's design considerations are important to why I still enjoy Rails development: being able to control your system manually in a fine-grained way from the Rails Console by interacting directly with models is really lovely, and the power of that isn't really matched by any other language+framework combination that I'm aware of. This ability to call directly into your model layer really requires a global namespacing arrangement (unlike for example JS) which is not too deeply organized (like in Java), with syntax that makes calls into the model layer not too onerous (ie omitting parenthesis for method calls, because every single `.` call on an object is a method call in ruby).
I wouldn't necessarily pick RoR/Ruby for new projects myself, as Typescript's IDE-time erasable static typing is the number one thing that I wish Ruby had (there are several initiatives to bring over these benefits but they are still nascent), but I have no problem collaborating in teams working on Rails projects as it is indeed a very enjoyable, very mature platform for building APIs, backend systems, and even customer-facing frontend systems.
- wgjordan 3y ago> singular `include?` instead of `includes?` Pedantic tangent, but `includes` is actually the singular form: "This array includes that object" vs "All of these arrays include that object".
- rezonant 3y agohuh, true. Still backwards in ruby :-)
- chris12321 3y agoNo, it's a question, "does array x include object y?" `x.include?(y)`