English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

4 answers

I am assuming you mean in CSS.

The biggest advantage is if you 1,000,000 web pages that have the same class from an external stylesheet, you can change the properties of that class, in only one line of code. All 1,000,000 pages will change fonts, colors, margins, borders, or anything else.

Also, the big advantage in CSS is completely seperating style from content, so the content can be used in different context, and the code is easy to read.

2006-09-10 15:58:59 · answer #1 · answered by LorettoBoy 4 · 0 0

Classes as in c++, php, javascript etc:

Classes usually make for better organization.
You write all the same functionality as in functional/linear programming, but wrap it up in a way that eliminates name scoping issues and provides - in many cases - considerably more flexibility.

Classes in most oo languages can enforce data hiding, which prevents people from mucking about with the internals of the class in dangerous ways.

It is also a lot easier to create and manage multiple instances of objects (be they buttons on a screen, characters in a game, or critters/machines in a simulation).

2006-09-10 23:09:40 · answer #2 · answered by sheeple_rancher 5 · 0 0

For low level programming, classes provide tools for constructing data structures with thier own special methods and properties.

Object oriented programming depends on having mulitple instances of an object to work with...

I know its brief, but hope it helps out

2006-09-10 23:08:40 · answer #3 · answered by rocketman33 2 · 0 0

- ease of modification. You make a change in one place, and all sub-classes inherit the change.

- data and methods are modeled together, instead of apart. So, you get consistency between data and methods.

2006-09-10 23:03:10 · answer #4 · answered by Crazy Eagle 3 · 0 0

fedest.com, questions and answers