Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

It is totally pointless writing good code


FWR Media

Recommended Posts

Let me start by saying that lazy, badly written code gives me the personal hump.

 

This post isn't however about ( me getting the personal hump ), no one would care. I know I am in the minority so I will get blasted here but I felt the need to make a post just to see the reaction of others, I also thought the resultant thread may be fun. If perchance it encourages one person to write good code then I'll be happy.

 

For the rest of this post I will use the term "web monkeys" I use this term to describe those who can write basic [x]html/javascript ( but don't care about good code as long as it looks ok ) but are not proficient in the server side frameworks ( in this case PHP ) and databases. It is not intended as a derogatory term.

 

Whenever I look at or am asked to look at a web site ( osCommerce shop in keeping with this forum ) virtually never is it producing valid [x]html.

 

I saw a post today and it exemplified the excuse of a "web monkey" for writing bad code, I quote ..

 

I ran a few famous sites threw the validator just for fun and Amazone.com´s mainpage has 415 Errors, 108 warning(s) , Ebay has 485 Errors, 23 warning(s) And this thread has 45 Errors, 5 warning(s)

 

Well I'm surprised they didn't add Google to that list, surely it is the most powerful.

 

If ever a web monkey is asked to justify writing bad code the above is the reply you'll get ( maybe with Amazon spelt correctly ).

 

My thoughts on this are .. so what!!! these companies employ world leading specialists, in many cases they help to dictate the NEXT markup standard. Google uses HTML5 and the W3C conformance checker for this is experimental.

 

This doesn't provide a valid excuse in my humble opinion for web monkeys to feel comfortable justifying the delivery of bad code to their customers.

 

I liken markup to a well or badly punctuated letter .. punctuate badly and the letter is open to misinterpretation .. All the web monkeys complain about IE and other differences in the ability of disparate browsers to output a common look but how can you complain when the code is wrong?

 

I think quirks mode ( generically ) does a simply amazing job of showing a site in some semblance of order even though the writer of the html couldn't even be bothered to nest the html tags correctly .. just goes to show how clever the browsers are these days. Doesn't mean it is a good professional job just because the browsers have the skill to convert bad code into looking ok however.

 

It takes only a small amount of care and attention to write valid code that is nicely indented and easy to read.

 

The benefits are: -

 

  • The site has a good initial chance of looking the same in different browsers ( we all know there are some professional tweeks needed for certain browsers, but of course decent web designers will know this )
  • The owner of the finished code can check their site in the W3C validator and see the nice green valid text proving good code.
  • The nicely indented code is easy to read and nested tags easy to follow.
  • It loads quicker for the user ( quirks mode takes time ).
  • If changes are made to the site it can be run through the validator which will immediately highlight any errors. ( try this when there are already loads of errors )
  • Changes to the site code are easier because the nested tags are easy to follow.

It gets a lot worse when these web monkeys get their hands on PHP code. Being a loosely typed language PHP can be very badly used ( less so now with register_globals gone ) when the same lack of care web monkeys put into their html is brought into PHP code then all sorts of horrors can occur, you'll see the hack messages all over the forum.

 

Write good code .. it takes a tiny bit longer but repays you many times, if someone says "it doesn't matter" ... well ... take your own position on this, mine is obvious.

Link to comment
Share on other sites

Nuttin wrong with monkeys. I've used one as my Avatar for over 10 years :thumbsup:

 

Most people who run shops simply want something that works. What the underlying code looks like does not matter to them.

 

That said, I really hate working with some peoples contributions, some are not great. I look back at some of mine in the last 10 years and see the same awful mistakes - so 5 or 10 years down the road, these beginners will be writing more decent code.

Link to comment
Share on other sites

Most people who run shops simply want something that works. What the underlying code looks like does not matter to them.

 

Of course this is true and it is why writers of terrible code get away with charging people and also why their sites get hacked.

 

That said, I really hate working with some peoples contributions, some are not great. I look back at some of mine in the last 10 years and see the same awful mistakes - so 5 or 10 years down the road, these beginners will be writing more decent code.

 

 

This comment made me realise that I hadn't "directed" correctly. My comments were aimed in the main at those making money supplying bad code to customers, but also to a lesser extent to authors of contributions.

 

The post was most certainly not aimed at those who are setting out and learning.

Note: I couldn't use quotes as the forum is trashed.

Link to comment
Share on other sites

This comment made me realise that I hadn't "directed" correctly. My comments were aimed in the main at those making money supplying bad code to customers, but also to a lesser extent to authors of contributions.

 

And yet, each and every day I see people here wanting help with those badly coded bits and pieces - rather than be told "go to who you bought it from and complain".

 

Without those poor misguided buyers making an effort at telling the people who made money from them, the circle of bad code continues. This is the precise reason why I ALWAYS tell Template Monster users to "seek support from the vendor" - other helpers here might want to take note :-"

Link to comment
Share on other sites

This is the precise reason why I ALWAYS tell Template Monster users to "seek support from the vendor" - other helpers here might want to take note

 

Now I simply can't imagine where that was directed :D

Link to comment
Share on other sites

I like to see good code. I am an electrician by trade and accuracy can mean life or death in my trade. Having recently started a website, I am starting to understand some parts of PHP. When I first started, it was like reading Greek, but now, I can see what certain areas of code produce. I cannot write alot from scratch but I have adapted some code to suit my needs. I have produced a contribution, enable/disable manufacturers but at present have not released it (as I do not feel able to support it)(It heavily resembles enable/disable categories).In my experience with contributions, I would say that there is a lot of poor (maybe old) code within the admin contributions. I run with STRICT in both sides of shop. Having spent hours trawling the net, my site runs 100% error free on both catalog and admin. Whether I have solved the issues correctly, I do not know, but everything operates correctly and quickly.

 

I am looking forward to the day, when I can write PHP code from scratch.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...