Mixed case?

S

s0suk3

I'm totally new to C, so this is a question from a total newbie. I
know most people write the names in C with underscores,
as_in_this_name. But... is it also customary to write them in mixed
case, asWithThisName? Or is it a horrible horrible horrible thing to
do??
 
F

fnegroni

I'm totally new to C, so this is a question from a total newbie. I
know most people write the names in C with underscores,
as_in_this_name. But... is it also customary to write them in mixed
case, asWithThisName? Or is it a horrible horrible horrible thing to
do??

IMHO, it is a horrible thing to do. Unless you are german... ;-)
 
J

John Bode

I'm totally new to C, so this is a question from a total newbie. I
know most people write the names in C with underscores,
as_in_this_name. But... is it also customary to write them in mixed
case, asWithThisName? Or is it a horrible horrible horrible thing to
do??

There's no *technical* issue with using mixed case, and it appears to
be the more popular style where I've worked; I prefer it myself (more
natural typing than adding a bunch of underscores).
 
D

Default User

I'm totally new to C, so this is a question from a total newbie. I
know most people write the names in C with underscores,
as_in_this_name. But... is it also customary to write them in mixed
case, asWithThisName? Or is it a horrible horrible horrible thing to
do??

So-called "camel-case" isn't as traditional in C. I've seen in more
often in C++. That being said, when I worked on a major project at my
company in the mid-90s, the coding standard mandated camel-case rather
than underscores. It doesn't really matter to me in writing or reading
code which one is used. It's another case where consistency is probably
more important.



Brian
 
B

Ben Pfaff

I'm totally new to C, so this is a question from a total newbie. I
know most people write the names in C with underscores,
as_in_this_name. But... is it also customary to write them in mixed
case, asWithThisName? Or is it a horrible horrible horrible thing to
do??

It's a personal preference issue. If you are working within an
existing collection of code that uses a given convention, then I
would advise sticking with that convention. If you are writing
your own code, then you can choose the convention that you
prefer.
 
D

Default User

Mark McIntyre wrote:

CamelCase seems to have come from the C++ / Microsoft world in the
last decade or so. When I began programming, you
justwrotewithoutspaces and if you couldn't read them you were a wuss.
I've seen_AllSorts of lpszStupidConventions over the years tho.


Well, in the old days you kept all those identifiers nice and short. If
people couldn't figure out what adjxref meant, then they weren't paying
attention. And that was the functions. Variables rarely needed to be
over three characters in length. "num" and "len" were good enough for
the pioneers, after all.






Brian
 
S

santiago538

- Most Of All: Do NOT!!! perpetuate that so-called
"Hungarian notation" abomination, a reasonable idea
that was twisted into a psychotic nightmare by weak-
brained enthusiasts.

Hear hear!

My previous job required Hungarian notation for all code, not just C,
but Java as well--which is even more ridiculous as Java is strongly
typed.
 

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

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,906
Latest member
SkinfixSkintag

Latest Threads

Top