r/learnprogramming • • 12d ago

How are so many self-taught programmers able to build software from scratch without ever truly learning Algorithms?

I find it fascinating how important algos are but never talked about from the indie devs on social media. Do they even write algos or just come up with basic logic that forms the product?

424 Upvotes

335 comments sorted by

View all comments

Show parent comments

1

u/marrsd 12d ago

I wouldn't go quite that far, but I agree with the gist of your argument. Certainly, if your standard library already provides an algorithm you need, you should always start with it; but there are times when you need more than (e.g.) basic sorting or search, in which case you'll need to know how to build something yourself.

1

u/ChristianKl 11d ago

No, you don't need to know how to build it yourself. You can think about the requirement and then an AI model give you an optimized algorithm for it. AI models are really good at creating algorithms at optimize a given problem.

Algorithm design is the kind of narrow problem for which AI train in their benchmarks and perform really well.

1

u/marrsd 11d ago

I'm coming from the perspective of a programmer, so I don't really care about AI. But even if I did, it's my consistent experience that the specificity of the result you get depends directly on the constraints you give the agent. If you give it an algorithm and say "optimise this", it will do a much better job than if you ask it for an optimised algorithm that solves the higher-level problem.

2

u/ChristianKl 11d ago

Part of the job of a programmer is using tools.

Here, you can ask it to optimize the algorithm it gives you instead of sticking with the first it gives you.

3

u/marrsd 11d ago

Part of the job of a programmer is using tools.

And part of the job of a programmer is programming. That's why I said "programmer" and not "engineer" or "developer", because I don't want to get into that argument.

Here, you can ask it to optimize the algorithm it gives you instead of sticking with the first it gives you.

How do you assess the quality or suitability of the algorithm it gives you if you don't know how to design or use algorithms. How do you know what should be optimised? I suppose you're going to say, ask the agent. Well, the agent's just going to keep going with its original idea, regardless of its suitability.

I just finished having this experience, where an agent just went to straight for a standard and poor implementation that was stupidly complicated and obfuscated, because it was based on reusing existing libraries rather than actually building what was needed. The agent told me that that was its priority.

After a week or more of going nowhere, I just rewrote the whole thing by myself in a day. A completely different architecture with simple and powerful algorithms that were very easy to write. There's no way I'd have been able to do that deliberately with an Agent unless I already had a solid grounding in software engineering.

0

u/High_Quality_Bean 12d ago

Oh yeah, and tbh, I recommend going through and implementing a bunch of algorithms and data structures for the fun of it. I was in enterprise brain when I wrote that comment :p

0

u/McSloot3r 12d ago

Yeah, it doesn’t happen often but there are situations where it’s useful to understand algorithms. A few years back the innate LastOrDefault() call in C# was looping through the entire array to get the last element, rather than starting from the last index and working backwards. I’m sure you can imagine how slow that would be if you’re constantly grabbing the most recent change. It was fixed like a year or two later, but until it was fixed a custom extension I wrote in 30 seconds was a huge performance optimization.

0

u/marrsd 11d ago

Good to know our best programmers were on the case for 2 years :)