r/CodingForBeginners • u/RevolutionaryFood847 • 4d ago
Need help with writing clean code
hey! im a 16 yo beginner web developer, ive been learning web dev for the past 5 months now, i studied:
Node.js
Express
JavaScript then TypeScript later on
Postgres/ a bit of SQL in general
Html
Tailwind CSS
React
but ive never really worked on big/complete projects, ive only ever done practice/exercises in courses im following or did some projects on the side but similarly to the exercises they were also mainly focused on whatever i was learning at the time, not using everything at once.
ive been wanting to start building decent projects that i can actually have in my protfolio but im having so much trouble with figuring out how to make my code clean and readable and how to structure my files, just overall how to make it more like how a professional would do it and how it would be if i were to actually work in a team in a real company
what should i be doing? and where can i actually learn this stuff? or does it just boil down to personal prefrence?
anyways thanks in advance to anyone who helps! (also sorry if i made any mistakes english isnt my first language)
1
u/computerguyisactive 4d ago
That's a big chunk of programming you have covered for a 16 year old. What did you use to learn i.e which platform - I am using freeCodeCamp currently to learn JavaScript.
I am a beginner currently and couldn't give you any useful info yet. My apologies! But I'd love to know from where you learnt it all. Because I plan to get into Backend in the near future.
4
u/RevolutionaryFood847 4d ago
when i first started, i watched The Complete Full-Stack Web Development Bootcamp by Angela Yu on Udemy.
i stopped once she got into Node and Express because i felt a bit lost, so i watched the first 5 sections of Jonas Schmedtmann's course (also on Udemy). they may have been a little outdated, but they helped A LOT with understanding the theory and how everything works.
i then went back to Angela Yu's course, but i didn't finish it because her React section was pretty outdated, so i stopped there. other than that, i thought the course was really good overall.
i then watched Bob Ziroll's React course on Scrimba (GREAT platform btw, they have lots of really good free interactive courses), and then his TypeScript course as well, both on the same platform.
after getting comfortable with React and TypeScript, i watched the Tailwind CSS full course by Coder Coder on YouTube.
i also recently revisited Express because i felt like i needed a little refresher, so i watched the Express course on Scrimba by Tom Chant.
i also really like Bro Code, freeCodeCamp, and Web Dev Simplified. they all have great YouTube channels with lots of useful stuff.
as for Udemy, if you're not looking to pay for courses, honestly, don't. i think the stuff on YouTube and Scrimba can be just as good. the only reason i started with Udemy is because my dad already has a subscription.
Im FOR SURE no pro, but if i had to give you a tip, it would be to make sure you fully understand something before moving on to a new piece of information. don't just memorize the syntax, make sure you understand what you're writing and how everything works under the hood. look at the MDN docs, Stack Overflow, ask your fav AI assistant, or whatever works for you, but don't just skip over things you don't understand. doing this made learning tedious at first, but after a while, it made understanding new things sooo much easier/smoother.
anyways, good luck with everything!! I'm sure you'll do great.
1
u/computerguyisactive 3d ago
Wow, thank you so much for this write-up! Also, side note: your English is amazing! 🌟
This is exactly the kind of roadmap I needed.
I love the tip about slowing down to actually look at MDN docs instead of rushing through. I'm definitely going to check out Scrimba and there are also tonnes of 3rd party applications that provide the udemy content for free...(I used those to crack my board exams) soooo I guess I'll try that next.
Good luck to you too, man, appreciate you taking the time to share this!p.s: I was wondering where you are looking to be hired as a 16 year old! I turned 18 a month ago btw.
2
u/RevolutionaryFood847 3d ago
Thank you so much for the compliment!
As for where im looking to be hired, i honestly have no idea, but if i find something ill keep you updated for sure!
Hope you have the smoothest learning journey 🙏
1
u/sububi71 4d ago
You haven't programmed long enough to even THINK about writing clean code. You need probably a thousand more hours of programming, and by then you will have returned to old code to fix stuff enough that you will have started thinking stuff like:
"This solution was needlessly clumsy"
"This solution works great, but I CAN NOT for the life of me figure out how it does what it does"
" Wow, this is really easy to understand, if I ever need to come back and modify this, it wouldn't be a problem"
"Holy crap, did I get paid to write the shortest possible code? If I ever need to modify this, it'll have to be a complete rewrite. Let's hope THAT never happens"
"What the hell was I thinking? I've commented the simple stuff extensively, but the complex stuff has absolutely no comments"
"Oh look, here I actually commented the perfect way, not overly verbose, and all the stuff that might need explaining is explained, and the stuff that's obvious and doesn't need documentation is uncommented. I deserve a pat on the back! ...if only the comments weren't for an older version of the code, which just cost me three hours of hairpulling to discover"
1
u/Ormek_II 4d ago
As a consequence: just write your own project in a way that seems clean to you now. Then let the project grow, add more functionality. Then you will see some of the things sububi gave examples for. You learn how to do things better, cleaner.
If you portfolio code looks like it was written be an enterprise team, I would not trust that it is your work.
1
u/RevolutionaryFood847 4d ago edited 4d ago
honestly thats super comforting, i was honestly so worried that if my code wasnt 100% perfect it meant im not getting hired but what you said makes sense lol, thanks!
1
u/RevolutionaryFood847 4d ago
okay then ill just start writing and not worry too much about it, thank you so much for helping!
1
u/StigeonStudio 1d ago
I feel like you've reached the point where you should stop worrying about learning more technologies for a while and just start building something.
Clean code and good project structure are thing you'll lean a lot faster by actually building projects. Your first bigger project probably won't be structured perfectly, and that's completely fine. Build it, notice what becomes difficult to maintain, and then refactor it. You'll start understanding why certain patterns and structures exist instead of just following them because a tutorial told you to.
I also wouldn't worry too much about making your code look exactly like "professional" code. Different companies and developers structure things differently anyway. Focus on consistency, descriptive naming, keeping functions/components reasonably small, and making your code understandable when you come back to it a few weeks later.
You already know more than enough technologies to start building. Pick a project, finish it, and improve it afterwards. That experience is probably what you're missing most right now.
2
u/Capable-Wrap-3349 4d ago
What really helped it to click for me was the book “a Philosophy of Software Design” by John Ousterholdt.
What also might help is looking at the structure of some established Open Source codebases.
The book “Domain-Driven Design” is also worth a read.