Writing code long-term

Writing code long-term

So these are the last days of my holiday. I haven't spent much time thinking about work, but I did some self-reflecting in the end though.

I've been working at Alphabet Nederland for quite some time now and I'm enjoying it. The quality of code is quite high and I keep learning something new every day.

I've noticed one thing among my fellow front-end peers: they tend to truly excel at one thing. One likes unit testing and the other is quite into the specifics of the Angular framework itself. Which is good and only natural: people like to focus more on things they truly enjoy.

I've noticed myself in the last couple of months that I truly like writing clean and maintainable code. I can highly recommend each and every front-end developer to bookmark the clean-code-javascript GitHub repository and revisit it every once in a while. Great guidelines.

I have noticed for myself that writing complex code is pretty easy. There isn't much to it. Writing maintainable code however, is much harder than anyone might think. I'd like to think of this as coding on a long-term base. There's always a big chance someone will take over your project in the nearby future and you'd like to keep that transition as smooth and easy as possible. Newcomers should not have any trouble reading your code.

Given the fact that we work with different teams, it's hard to keep code clean among those people. Besides the GitHub repository mentioned above, you might think of other ways. Setting up a proper and strict TSLint configuration might be one way. Try using the 'recommended' configuration of TSLint itself for starters. Also, when it comes to Angular projects, be sure to check out this repository, setup by one of the Angular core team members.

If you're using another tool like SonarQube, be sure to pay attention to the quality profiles of the languages being checked. If possible, use the 'Sonar way recommended' rule profile, which is a bit more strict than the usual 'Sonar way'. This profile usually contains extra rules which focus on "high code readability and long-term project evolution". So focus on a high quality profile and add a new one whenever your project introduces a new language.

Last, but not least, make sure your code gets reviewed by as many different people as possible. Years ago, when I was much younger, I used to feel offended by anyone pointing out errors in my code. Not anymore though. Multiple perspectives will let you gain much more insight and perhaps new ways to keep your code clean. Sure, you don't have to follow up every single recommendation, but it's good to keep an open mind with every comment.

Long story short: keep thinking long-term. Other tools and friendly colleagues can certainly help you with that.

To view or add a comment, sign in

More articles by Martijn 🚀 V.

  • Stay humble, keep learning

    I was looking for a great headline. Something that really sums up the essence of progressing oneself.

    2 Comments

Others also viewed

Explore content categories