Ezilon.com - Target Your Audience, be Seen in Your Region

Do you Tidy your code?

You are viewing this site as a guest. Join our community to get your questions answered and share knowledge. Active members may advertise and ask for a website critique.

He has: 335 posts

Joined: May 2007

One tool I use on a regular basis is HTML Tidy, whether working on my own code or someone else's. It is available on all platforms, both as a command line tool or a GUI, and is built into many HTML editors. There are even online versions.

It fixes up many coding errors, can convert from ASCII to UTF-8 and back, fixes incorrect URLs, and loads of other helpful things. Yet most coders I speak to have never heard of it.

Do you Tidy your code?

Cordially, David
--
"Old web developers don't die, they degrade gracefully..."

They have: 10 posts

Joined: Jun 2008

If I'm not mistaken the W3 validators are (partially) based on Tidy, so I guess most of us uses it even if we don't know. The only difference is that in the validators' case it throws a warning, doesn't try to fix anything.

Megan's picture
Administrator

She has: 10,288 posts

Joined: Jun 1999

I've heard of it but never really felt the need to use it, basically because I feel my code is good enough as it is. I guess I should give it a try and see what kind of changes it makes...

He has: 579 posts

Joined: Jul 2005

The editor I use actually has HTML Tidy built in, so every now and then I'll run it just to see what happens, but for the most part I have decent code, so it's not necessary.

It's a helpful tool to have built in to my editor though for more complex pages, just to be sure I have all my closing tags and everything. Smiling

-Kurtis
~View (and vote for) my art at BrickFish!

decibel.places's picture

They have: 668 posts

Joined: Jun 2008

About 7 years ago I had an editor with Tidy that would mangle any file I gave it.

Guess the current version is better.

But I just try to write good code, sometimes I check in the FFox cconsole for errors.

He has: 335 posts

Joined: May 2007

methode wrote:

If I'm not mistaken the W3 validators are (partially) based on Tidy

The validators check against the DTD you give in your DOCTYPE - Tidy will suggest a DOCTYPE if you don't have one. Two very different tools for different purposes.

decibel.places wrote:

About 7 years ago I had an editor with Tidy that would mangle any file I gave it.

Perhaps the settings were wrong. Tidy has a whole slew of options, such as getting rid of Word's HTML cruft, converting to XML, formatting the output any which way, and so on.

I imagine it's the sheer range of options that puts people off using it, as it take a while to get all the options to suit your needs.

Cordially, David
--
"Old web developers don't die, they degrade gracefully..."