A few things every developer should know [thread]
You are not going to need that old piece of code you just commented out. Delete it. You can always retrieve it from version control if needed.
Use version control.
Try to commit logical pieces that belong together. Sometimes it’s impossible or too complicated but doing one huge commit in the end of the day is not okay.
Never commit without reviewing the changes. You might be accidentally committing secrets or other sensitive information. Cleaning it up and replacing exposed secrets is a lot of work.
Use automated code formatting tools such as Prettier. It saves time from arguing about whitespace, punctuation and other little things in code reviews.
Have a code review policy where someone else than you needs to approve your pull/merge request. This is for quality control. 4-6 eyes can spot more bugs than 2 before they slip in. Obviously doesn’t apply to one person projects.
If someone requests you to do a code review, do it as soon as you possibly can. Otherwise you might be blocking them.
Keep your pull/merge requests as small as possible. Smaller pieces are easier and faster to review and test.
Speaking of tests, they are your friend when you are doing refactoring. It’s easier to upgrade dependencies or make changes in the code when you have a decent test coverage validating that your code still works.
Add e2e tests too. You cannot catch everything with unit tests.
No amount of tests written by a developer can replace a good QA engineer in your team. Value them as team members and keep writing those tests to make their work easier. It also lets them focus on things you didn’t catch.
Technical debt will some day become a blocker which prevents your app from running. You cannot fully avoid it but you should keep maintaining the project to reduce the likelihood for a disaster.
Keep your dependencies up to date. Some day one of them will have a critical vulnerability which may potentially have serious consequences to the whole business.
Don’t install dependencies from suspicious sources. Try to review them by reading the source code if you can. Use automated security and vulnerability scanners.
Don’t install dependencies you don’t need. Be aware of their size and impact to performance. Remove unused dependencies.
Don’t try to implement complex functionality by yourself. You’ll only introduce bugs. Someone probably already solved the problem better than you are ever able to do. This applies especially to managing dates and time.
The only places where you’ll ever need to write a binary tree algorithm are a university class and a job interview. If latter, you should question whether they are measuring the right skills.
Your code is not self-documenting. Nobody can understand what it does without reading through it first. Not even you once a few months have passed. Write those comments if something’s not obvious.
Use human readable, self-explanatory names everywhere.
Have a readme file and keep it up to date. That’s the thing everyone looks for when they want to know what your app does and how to install it.
There are automated scanners looking for a way to exploit security holes you may have in your app. They also look for data dumps and other pieces of sensitive information. Be aware of cyber security and prevent disasters before they happen.
Learn and keep learning as the industry moves forward very fast. The tools you will use today may be obsolete in few years. Fundamentals stay the same, libraries, modules and trends come and go.
I hope this thread is useful to someone!
You can follow @timolaak.
Tip: mention @twtextapp on a Twitter thread with the keyword “unroll” to get a link to it.

Latest Threads Unrolled:

By continuing to use the site, you are consenting to the use of cookies as explained in our Cookie Policy to improve your experience.