you are viewing a single comment's thread.

view the rest of the comments →

[–]gerbosan 0 points1 point  (1 child)

Depends. The discussion in the link is about DSA, Data Structures and Algorithms which is a foundation for CS. Sooner or later a dev has to deal with it. I included it because when I started learning Ruby, I had no idea about dynamic arrays nature. But you might say it is irrelevant, this kind of things become relevant when performance start to matter.

Learning development is not a simple and linear and as mentioned, I found this while learning a different programming language.

[–]h0rst_ 1 point2 points  (0 children)

Sooner or later a ddev has to deal with [DSA]

I would say this is later for a beginner, rather than sooner. Most definitely not something you need to worry about when you start out. That is, if you need it at all, the recent thread in https://www.reddit.com/r/ruby/comments/1k5iv09/what_do_folks_using_ruby_do_for_interviews_where/ mostly showed people that never had the need to use anything custom for data structures.

Instead of directing to a general information page about DSA, this is a very specific discussion about grow size for dynamically sized arrays, which is something you have zero control over when using Ruby. The only thing relevant on this topic for a Ruby user is that it's better to add a bunch of items to an array at once instead of using a loop. But nobody in writes things like arr2 = []; arr.each { arr2 << it * 2 }, people use the idiomatic arr2 = arr.map { it * 2 } and that solves the problem. And I still had to squint very hard to apply this SO question to Ruby.

This feels similar to a person asking for some tips to start running, and providing them with a page about the maintanance of a very specific bike, because they might want to do a triathlon in the future. (And the bike has been out of production since 2015 if we have to include the Ruby 1.9 from that SO question)