₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,324,999 members, 8,419,864 topics. Date: Thursday, 04 June 2026 at 04:53 AM

Toggle theme

Object Oriented CSS [Bad Practice Or Not]? - Webmasters - Nairaland

Nairaland ForumScience/TechnologyWebmastersObject Oriented CSS [Bad Practice Or Not]? (1519 Views)

1 Reply (Go Down)

Object Oriented CSS [Bad Practice Or Not]? by Nobody: 4:54pm On Nov 21, 2009
Hi everyone,my passions lies in styling themes like themeforest, or nettuts or some of those you see in wordpress,so i love creating templates everyday just to prove nigerian sites can be equally good.the dilemma is i find myself spending more time creating too much location based specific selectors e.g #contain #sub-container and these practice frustrates me cuz i have to create individual settings for each element,till i stumbled upon OOCSS, which encourages uses of multiple class each class possesses a specific certain and can be applied on any element calling it e.g <div class"left border color padding width"> which has allowed me to create templates with ease, but i read on the net that it's bad practice and not Semantic (whatever that means). does that mean that feature xhtml standards won,t allow these.thanks for your reply.pls no bashing wink
Re: Object Oriented CSS [Bad Practice Or Not]? by yawatide(f): 7:03pm On Nov 21, 2009
I think you first need to ask yourself what OOCSS is.   Therein will lie your answer.

Here is how I define OOCSS: modular and abstracted.  IMHO, what I think you are talking about is reuse.  After doing so many sites myself, all my sites have the same css rules, IDs, CLASSes, and properties.  All I change in each case are the values associated with each rule (so on site A, #nav could be blue but on site B, #nav could be red).

Let's say I have a large application (for example, the union bank site).  Rather than pump all the styles into one big stylesheet, I can split them up, based on application (for example, loans.css, main.css, onlinebanking.css).  That way, at the most, there are 2 files being called at a time (as opposed to styles for all 3 being called everytime).  Sure you could say that it will be cached after the first time but why risk a slow download.

Another way of looking at it is, having a parent css with imports to the other stylesheets.  So again, you have 1 parent file with say, 3 child files.  Again, the concept is the same.

So based on how I define OOCSS, I see no reason why it is a bad thing.  Of course, others are fee to opine.

By the way, stop double-posting wink
Re: Object Oriented CSS [Bad Practice Or Not]? by Nobody: 7:21pm On Nov 21, 2009
Double posting.I got three words for you(bad internet connection).Actually i saw the article over the web that's what it was called.
Re: Object Oriented CSS [Bad Practice Or Not]? by DualCore1: 7:53pm On Nov 21, 2009
I do not see how Object Oriented approach (in any programming/scripting language) can be seen as bad practice.
PC Guru, what reasons were given as to why its a bad practice?
Re: Object Oriented CSS [Bad Practice Or Not]? by Nobody: 8:19pm On Nov 21, 2009
Going through the history to retrieve the page.It said something bout not being semantic.Trust me i don't know what that means.also dual core couldn't help notice your root@, Did you attend command ikeja.Will link the page when i see it.
Re: Object Oriented CSS [Bad Practice Or Not]? by yawatide(f): 1:46am On Nov 22, 2009
Just cos one article says it's bad doesn't mean you should take its word for it. I would do a google for pros and cons and draw my own conclusions.
Re: Object Oriented CSS [Bad Practice Or Not]? by DualCore1: 5:55am On Nov 22, 2009
pc guru:
also dual core couldn't help notice your root@, Did you attend command ikeja.Will link the page when i see it.
No, why? The name? Erm. . . big family and most are in lagos.
Re: Object Oriented CSS [Bad Practice Or Not]? by Nobody: 8:32am On Nov 22, 2009
Sorry thought you were someone i know.@yawa okay that be cool.
Re: Object Oriented CSS [Bad Practice Or Not]? by hostmot(f): 8:55am On Nov 24, 2009
It is not a bad practice.

Web elitists just don't like the fact that you can use multiple classes for a single element.

You will love this thing especially when you are trying to develop an interface for a web application. It also helps with good usage of css sprites and all,

If it improves your productivity and work flow, by all means, use it!

Olawunmi,
Sales Rep., Hostmot (www.hostmot.com)
1 Reply

Fundamentals Of All Object Oriented Programming(oop) LanguagesA Beginners Guide To Object-oriented Programming (OOP) In PHP 5+Procedural Vs Object Oriented PHP234

Google To Shut Down Its Orkut Social Network Today:)Please, Someone Should Suggest A Good Webdevelopment Company Or Individualto Me.