No one have mentioned this so far so I feel I am obligated to post one. The choice of indent size (which I think what OP meant), affects not just how codes are indented but also affects how much code you can fit in a line and how they align.
A development team needs to eventually come to some sort of agreement on the length of a line. I started off with 80 columns and to this day I still stick to 80 columns. AFAIK, stackoverflow uses 80 columns in source code markdown as well.
When you use an indent level of 8, with a typical function that is nested 3 levels deep, your code will start at column 24. That lefts me with just 56 characters to write a line of code.
Here is what some code in VLC looks like with indent=4:
msg_Dbg( p_libvlc, "Adds %s to the running media player", mrl );
free( mrl );
/* send message and get a handle for a reply */
DBusMessage *reply = dbus_connection_send_with_reply_and_block( conn, msg, -1,
&err );
dbus_message_unref( msg );
Here is what it looks like with indent=8
msg_Dbg( p_libvlc, "Adds %s to the running media player", mrl );
free( mrl );
/* send message and get a handle for a reply */
DBusMessage *reply = dbus_connection_send_with_reply_and_block( conn, msg, -1,
&err );
dbus_message_unref( msg );
While large indents make code easier to read, it also gives you less room to write nested code before they wrap around.
It is really important to keep tab size at 8. tab != indent. While it is temping to make hard tab as indents, it also have very bad consequences. A lot of people also like to align their code. So code like above will look like this with tab = 4:
msg_Dbg( p_libvlc, "Adds %s to the running media player", mrl );
free( mrl );
/* send message and get a handle for a reply */
DBusMessage *reply = dbus_connection_send_with_reply_and_block( conn, msg, -1,
&err );
dbus_message_unref( msg );
You will see that the line &err
no longer aligns with conn
above. The situation gets even worse when multiple comments are added in the end of each line.