Jump to content

HTML5


Kryptix

Recommended Posts

So when trying to make websites fast, surely using short names for classes and what not is better than using long names?

 

So like instead of having a class called "right_container_column" it's best to just use a single letter?

 

Am I thinking right?

Link to comment
Share on other sites

These differences would be a miniscule amount of memory. In terms of optimizing a website, think query optimization, utilize functions instead of re-writing unnecessary code, utilize proper caching techniques. Things along these lines will make a much bigger difference where speed is concerned.

Link to comment
Share on other sites

I'm doing all those too but on a large site I'm sure the names add up to a few kB of data. If I can cope with using singular letter names there's no negatives in doing so, right?

 

There's the benefit of this "large site" being easier to maintain. Anser this, what do you think this css effects?

 

.r {}

Link to comment
Share on other sites

its harder to tell what the classes are without meaningful names, which is what i would rather do , and anyone who picks up my work would probably appreciate that too. 

 

Recently i have been using the OOCSS style and find it quite good for reuseable style sheets. however i then end up with a class="floatleft bold italic curvedborder" which is almost the opposite of what you want to acheive!

 

 

Link to comment
Share on other sites

Thorpe brings up a good point, maintainability of the site. It is a good practice to have meaningful names when choosing variables, PHP OOP class names, function names, CSS class names, etc.. This will help both you when you come back to your code a month later, and another programmer picking up your work. Bottom line here is, changing your class names will be much more of a hindrance then help. You will not notice a performance difference in any case.

Link to comment
Share on other sites

A kb is 1000 bytes - or 1000 characters as it were. In a single webpage, you *may* have a kb in class/id names if it's a really, really long page. But even that's doubtful. Using long class names is not going to slow down your site, unless each classname is a paragraph in length.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.