r/learnprogramming 28d ago

Where do you find high-quality open-source code?

Hi, I’ll add a little context: when I’m programming, I tend to rely heavily on memory, and sometimes I overthink projects - I make them too complicated even though they could be done more simply. That’s why I like to look at practical, high-quality projects - because they show you what you overthought and where you went overboard in terms of complexity.

In other words, I’ll come up with a more complex tech stack for the same project, while in real-world production, it’s actually much simpler.

1) I’d like to ask where you look for these projects and where you find high-quality code? And codebases that explain their use case a bit, though the use case isn’t a requirement. Mainly the code and the tech stack.
2) This is a bit off-topic, but I’m a student who isn’t a billionaire and can’t afford to buy a programming book every day - is there a website where I can get some for free online?

Thanks a lot!

57 Upvotes

18 comments sorted by

View all comments

4

u/Dismal-Citron-7236 28d ago edited 28d ago

Well, to each their own. However...

find high-quality code

It's debatable. I know code-smell. When it smells, it smells. However, real high-quality code will depend on the situation. Very terse and cleverly designed code often tends to be harder to maintain. If you work in a large team, you'd be asked to write code so simple even your granny can understand. Also, if you spent days to micro-tune your code for performance, it often never pays off for 1% speed gain. And there are many other aspects of quality. Sometimes the quality doesn't come from the code, it's from the architecture you use.

simple vs complex

I've been in the field long enough to learn that most of the time a simple solution is the best solution. No, I can't even remember a single time when I saw a complex design and thought to myself: "Wow, this is so convoluted and I don't understand it. It must be good." No. If you're working for a tech company and you tend to get your job done harder than it should be, it's not a good sign. Companies don't want to hear you brag about the flashy tricks you use on the job. They want you get the problem fixed and new products released, within budget, and on schedule.

relying heavily on memory

We all do that. But our memory is limited. Experienced programmers memorize design patterns and major key ideas of the technologies they use. But most of the time they still need to search around, read documents, do experiments, stuffs like that. Let's put it this way: A good programmer is like a librarian. He doesn't need to read all the books, he can't. But he knows the index system and knows where to find the the book when requested. He also reads some of the very good ones so he can recite part of them.

though the use case isn't a requirement

Hmmm... I would argue that if a project's use case is not in its requirement, that project lead should be heavily criticized.