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 commentsYour public apis should be based on the shape of your data. I would prefer postgres over mongodb because your data probably has a schema.
If you have the time, learn some other languages. Each language has their own ecosystem where problems are approached slightly differently. You'll pick up patterns and be able to apply them to your work. I would recommend elixir, which has a very focused ecosystem and a standard library with well thought out apis.
I follow several public and private projects that I do not contribute at all. Any time there is a review comment on a pull request from senior devs, I try to check if it is new to me. If so, I note down the problem and suggestions.
Here are some examples:
- Aleks suggested to limit the try to the places where exceptions can be thrown and move everything else out of the try.
- Thomas suggested to use =StringBuilder= instead of =String.format=. The former is faster and more robust.
- Oscar suggested to use a =parameter object= or a =builder= when there are many (more than 3-4) parameters.
You don't need to know almost everything (and derive what you don't from first principles), that is unreasonable. You do need to have a network of folks you can ask help or feedback from.
Being on a small team without much support will force either very fast growth or failure, and your ability to be intellectually honest (is this true or do I want it to be true?) and identify folks who can and are willing to genuinely help are important factors.
Not so much mailing out code reviews, but sharing design ideas, approaches, etc. Former coworkers you are still friends with, open source collaborators you have become close to, etc all work.
Basically, build and maintain relationships with people who have good judgement. Help them out, ask for help yourself.
All comments shown.
Couldn't load more comments. Check your connection and try again.