Good practices (Arduino Programming)

About the...
code here....
}
code here...
}
code here...
}
...wait till you've got a chunk of code where those three brackets are on three separate (printed) pages, with maybe another page of code between two of them. It gets 'not fun' reeeal fast

You are making a good case for using functions with meaningful names for your 'code here..' lines to avoid the code spreading vertically.

I started the ball rolling with the first reply in this thread knowing that some of my suggestions would jar with some people.

On the whole there is nothing actually wrong with any style as long as it works for you, but as soon as someone else needs to read and understand your code, or you revisit it some months later then consistent layout, use of functions, and meaningful function and variable naming pay dividends.

There are some conventions that are generally accepted, such as capitals for the names of constants (why ?) but even that is not strictly adhered to in the Arduino IDE. As soon as I used them I wondered why the constants for true and false are lowercase and not uppercase for example. Yes, I know that I can define them for myself.

One thing is for sure. We are all going to differ in our views and we are all correct in our own views on this subject.