Yeah it matters heavily to me. It makes code more readable to me AND I make less errors. I took a look at some good examples and tailored my own coding style from it. Here are my most important coding rules:
- Use speaking names for variables/functions and use correct camel casing (starting with a lower case and every new word with an upper case). Avoid abbreviations!
- Avoid vertical space waste, opening curly braces are on the same line then the statement: if( _isPaused ) { ...
- Indent only inside braces if( _isPaused )
- One line conditional statements are always enclosed by curly bracers
- In class definitions public interface comes first, followed by public members, then protected functions and members, then private functions and at last private members.
- Private class member names start with an underscore: sf::RenderWindow _window; (I don't like the often used m as a starting character)
- Indent member names in class definitions to make nice looking columns, but only in each public, protected, private block
- Always use #pragma once in the beginning of every code file (traditional include guards are ugly and serve no purpose anymore since every prominent compiler uses #pragma once)
- Use multiple namespaces for the project to separate e.g. engine, entities, game states etc.
- Always use STL algorithms and containers, use smart pointers and RAII, avoid manual memory management like the plague
- Use const as much as possible! It helps avoiding stupid bugs!
I have more rules, but these are the most important to me. Since following them, my code became much cleaner and more bug free. Especially the use of const helped me much
Good luck in finding your own style.