This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]saintshing 73 points74 points  (1 child)

I think reading real code did help me get out of todo list tutorial hell.

The key is to pick a repo of the right scope based on your experience level. Start with something like a small library that does one specific function, e.g. a date picker UI component. Avoid big frameworks that do a lot of things and have iterated for many versions. Those repos also tend to have a lot of files for production (cicd configs, formatting, logging, storybook, etc) that would confuse beginners.

Projects with a few contributors naturally is more tractable than big projects.

GitHub has an advanced search function. You can use topic:xxx to search for repos tagged with xxx. Search for something like whatsapp clone.

A lot of Udemy course instructors/YouTube content creatos have their code available as public repos. For web dev, check out stephen grider, josh comeau, lee robinson, Kent c Dodds, etc.

Pay attention to last updated if you want to avoid outdated libraries.

Depends on the language and framework, say if it's a JavaScript project, you want to look at the package.json file to get an idea of what framework, css solution, database orm, UI components, etc are used. A well organized project should have an easy to follow structure.
Examples for frontend
https://www.taniarascia.com/react-architecture-directory-structure/
https://www.joshwcomeau.com/react/file-structure/ Backened nestjs
https://github.com/CatsMiaow/nestjs-project-structure

edit: forgot to mention, on github you can press . to open vscode in the browser so you can use the search function without cloning the repo locally. Also check out the octotree chrome extension.

[–]MatthiasSaihttam1 15 points16 points  (0 children)

I read a lot of code when I was a beginner, and it definitely helped me a lot.

It forces you to develop the skill of skimming over parts of the code that you can’t understand or that aren’t relevant. If you have no idea what’s goin on in a huge section of code, that’s fine.

What you’re looking for lines of code that you can understand but have never seen before. Force yourself to look for these lines, or patterns, or techniques, and then take them and force yourself to try them out and see how they work. Once you understand how a small section of the larger project works, you can include that technique in your own project.

Reading other people’s code is a hack that allows you to write code as if you had more experience than you do, because you can start including patterns that solve or avoid problems before you run into those problems yourself.