Named Constants [was Re: A problem for "fluid design" experts.}



In a separate thread Beauregard T. Shagnasty wrote:
More for you to think about: CSS class names of .grey, .white, .yellow
are poor choices of names. What if you want to change the color from
grey to, say, light blue?

.grey {
color: #add8e6; ...

So: <p class="grey"> means "light blue" ...

My background is computer programming and it is accepted practice to
define constants. I might define Pi or Monday, not because I may
decide to change the ratio of a circle's circumference to its diameter
or Monday's position in the week, but because the name makes my code
easier to read than the corresponding number.

By convention, some computer languages demand a different
capitalisation for named constants so, for example, the constant
"grey" should be "GREY". Is there a similar convention for CSS/HTML or
are you arguing that named constants should not be used?

For the purpose of this discussion please ignore the fact that "white"
is already a named constant in HTML so, for that reason alone, it was
a bad choice for the name of my constant.
.



Relevant Pages