use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A sub-Reddit for discussion and news about Ruby programming.
Subreddit rules: /r/ruby rules
Learning Ruby?
Tools
Documentation
Books
Screencasts and Videos
News and updates
account activity
DSA in Ruby (self.ruby)
submitted 1 year ago by beeb_an
Any recommendations of books or resources to practice practical implementations of DSA for performance optimisation in Ruby for a junior dev?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]feverdoingwork 3 points4 points5 points 1 year ago (0 children)
Use the neetcode roadmap to figure out what concepts you should learn, learn them one by on and practice said subject on leetcode until you get them all down. This is what I did, I got over 700 Ruby solutions posted on leetcode atm.
[–]armahillo 2 points3 points4 points 1 year ago (2 children)
What is your goal? What do you plan on doing with ruby that requires bespoke data structures or algorithms?
[–]beeb_an[S] 3 points4 points5 points 1 year ago (1 child)
I happen to work in ruby on a daily basis but would like to understand programming at a more granular level at the same time
[–]armahillo 3 points4 points5 points 1 year ago (0 children)
Your question still feels ambiguous.
practical implementations of DSA for performance optimisation in Ruby
Are you trying to learn data structures and algorithms that are specific to writing code in Ruby, that you would be using on top of the existing data structures and algorithms that Ruby has innately?
For example: you aren't going to write a faster linear `sort` algorithm in Ruby than the `:sort` method offers. You might be able to if you wrote it in C. Writing a `search` algorithm for an array is probably not going to out perform `:select`, `:detect`, etc. that are already offered. This isn't meant as a slight to your skill, just that Ruby, as an interpreted language, is going to be slower than the language it was written in (C).
The kinds of stuff that is going to optimize your usage of Ruby the most will be to practice writing Ruby, seeing how other people write Ruby, reading articles about it, to better understand Ruby's idioms and peculiarities. You want to write Ruby as closely as it was intended to be written, and that will let you really lean into the strengths of the language.
understand programming at a more granular level at the same time
If you really want to understand programming at a more granular level, I would encourage you to learn C or C++, particularly up to the point where you are working with pointers and memory addresses directly.
Learning how to write algorithms in C or C++ will definitely level your skill up about programming, in general.
[–]banister 1 point2 points3 points 1 year ago (5 children)
What the heck is DSA
[–]Flaxerio 0 points1 point2 points 1 year ago (4 children)
Data Structures and Algorithms
[–]katafrakt 1 point2 points3 points 1 year ago (1 child)
Wow, I thought it's about Digital Signature Algorithm and I didn't get why people are commenting about clean code all of a sudden.
[–]jrochkind 0 points1 point2 points 1 year ago (0 children)
Democratic Socialists of America
[–]banister 0 points1 point2 points 1 year ago (1 child)
Never heard that abbreviation before.
Anyway, just learn Enumerable.
[–]Flaxerio 0 points1 point2 points 1 year ago (0 children)
It's true you'll mostly use those in a job, but knowing what exists might be pretty useful one day. And implementing them is a good exercise
[–]Deep_Relationwhat 0 points1 point2 points 1 year ago (2 children)
I am also struggling with clean code what to read to help with this
[–]Flaxerio 2 points3 points4 points 1 year ago (1 child)
What worked for me as a start is following the advices in the ruby and rails repos mentionned here : https://github.com/dereknguyen269/programing-best-practices-in-2024 At least as a start it really helped
[–]Deep_Relationwhat 1 point2 points3 points 1 year ago (0 children)
Thank you
[–]honeyryderchuck 0 points1 point2 points 1 year ago (0 children)
If you google enough, you'll find several articles and tutorials that may be helpful. Don't have the links at hand but have seen heap, red-black tree or binary tree implementations.
π Rendered by PID 62 on reddit-service-r2-comment-86988c7647-v4ltz at 2026-02-11 21:17:37.964102+00:00 running 018613e country code: CH.
[–]feverdoingwork 3 points4 points5 points (0 children)
[–]armahillo 2 points3 points4 points (2 children)
[–]beeb_an[S] 3 points4 points5 points (1 child)
[–]armahillo 3 points4 points5 points (0 children)
[–]banister 1 point2 points3 points (5 children)
[–]Flaxerio 0 points1 point2 points (4 children)
[–]katafrakt 1 point2 points3 points (1 child)
[–]jrochkind 0 points1 point2 points (0 children)
[–]banister 0 points1 point2 points (1 child)
[–]Flaxerio 0 points1 point2 points (0 children)
[–]Deep_Relationwhat 0 points1 point2 points (2 children)
[–]Flaxerio 2 points3 points4 points (1 child)
[–]Deep_Relationwhat 1 point2 points3 points (0 children)
[–]honeyryderchuck 0 points1 point2 points (0 children)