Lurker News
I 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 comments
dilatedmind#
Keep things simple and idiomatic. Use dependency injection and hook everything up in main. You should be able to open up your code and understand what's going on just by looking at this setup.

Your 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.

morazow#
Read code reviews of senior developers.

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.

brianm1 reply#
Reach outside your company. Genuine appeals for focused help are rarely dismissed.

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.

j88439h841 reply#
I'm having trouble imagining how to do this. What does it look like? Emailing a friend at another company to ask for code review?
brianm#
I am old fashioned, so I use IM to say things like "Hey, Martin, I'm thinking about ... Does it make sense?"

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.

grigjd3#
So, avoiding the discussion of what constitutes best practices, it's important to recognize that you don't know everything (which you seem to get), but also identify the things you don't know and learn how to research them enough to handle your task, which is definitely more than Wikipedia but most often you don't need to be an expert in a thing. Unfortunately, if you don't have people around to grade your work, developing a sense of this can be quite hard.

Load more comments