Featured Post

Daily Workload vs. Daily Motivation

Have you ever had those days? You know what kind of day I mean. When waking up in the morning usually brings about those dreadful feelings o...

Visit Our Sponser

Personal Development Category (English)468x60

Popular Articles

Does Distraction Free Working Exist?

Have you ever hard to edit something that took you forever to do? Was that paper really written that bad or were there just too many distractions to keep pulling you in different directions?

Is there really such a thing as distraction free work?


I spent the better part of yesterday editing a single WordPress template. A recently purchased WordPress template did contain some errors. While these have been a little annoying lately, as they do trigger my php log file to record them, they have been relatively easy to fix.

But yesterday I decided I was going to update and change a few items with the template. So I wanted to comply change the main button for clicking "view more details".

As a software developer I was hoping it would be a simple fix. Just edit the file and change the link reference for the image, right?

Nope I was wrong. Turn out the PHP code was far from as clean as I am accustomed to writing. In addition to the lack of white space the code contained several section of coding that was confusing.

What made things even much more complicated was the level of distraction provided by my daughter. She is 9 and now home for the summer. She is completely bored out of here skull and since I work from home she feels this is carte blanche for her to bug the heck out of me.

Editing someone else's code can be a considerably hard thing to do. ( know I have been doing it professionally for over 20 years. My first ever programming job was to "fix" a Java program that someone else developed for 2 years.

It is hard to put yourself into the shoes of the other developer and have an idea of what they were hoping to accomplish. This could have been greatly avoided with some simple fixes.

I appreciate that PHP is a very flexible language, but this should not prevent PHP coders from learning and implementing basic and common programming practices.

There is no shortage of available whitepsae in any PHP editor that I have ever seen.


There is also a button on the keyboard called the "TAB" key.


A common practice is to tab (indent) when you are entering control statements (at the minimum).


Structures like this:

Do some thing here;
                    if these code
                            {
                             some other code;
                             }
                    end your if statement

         do your next code block

are so much easier to follow and read then having it all mushed together.

If your a new or younger programmer that has not been formally trained in many of these concepts then please I implore you take a few minutes to read through the links below so that you too can make better coding part of your programming repertoire.

Top 15+ Best Practices for Writing Super Readable Code - Code Tuts

Best coding practices - Wikipedia

13 Simple Rules for Good Coding (from my 15 years of experience)




No comments:

Post a Comment