Follow me
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, 2006Well 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:
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
Julie Joyce
Link building expert and blogger

