SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Thread: Cleaning Code

  1. #1
    SitePoint Zealot LAMA's Avatar
    Join Date
    Apr 2004
    Location
    Orlando Florida
    Posts
    134
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Cleaning Code

    Not really sure if this is the right topic to put this into, but I was wondering all over I see 'you should clean up your code', 'it will load faster if you clean it up'. I was just wondering how do you go about 'cleaning your code' and does it actually make the page load faster?
    My Designs Velocity Designs
    My Newest Creation Skin & Bone

  2. #2
    SitePoint Enthusiast soltek's Avatar
    Join Date
    Apr 2004
    Location
    nnowhere
    Posts
    80
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Makes no difference if you mean the visual formatting of the code. Howeer if you mean removing duplicate tags and improperly nested tags your absolutely correct.

  3. #3
    SitePoint Enthusiast Ricky's Avatar
    Join Date
    Jan 2004
    Location
    Unknown
    Posts
    54
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi!


    Since HTML and other web building codes are instructions for web browsers for how to display a webpage, there shouldn't be any useless or non standard elements in your codes. The more you have of them, the more heavy your page is and the more slowly it will load. Indeed, Clean web coding makes faster load.

    You can be sure you respect the w3c standard by validating your pages here

    Hope this helps


    Ricky

  4. #4
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by LAMA
    Not really sure if this is the right topic to put this into, but I was wondering all over I see 'you should clean up your code', 'it will load faster if you clean it up'. I was just wondering how do you go about 'cleaning your code' and does it actually make the page load faster?
    When somebody says "clean up code" it probably means that the code is a mess and there are a lot of tags that aren't really doing anything. Example:
    HTML Code:
    <table width="100%" border="0" cellpadding="10" cellspacing="0">
    <tr>
    <td width="100%">
    <font face="Verdana"><font size="3"><font color="red"><b>Hello</b></font></font></font>
    </td>
    </tr>
    </table>
    This is obviously a bad example, but bear with me.
    That code above can easily be translated into something like this:
    HTML Code:
    <div style="padding: 10px; font: bold 15px Verdana, Arial, Helvetica, sans-serif; color: red;">Hello</div>
    There is far less code in the second example than in the first even though they both give the same effect. Doing this will make your file size that much smaller. Smaller file sizes = faster loading pages.

  5. #5
    SitePoint Enthusiast soltek's Avatar
    Join Date
    Apr 2004
    Location
    nnowhere
    Posts
    80
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for clarifying this garcia.

    We also need your help here.....people can be quite simple minded sometimes..

    http://www.sitepoint.com/forums/showthread.php?t=165194


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •