Kryptix Posted February 2, 2012 Share Posted February 2, 2012 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? Quote Link to comment Share on other sites More sharing options...
AyKay47 Posted February 2, 2012 Share Posted February 2, 2012 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. Quote Link to comment Share on other sites More sharing options...
Kryptix Posted February 2, 2012 Author Share Posted February 2, 2012 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? Quote Link to comment Share on other sites More sharing options...
AyKay47 Posted February 2, 2012 Share Posted February 2, 2012 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? No, there's not. Quote Link to comment Share on other sites More sharing options...
trq Posted February 2, 2012 Share Posted February 2, 2012 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 {} Quote Link to comment Share on other sites More sharing options...
spiderwell Posted February 2, 2012 Share Posted February 2, 2012 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! Quote Link to comment Share on other sites More sharing options...
AyKay47 Posted February 2, 2012 Share Posted February 2, 2012 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. Quote Link to comment Share on other sites More sharing options...
haku Posted February 8, 2012 Share Posted February 8, 2012 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.