Using all CPAITAL letters for variable names

A

arnuld

I use capital letters for macros only. Is it a good idea
to use all capitals for things like constant variables and variables and
array in global namespace ?
 
N

Nick Keighley

I use capital letters for macros only.

that was the original, and still widely used, convention
it is to draw attention to the fact that "something funny"
may happen because the preprocessor is involved.

*Some* people also capitalise enum values. I suppose
because the are "like" macro constants.
Is it a good idea
to use all capitals for things like constant variables and  variables and
array in global namespace ?

IMHO, no

but then you shouldn't have many variables in the global namespace...


--
Nick Keighley

Many astrologers think that this concentration on [the sun-sign
column] has
done untold damage to serious astrology.
The Independent
 
V

vippstar

I use capital letters for macros only. Is it a good idea
to use all capitals for things like constant variables and variables and
array in global namespace ?

If it's *your* C project, you write the specification, and you can
make it a good idea.
If it's someone elses project, you read his/her specification, and you
figure out whether they like it or not.
C doesn't say anything about it (thus such question might be off-
topic)
Though there's things to look out for when choosing names: E?*
(where ? is a digit or capital) are reserved identifiers.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,021
Latest member
AkilahJaim

Latest Threads

Top