Ask HN: How to learn best practices when you have no one to teach you?
440 pointsI am currently working for a startup and am one of 3 developers. Most of my work revolves around building the API in Node + Express as well as some small projects with MongoDB. The other developers don't really assist me since they have their own projects to work on, and, honestly, they have less experience and knowledge than I do.
So my question is: What is the best way for me to go about learning best practices in API development, or using MongoDB, or even just being a better software developer in general?
Comments (197) 98 threads
Earlier commentsOtherwise I'd suggest to look at projects that the "community" deems well written.
https://news.ycombinator.com/item?id=18794561
My best advice would be to try and use one of the publicly published coding standards from a big company as there is usually a lot of good knowledge/experience baked into those. Use a linter religiously and do not commit code with lint errors. For every commit, take a step back and think "is this code shit?" If I had to explain it to someone who I thought was a 'better' or more experienced coder than me, would I be embarrassed about it?
Generally you'll get a gut feeling about code being good or bad - how reliable it is, how often you have to tweak it, how easy it is to change etc. If it is hard to make changes to some code or its really buggy or brittle then trust your gut: You Are (probably) Doing It Wrong. That is when you can go and read around different approaches online to see what other people have done to approach the same/similar issue and learn from them. Some approaches will resonate with you, some won't. Make a professional judgement on which (if any) you want to learn from/emulate in your codebase and why you made that decision (the thought process helps - sometimes you just need an 'ah ha' moment to work out your own approach)
tl;dr - beyond fundamentals, everyone does things differently. Do what works for you and what is reliable and maintainable.
All comments shown.
Couldn't load more comments. Check your connection and try again.