A question about bad coding...

mrp2049

Senior Member
Something I have noticed Harry does on his twitter is trow out examples of bad coding:

James Bale - Online Portfolio - Index

Mixero

now my question is this, why is that bad coding?

Both sites work, they may not win awards for the best designed website, but you can navigate your way around and do what you need to do.

I know there are bad practice things that go on in every world, but the only reference I've got is my guitar playing, I've got bad technique being completely self taught, but it works for me, a few people have told me what I'm doing wrong, but it works don't it?

This is not an attack at Harry in particular, as someone with very little coding knowledge, but wanting to learn, this is a chance to educate me before I start making mistakes.
 
The top sites code doesnt have a doctype, for some reason has two <head> tags, the center tag? is in the wrong place, the <font face="Arial, Helvetica, sans-serif"> tag needs to be closed

The use of tables for non tabulated data, not closing all tags (image tags etc.)

all make it a slower process and less compatible with certain browsers as the browser has to assume certain things and work out what you meant by this or that.
 
The second one again has issues with not closing tags and using tables for arguably non tabulated results. and position of certain tags is in incorrect places. Sure it all works, but it doesnt work as well as it should.

A good analogy would be driving a ford focus vs driving a bugatti veyron, sure the ford focus does the job, looks good, and goes quick, but the bugatti veyron is a masterpiece of creation, looks great, goes quicker.
 
The first one also has text which is not varied enough from the background so is not particularily friendly.

It has no alt text in the images which show text.

text size is specified in pixels so cannot be enlarged by ie
 
Hope my Twitter thingy ain't offending anyone haha.

But there are numerous reasons. It's a shame I'm limited to 140 chars as it looks like I'm just dissing a site, whereas it'd be nice to offer constructive insights into how they could be better…
 
mrp2049 said:
well I'm learning! I think I could handle a focus over a veyron!
Just don't buy one with a table in the middle because that's not very convenient :clap:
 
Having just made the switch from safari to firefox, and installed web developer and fire bug, it makes a little more sense.
 
All his styling fonts etc etc should be done in a stylesheet and then linked away to the stylesheet to make the styles work properly...
 
This brings me to my point that if it works then the end user wont care how it's done (inline, external, tables or css).

Best practices should be adhered to to save us time and to give the client the best solution, but in many cases the final outcome hardly varies regarding these factors.
 
Bad practices are called that because (clues in the name) they are bad. They are slower, less organised, and more prone to being a crap job done. You get what you pay for :)
 
Fred has a point, which is partially what I was getting at, if it works, it works.

To return to car analogies, people still like 2CV's!
 
Indeed, if it works it works. Thats not a problem. But surely you would want it to work better? otherwise we might aswell be still using the first graphical browser released? it worked....
 
The thing is, 90% (maybe even more) of people don't care.

I've found that out recently. If you can get the same outcome using tables then they don't care whether it was built with tables.

If there's a chance things might not work on this browser or that browser, often they wont care.

That's why I generally struggle trying to argue the pro's of well coded sites.
 
Fred, you should care! and you should care about what you use and produce in order to fulfil your clients needs, This focus on detail and understanding of the profession, tools, and technologies is what will separate you from the rest of the band wagon brigade. It is your responsibility as a professional (if thats what you wish to be known as) to educate your clients as to why they should care about the solution, and what it means to them to have a product that is both water tight and also value for money. If you dont know why a client should care, then you need to learn and understand first before taking paying clients on.

If designers and developers don't care about this profession, standards, doing things correctly, then I personally would rather they find another career path.

On reflection.... I would rather they carried on and keep doing jobs for £50 - £100 quid because 90% of those clients then come to people like Harry and myself to get the job done right! and in-turn pay good money for a professional, technologically sound solution, and an on going relationship that benefits both parties.
 
it does seem to be a random subject, i seems to make a mockery of what w3c try and do!

I can see both sides of the arguement, I have often wondered what the average browser setting is for most of the world?

I guess it depends on what you are doing, I know when it comes to web design for web designers you have to be more fussy about these things, from a coding point of view, and from a visual point of view.

Background images big enough to cover/fill 2000px wide screens etc
 
Xenonsoft said:
This brings me to my point that if it works then the end user wont care how it's done (inline, external, tables or css).

Best practices should be adhered to to save us time and to give the client the best solution, but in many cases the final outcome hardly varies regarding these factors.

The end user will care about the speed, SEO, and accessibility of the site though. And those factors can be greatly improved by doing things "correctly".

I agree with Sunburn. It's our responsibility to make sure we deliver the best product possible and to take our profession seriously by doing so.

On another note I also believe that having some sort of standard like the W3C makes life easier for Web Designers and Front End Developers. It becomes easier to read and understand other peoples code if everybody does things the same way. I work with 3 other Web Designers and if we all had our own way of doing things it would be a nightmare to fix errors and to decipher each others code.
 
I think you lads have misunderstood me.

I'm saying 90% of people (a figure off the top of my head, albeit) don't really care how a site's built. They're not fussed if it takes half a second longer to load or whether it might not work on linux.

Maybe 90% is too high, but my point is, lots of customers out there don't care.


That's not to say I don't care, of course I do. It's my job to give the best solution to the individual problem. I never use tables and always implement the best code possible, not only because it is the best for the end user but also because it saves me time.
 
I think the average Joe indeed has no idea about semantics, valid code and accessibility. When he visits a site and it doesn't work he'll just leave and maybe come back later to see if it works the second time, but that's it. He's not gonna say "Oh gee, I wonder if this site is IE6 compatible, let's try that out!"

So then it's our job that Joe doesn't leave the site because it doesn't work, even if he doesn't give a shit about it. We need to make sure that the customer knows that Joe will leave when they find someone to do a half-ass job at a low rate.
 
Back
Top