You Are Here Home > General

General

How Not To Write Code

I’m working on a website and it’s absolutely awful, almost all the design choices are bad so I will compile a list here as I encounter them:

1 – Don’t have fields in your database like “extra1″, “extra2″ or “extra3″ you probably need to refactor and rethink your design…

2 – Don’t have a global object and access and manipulate it from deep inside your code, here for example there is a $tpl variable which – wrongly – is called $class_tpl and it’s global, the authors are calling a pager function to create an array for rendering a pager and after they call they manipulate the $class_tpl a bit by adding paging data to it and you would think that was it, but guess what? In their pager function they again access $class_tpl and manipulate a bit more!!!

3 – Don’t ever, ever, ever, ever query your database from within your templates, never…

4 – Don’t die or exit out of functions, return error messages…

5 – Don’t output out of function either, no “echo $blah;” in a function, they should return the text string rather than printing it…

6 – Don’t ever, ever, ever repeat yourself, if you are too lazy to write a function or rethink that portion of your code, then you suck as a programmer… To be honest, I do suck sometimes, but I try my very best :)

How Not To Write Code
Comments (0)   Filed under: C Programming,General,PHP,Web Development   Posted by: Hamid

Solution to CuteFTP Pro 8 hanging problem under Vista; Can’t find transfer engine…

To fix this issue, open CuteFTP and go to:

Tools > Global Options > Connection > Smart Keep Alive

And disable “Smart Keep Alive”, apparently it’s not very smart…

Solution to CuteFTP Pro 8 hanging problem under Vista; Can’t find transfer engine…
Comments (0)   Filed under: Annoying Stuff,General,Web Development   Posted by: Hamid
Older Posts »