Jotting #1: Style

Style and taste is in the eye of the beholder, and many a flame war has been started on it (but not here … no comments allowed 😉 ), but still I have to put some thoughts down on this.

Coding style and formatting is quite important to get readable code but still people pay scant attention to the little details. E.g., how often do you see a bit of code like this:

if (a == b && c > d) { ... }

In my view that’s awful formatting: the elements are not properly grouped using white-space! I usually format such code snippet like this:

if( a==b && c>d ) { ... }

Just by removing a few spaces the logical groupings have also moved visually together.

Advertisements

Comments are closed.

%d bloggers like this: