Standardizing
by Dave Bates on Jun.07, 2012, under Ramblings
Okay.. so most developers know, standardization is key to good code. Now when I was in school learning C and Cobol, we were taught to indent code in thus style:
function someFunc($a, $b) {
echo "Do something";
if (1==1) {
echo "Do Something";
}
}
Now, I’ve been doing a lot of work in WordPress over the last couple years and have been told I should be formatting and standardizing on the K&R formatting system.. This is counter-intuitive to what I learned..
But I guess I need to change..
The K&R system is like thus:
function someFunc($a, $b)
{
echo "Do something";
if (1==1) {
echo "Do Something";
}
}
This will be a heck of a learning curve.. but I’ve already started changing my editors to do the new K&R style.. man it’s going to be a long road…
You wouldn’t think that one “ENTER” would make much of a difference, but when you have been doing something for 15 years the same way.. change will be rough..
-
Geovanny Poveda
