Don’t manually format your code; use Astyle.

This is what computers are made for: automate boring, repetitive, simple tasks. Code formatting, indenting and beautifying is repetitive and long. Incredibly so. You should use automatic tools to perform this task. Unless you enjoy this task, in which case I suggest an amusing activity: repeatedly spilling water on the floor and cleaning it up, for hours.

The tool I recommend is the command-line only software Astyle, short for Artistic Style. You can find it here: http://astyle.sourceforge.net/. Learn to use the command line. It’s not so difficult. Then, include Astyle in your build system. It takes up a single line, and is barely noticeable in time spent when compiling. It will save you hours of tedium. These kind of software are the reason I love programming: automation! Also, your code will be beautiful and coherent always, in terms of formatting anyway.

Leave a comment