Code Formatting

Looking into Dart programming language, and I just want to record some of my thoughts.

Dart language comes with dartfmt tool that does not bug you about any incompliances you’ve committed. No – it will fix them for you.

When joining a team, no matter the language the code is written in – I regularly get requests to comply with this or that code standard rule(set).

A question for those in charge of code quality: If it is so important – why isn’t it automated already (like Dart suggests)?

In such situations I usually create IntelliJ Code Style ruleset – only to find that whenever I apply the required style to a moderately large file I’ve just modified – there are too many changes unrelated to my work, and normally – nobody will want to review all of them 🙂

Properly formatted code ensures ultimate readability (Clean Code), but no one ever said that one has to make an effort towards properly formatting the code while writing it (which obviously requires time to actively learn about the coding style instead of e.g. business logic).

My own standard is – whatever comes out of (IntelliJ’s) box. Life is to short to have opinions on spaces vs. tabs or brace on the same vs. next line of function definition.

This entry was posted in Clean Code, Software Development, Tools and tagged , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *