Any programming environment with more than one person working on the same project requires communication; it is an essential part of getting a job done efficiently, and it is common sense. But while normal business communication includes writing, speaking and body language, programming communication also includes readability of code along with good documentation.
Having experience with coding in a large project with other people, I clearly see that indentation is a large part of readability of code. It is extremely important to be consistent with spacing regardless of the language. However, whether to use tabs or spaces for indentation is up for debate. In fact, the issue of tabs versus spaces is a highly debated issue; a simple search will show that. Even so, it is important to have a clearly defined rule when engaging in a project with other people.
To show the importance of this many different open source projects define strict guidelines for indentation. To list a few:
- Style Guide for Python Code
- Python Style Guide for C Code
- Zend Framework Coding Standard for PHP
- WordPress Coding Standards
- WebKit Coding Style Guidelines
- Flex SDK coding conventions and best practices
Most of these say 4 spaces for per indentation level, and all say to never mix tabs and spaces. I do 4 spaces; my programming team at work has agreed on 4 spaces—it works really well in pretty much all cases. All good editors have ways to make this easy to do using the tab key too.
More than likely the language you code in already has some guide already. Please follow it, and remember what the Zen of Python states: “Readability counts.”