DEV Community

fwaldecker
fwaldecker

Posted on

New Coder - learning Arrays & Recursion

New-ish to coding. Starting launch school.

I'm starting with Ruby and did a lesson on Arrays this morning. I also created a little AI teaching assistant to help when I don't understand something (it's amazing - highly recommend).

I always ask for real world examples for better comprehension. I hate school examples like using the Fibonacci sequence to learn recursion.

But a quick chat with Claude taught me how recursion is incredibly helpful for e-commerce platforms with big product catalogs. Think Amazon, Wal-Mart, etc.

Where they have Home, Electronics, Grocery, Outdoor. In electronics there's gaming, appliances, tv. Gaming has PS5, Xbox, etc.

Recursion makes it possible to create a method that searches the whole thing based on specific criteria with just a few lines of code.

That's pretty neat.

Top comments (0)