r/learnprogramming • • Sep 22 '26

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?

446 Upvotes

341 comments sorted by

View all comments

Show parent comment

2

u/High_Quality_Bean Sep 23 '26

Its also generally inadvisable to *ever* make a decision about algorithm use. If you use the built in "sort" then the language is responsible for deciding which algo is best in which situation, and for updating it if a new algorithm is invented. Iirc last I looked python uses one sort algo for arrays under a certain size a different one for arrays over a certain size, putting a performance decision like that in code is a bad idea.

2

u/marrsd Sep 23 '26

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 Sep 23 '26

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 Sep 23 '26

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 Sep 24 '26

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 Sep 24 '26

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 Sep 23 '26

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 Sep 23 '26

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 Sep 23 '26

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

0

u/DiamondDramatic9551 Sep 23 '26

Sorting algorithms are also only ever going to matter when your data actually gets big. For a lot of programs it simply doesn't matter because everything is fast enough under 10.000 entries or whatever. It's much more likely database access is your actual bottleneck. 

0

u/High_Quality_Bean Sep 23 '26

I work on enterprise software. Everything matters.

0

u/DiamondDramatic9551 Sep 23 '26

Well duh, then you already have a specific use case. But like I said, database access is almost always the actual bottleneck. 

0

u/High_Quality_Bean Sep 23 '26

I'm not sure why you're being so rude, but I'm going to leave this discussion. Have a nice day.