The bad things you do
Moderator: General Moderators
The bad things you do
So what are the bad things you do in PHP/HTML coding that you know is bad, but you do it anyways? I personally always use <? ?>, I rarely add the closing option tag (</option>) , I usually don't put double/single quotes around attributes in html tags unless it must have it, and I use <b></b> instead of <strong></strong>.
Re: The bad things you do
I, and this is very painful for me to admit, use, God have mercy on my soul, W3C standards compliant, I beg for fogiveness, XHTML whenever I am prodded by, may God forgive me, the abominable Lucifer.
Ok, I've said it. You all know, now. To make matters worse, I also always use <?php ?> and correct formatting. I am pittiful and weak, I know, but my lusting for well-formed, portable code is stronger than me. Please don't reject me after these confessions. I AM ONLY A HUMAN!
Ok, I've said it. You all know, now. To make matters worse, I also always use <?php ?> and correct formatting. I am pittiful and weak, I know, but my lusting for well-formed, portable code is stronger than me. Please don't reject me after these confessions. I AM ONLY A HUMAN!
So you completely follow all the W3C standards? If I was to look at your code I would find nothing wrong? Do you also follow the accessibility standards which is also part of the W3C standards? Considering that the most used browser is not compliant it has to be hard to follow the W3C standards completely.
I do, to the best of my abilities. Which has been pretty good so far.alvinphp wrote:So you completely follow all the W3C standards? If I was to look at your code I would find nothing wrong? Do you also follow the accessibility standards which is also part of the W3C standards?
Ever heard of the W3C Validator? It's a great aid. I love standards-compliant code.alvinphp wrote:Considering that the most used browser is not compliant it has to be hard to follow the W3C standards completely.
[Oh, by the way, if you ever stumble upon the chatscript I made, then that won't be compliant with anything, but my excuse is that it's still in beta and currently on hold]
Well the title of the thread was not "do you use standards most of the time", it was "what are the bad things you do". You just admited to a chat script that is not standards complaint which contradicts your first post in the thread.
Anyways I use table based layouts on a lot of projects, there are just some places the DIVs can't go, but I'm learning new things in CSS everyday. Another thing I am guilty of is realizing the solution I am coding isn't the best possible choice, but proceeding with it because I am lazy to backtrack. When I design for clients though I try to avoid that when possible and always give em my best
Anyways I use table based layouts on a lot of projects, there are just some places the DIVs can't go, but I'm learning new things in CSS everyday. Another thing I am guilty of is realizing the solution I am coding isn't the best possible choice, but proceeding with it because I am lazy to backtrack. When I design for clients though I try to avoid that when possible and always give em my best
Re: The bad things you do
I compromise.alvinphp wrote:So what are the bad things you do in PHP/HTML coding that you know is bad, but you do it anyways?
Seriously, its a broad answer, but its 100% the right answer. For example, when writing new code, I write to standards. However, for bringing old (ancient) code up to date, I may not give standards compliance my full attention.
Or with new code, I may make a very clean MVC seperation, or use a solid pagecontroller. But with legacy code, I'll compromise and work on seperating the view, but not the rest.
I'm pragmatic, because if I tried to do everything to perfection on the first try, I'd get very little done. Personally, I think that standards, design patterns, and coding techniques are important guidelines that lead to better results. There are however times when each is less important than the overall goal of progress, and if its a binary choice between the two, I'll often take progress over perfection.
-
Charles256
- DevNet Resident
- Posts: 1375
- Joined: Fri Sep 16, 2005 9:06 pm
- Buddha443556
- Forum Regular
- Posts: 873
- Joined: Fri Mar 19, 2004 1:51 pm
-
Charles256
- DevNet Resident
- Posts: 1375
- Joined: Fri Sep 16, 2005 9:06 pm
-
Charles256
- DevNet Resident
- Posts: 1375
- Joined: Fri Sep 16, 2005 9:06 pm
- n00b Saibot
- DevNet Resident
- Posts: 1452
- Joined: Fri Dec 24, 2004 2:59 am
- Location: Lucknow, UP, India
- Contact:
hmm oh yeah short tags are another one for me...
but if the code is intended to run in many places I go for the long tags, you know how it is..
Another one (very very naughty jshpro2) is assuming queries always work, that is not explicitly checking for a return value of false on things like inserts (unless a query further down the page depends on that query working), so if for some reason a query doesn't go through they would see a *blank* page.. most of these are old habit's that I have since broken, though... just thinking back to things I used to do.
but if the code is intended to run in many places I go for the long tags, you know how it is..
Another one (very very naughty jshpro2) is assuming queries always work, that is not explicitly checking for a return value of false on things like inserts (unless a query further down the page depends on that query working), so if for some reason a query doesn't go through they would see a *blank* page.. most of these are old habit's that I have since broken, though... just thinking back to things I used to do.
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
I sometimes have a tendency to use if...elseif...elseif...else instead of switches, although I do go back and correct myself if I see this happening quite a bit. I also seem to like to scramble my CSS attributes and end up with things that just look awful. I am pretty good about the rest though (except using tables, but I am checking myself into a rehab clinic next week to break the habit).
From what I've read at w3c, <b> is being depricated along with <i> and <u>. <strong> is now favored in place of <b>, <em> is now used in place of <i> and <u> is being thrown out altogether in favor off CSS underlining. Oh well, I haven't used the old ones for a while (Hey, I did a good thing!, Yippee!).
From what I've read at w3c, <b> is being depricated along with <i> and <u>. <strong> is now favored in place of <b>, <em> is now used in place of <i> and <u> is being thrown out altogether in favor off CSS underlining. Oh well, I haven't used the old ones for a while (Hey, I did a good thing!, Yippee!).