The bad things you do

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

alvinphp
Forum Contributor
Posts: 380
Joined: Wed Sep 21, 2005 11:47 am

The bad things you do

Post by alvinphp »

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>.
foobar
Forum Regular
Posts: 613
Joined: Wed Sep 28, 2005 10:08 am

Re: The bad things you do

Post by foobar »

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! :roll:
alvinphp
Forum Contributor
Posts: 380
Joined: Wed Sep 21, 2005 11:47 am

Post by alvinphp »

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.
foobar
Forum Regular
Posts: 613
Joined: Wed Sep 28, 2005 10:08 am

Post by foobar »

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?
I do, to the best of my abilities. Which has been pretty good so far.
alvinphp wrote:Considering that the most used browser is not compliant it has to be hard to follow the W3C standards completely.
Ever heard of the W3C Validator? It's a great aid. I love standards-compliant code.

[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]
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Post by josh »

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 8)
Roja
Tutorials Group
Posts: 2692
Joined: Sun Jan 04, 2004 10:30 pm

Re: The bad things you do

Post by Roja »

alvinphp wrote:So what are the bad things you do in PHP/HTML coding that you know is bad, but you do it anyways?
I compromise.

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

Post by Charles256 »

i code procedurally? LOL. Mainly I just get lazy sometimes....and code what works,not always the best soluton but it works..
User avatar
Buddha443556
Forum Regular
Posts: 873
Joined: Fri Mar 19, 2004 1:51 pm

Post by Buddha443556 »

Charles256 wrote:i code procedurally?
I don't know that was a bad thing. Heck, count me in on that one! :D
Charles256
DevNet Resident
Posts: 1375
Joined: Fri Sep 16, 2005 9:06 pm

Post by Charles256 »

it was a joke ;) no one take it literally or we'll all get modded! :-D
User avatar
neophyte
DevNet Resident
Posts: 1537
Joined: Tue Jan 20, 2004 4:58 pm
Location: Minnesota

Post by neophyte »

Documenting and commenting: I should do this... :roll: :oops: :roll:
Charles256
DevNet Resident
Posts: 1375
Joined: Fri Sep 16, 2005 9:06 pm

Post by Charles256 »

that's what I forget to do! comment! man I am bad about not commenting if I think it's self evident...
User avatar
n00b Saibot
DevNet Resident
Posts: 1452
Joined: Fri Dec 24, 2004 2:59 am
Location: Lucknow, UP, India
Contact:

Post by n00b Saibot »

PHP Short Tags are weak point for me :oops: but I never got burned :wink: I try to maintain the XHTML compatability but may slip outta mind in some pages :?
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Post by josh »

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.
mickd
Forum Contributor
Posts: 397
Joined: Tue Jun 21, 2005 9:05 am
Location: Australia

Post by mickd »

as long as i know its bad to do, i dont do it.

the only thing i can think of that i know i shouldnt do but i should is not comment my code.

btw, whats wrong with using the <b> tag? is it being depricated and prefered by <strong>? if thats true, i wont be using <b> anymore ;)
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

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!).
Post Reply