coderanch.com

Common obstacles for newcomers to Ruby?

9/10/2009Updated 11/7/2024

Excerpt

Have you found any common obstacles that newcomers to Ruby routinely face? In your opinion, are there any language features that seem more difficult to grasp? Do you find certain patterns that developers with prior OO experience exhibit when first tackling Ruby? … puts "x is even" if x % 2 == 0 Versus the more traditional (but lengthier and less idiomatic): if x % 2 == 0 puts "x is even" end Another stumbling block is the "pure" object oriented nature of Ruby. A lot of developers seem to be used to arbitrarily mixing procedural ideas with object oriented ones. In Ruby you can do this but in reality you'd try to avoid it as much as possible. Even in a similarly dynamic language like Python, there's a heavy reliance on functions.. such as using len(str) rather than str.length, or similar. I find that most of the stumbling blocks come from assuming Ruby is as inconsistent or "mixed" as other languages, when really the standard is to try and keep things as simple as possible. Ruby tends to assume it's easier to learn operators than structural syntax, so while you won't see so much "structural" definitions or endless initiators as in … Regarding certain patterns that existing OO developers find tough, I'd say that from certain languages (such as Java), the lack of multiple inheritance can be "interesting" to start with The existence of modules that are then mixed in to classes can also provide a little bit of a learning curve, but it's mostly about changing expectations than learning anything hard.

Source URL

https://coderanch.com/t/462011/languages/Common-obstacles-newcomers-Ruby

Related Pain Points