Is your code too complex?
Monday April 14, 2008
It can be very tempting to create complex, complicated HTML and CSS to solve a problem on a website. But have you ever had to go in later and fix someone else's crazy code? You know the developer I mean: s/he writes HTML with 5-level deep nested tables, DIV tags for every possible element, no comments to explain any of the code, and CSS with so many selectors it looks like alphabet soup. The scary part is when that developer is you - six months ago.


Comments
I agree. I am teaching my self coding by taking current code of local sites and trying to simplify it while maintaining both form and function. There is a lot of bloated code out there. I’m surprised at how many commercial sites do not validate.
I always try to be efficient and clean up my code, put comments into my css so I (or my colleagues) know what is what and try not to put tables in tables in tables.
My predecessor used to put pages together by tons of php includes. Do you know how hard it is to update a page where you have to look up first what include is put in, what it’s called and where it is? And he was one for short names - as sr.html or hm.php. Very telling names *gnah* It unnerves me every single time when I have to work on one of his sites.