This is on topic but doesn't really fit any of the vb-specific forums.
I have my own slightly lazy, slightly more efficient-for-me style of coding and I was firstly wondering what you guys thought of it and if you had any styles that break the "how to write neat code" rules yourselves.
I use 5 things I can remember:
1. I omit unnecessary curly braces
2. Shorthand ifs
3. I don't use switch_exec_bg()
4. I don't always use templates. I never use phrases.
5. Simplify the damn queries!
1. I don't use curly braces for single commands, e.g.
You must first be a
registered member to view any code.
No reason other than it's a lot quicker to type and I find the code is easier to read.
2. I find shorthand ifs much nicer than longhand
You must first be a
registered member to view any code.
rather than
You must first be a
registered member to view any code.
3. I don't see why people use switch_exec_bg (it's the function that switches a row background color from alt1 to alt2 (light to darker)).
I use
You must first be a
registered member to view any code.
which seems more logical because it saves time looking up the function.
The function's description says it can support > 1 background set at the same time, but since you only create one set of rows at any time, I don't see the point.
4. Okay I know this one is laziness
I don't always use templates in my scripts.
Sometimes I'll put things like row content directly within the php file. Sometimes it's just a hassle to create a new template, figure out all the row variables you have to put in it etc. Plus I read somewhere that eval() is quite slow.
5. Example:
You must first be a
registered member to view any code.
I use
You must first be a
registered member to view any code.
For one thing, $row is quicker to type than $currentthread.
For another it's always the same so I can type new queries easier.
For queries that need to stay open and can't be freed, I can understand the unique name. For the rest, I struggle to see why.
Probably more of a pet peeve than anything.
And now a mini rant:
Why doesn't vb include a print_r() function. I use
You must first be a
registered member to view any code.
It's one of the most useful debugging tools out there.
Come to think of it, why isn't there a hook in functions.php so you can make your own functions. grr.
Anyway,
Any other interesting coding habits I could adopt that break all the rules?

Is it really important to have coding style that follows all the rules before it's released? I've got a couple I'd like to release but they basically use the above.