Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

what is your definition of clean code?

by g00n (Hermit)
on Apr 23, 2003 at 03:43 UTC ( #252443=note: print w/replies, xml ) Need Help??

in reply to Re: Re: Cleanning HTML - New/better module for that - test please! ;-P
in thread Cleanning HTML - New/better module for that - test please! ;-P

tidy intro - When editing HTML it's easy to make mistakes. Wouldn't it be nice if there was a simple way to fix these mistakes automatically and tidy up sloppy editing into nicely layed out markup?

could you tell me what is your definition of clean the code? could you provide an example?

Replies are listed 'Best First'.
Re: what is your definition of clean code?
by tachyon (Chancellor) on Apr 23, 2003 at 04:35 UTC

    HTML Tidy is an excellent little widget for checking that HTML conforms to the W3C HTML spec and fixing errors as well a clening up indentation etc. It has nothing to do with Perl per se. As to examples there are many. For example Netscape/Mozilla is very particular about closing table tags. If you forget a </table> or have extra ones then really odd stuff will happen or the page will simply fail to display. To generate your own examples take some HTML, run it through tidy and RTFO where O = Output and the rest has the usual meaning.




Re: what is your definition of clean code?
by gmpassos (Priest) on Apr 23, 2003 at 05:03 UTC
    As I said, I want to clean the code, make it smaller (this is for the browser, not humans). The idea is to cut everything that not represent any visual thing in the browser and rewrite some parts/tags with less bytes, like cut quotes when is possible, spaces, etc...

    Example? Test the code of the main node with the url and see the result of cleaned code with the original.

    Graciliano M. P.
    "The creativity is the expression of the liberty".

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://252443]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2018-06-20 04:19 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (116 votes). Check out past polls.