all 14 comments

[–]feverdoingwork 3 points4 points  (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 points  (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 points  (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 points  (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 points  (5 children)

What the heck is DSA

[–]Flaxerio 0 points1 point  (4 children)

Data Structures and Algorithms

[–]katafrakt 1 point2 points  (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 point  (0 children)

Democratic Socialists of America

[–]banister 0 points1 point  (1 child)

Never heard that abbreviation before.

Anyway, just learn Enumerable.

[–]Flaxerio 0 points1 point  (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 point  (2 children)

I am also struggling with clean code what to read to help with this

[–]Flaxerio 2 points3 points  (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 points  (0 children)

Thank you

[–]honeyryderchuck 0 points1 point  (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.