SEOidiot

Follow me

Hello there

To me it looks like this may be your first time here. If you like why not Follow me.
You might also like to find out a bit more about me

My new PHP coding rule

May 22nd, 2006

Well i have a new rule as of tonight. I dont know about you but i tend to find that I do my best coding late ar night and that tends to mean that my coding time conflicts with my realxation time….. never a good combination. So there I am typing away and all the time supping more and more Peroni.

Then I look over what I have typed and I realise its crap – complete crap. It looks like this (No laughing now)

$fp = fopen (”$filename”, “a+”);
// heres that bit you were doing before the other bit
$botspy = “botspy.csv”;
// i am writing to a csv so i can import straight into that other thing
$visitdatefull = date(’l dS of F Y h:i:s A’);
$visitday = date(’D');
$visitdayofmonth = date(’j');
$visitmonth = date(’M');
$visityear = date(’Y');
$visithour = date(’H');
$visitminute = date(’i');
$visittime = date(’h:i:s’);
// now you have to work out how to make the script do what we want
$keywords = stripslashes($keywords);
//job one – strip slashes from the string then we can use it for file creation etc
$keywordsforfile = $keywords;
//split the keywords variable into two so i can capatalise the first letter and

//add slashes without making the filename crap
strtolower($keywords);
//make the kw string lowercase first
$keywords = ucfirst($keywords);
// just making the first letter of the keywords uppercase

So the new rules are: -

Stop coding when either….
Your code reaches 50% comments!
You start to add comments like “This is that thing – you know the thing….”

Related posts:

  1. My advice to someone starting

Leave a Reply



About SEOidiot

Hi my name is Paul Madden and I am a UK SEO based in Lancashire, for years I have been cursed by the nickname SEOidiot which started life as a form of abuse from someone but you need to decide for yourself how accurate the term is.

Quotes about me

"Out of all the technical SEOs that I know, Paul Madden stands out as being both amazingly capable and extremely easy to work with. He's quick to point out flaws in your argument, which is nice as I've worked with many people who simply agree with me even when I'm obviously incorrect. The minute you mention an idea to him, he's testing it out, and it's that intellectual curiosity that keeps me constantly coming back to him whenever I need industry advice."
Julie Joyce
Link building expert and blogger
kerboo






  • About SEOidiot
  • Follow Me
  • Recommended Reading
  • SEO services

  • Tags


    Big List - Search Marketing Blogs