Sze Chan

Advertisement

Code Formatting Tools

When you find your own JavaScript code is getting hard to read, because there are so many overwrapped lines and you don't have the time to indent it and pretty it up, it's time to start looking at Code Formatting Tools. Fortunately, there are some free tools available. No need to download a text editor, I have located some Online Tools to indent and format your code.

Tabifier

Tabifier is pretty awesome, the languages it supports are HTML, CSS, and C-like languages. Even if your C# code in on one line, Tabifier will indent it for you. Keep in mind, it is not a compiler/interpreter, and it does not check for proper syntax. A couple of things to keep note of: HTML, XHTML, and XML are a subset of SGML (Standard Generalized Markup Language), so feel free to paste in your XML. And if you thought JavaScript was forgotten, worry not, JavaScript has C-like syntax, just like Objective C, Java, C++, C#, and Perl.

HTML Tidy Online

HTML Tidy Online, modeled after the tool created by Dave Raggett, is a good tool for converting your dirty HTML into W3C XHTML 1.0 strict code, it indents HTML elements, inserts missing attributes and displays a side-by-side difference between your dirty code and the XHTML 1.0 strict code

JavaScript Tidy

JavaScript Tidy is a self-explanatory tool, just remember to remove your <script type="text/javascript">...</script> tags before tidying up. By the way, this

HTML Encoder

HTML Encoder is a good tool to have when you're writing about HTML in HTML. Try inserting <script type="text/javascript">...</script> into your document as-is, it won't work, you'll have to use &lt;script type=&quot;text/javascript&quot;&gt;...&lt;/script&gt;

CSSTidy

CSSTidy Lastly, is CSS Tidy. This tool offers more fine-grained controls over Tabifier for CSS Code. I have not used it much, but I am sure it will come in handy when I am creating CSS-heavy websites