473,395 Members | 1,624 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

coding standard

Is there an effort to unify the c++ coding standard? Especially
identifier naming.

Not a big issue but it would be annoying to have to incorporate
different coding styles simultaneously when using more than one library.
The standard library seems to have everything lower-cased while a lot of
other libraries do their own way.

Ben
Mar 31 '06 #1
13 2013
"benben" <be******@yahoo.com.au> wrote in message
news:44**********************@news.optusnet.com.au
Is there an effort to unify the c++ coding standard? Especially
identifier naming.


Sure. There are also efforts underway to color-coordinate programmers'
clothing and to make all ball-point pens the same size. Stay tuned for some
breakthroughs.

--
John Carson
Mar 31 '06 #2
"benben"
Is there an effort to unify the c++ coding standard? Especially identifier
naming.

Not a big issue but it would be annoying to have to incorporate different
coding styles simultaneously when using more than one library. The
standard library seems to have everything lower-cased while a lot of other
libraries do their own way.


It's an esthetic issue isn't it? The only successful control of esthetics I
know of was the clothing of citizen's in Communist China. Now, even that
has failed.

It annoys me too.
Mar 31 '06 #3
osmium wrote:
"benben"
Is there an effort to unify the c++ coding standard? Especially identifier
naming.

Not a big issue but it would be annoying to have to incorporate different
coding styles simultaneously when using more than one library. The
standard library seems to have everything lower-cased while a lot of other
libraries do their own way.


It's an esthetic issue isn't it? The only successful control of esthetics I
know of was the clothing of citizen's in Communist China. Now, even that
has failed.

It annoys me too.


"Control" is too strong a word...I would rather use "recommend". As I
said it is not really a big issue and I have accepted it for years, but
wouldn't it be more ideal if...

Regards,
Ben
Mar 31 '06 #4
benben wrote:
Is there an effort to unify the c++ coding standard? Especially identifier
naming.
As a Best Practice, a new member of a team should start writing in the
existing code's esthetic style. No more indenting {} just because everyone
else outdents them {}.
Not a big issue but it would be annoying to have to incorporate different
coding styles simultaneously when using more than one library. The
standard library seems to have everything lower-cased while a lot of other
libraries do their own way.


The book /Elements of C++ Style/ is a nice little guide to esthetic issues.
Things like CONSTANTS in all-caps.

And non-Standard libraries should _not_ emulate the C library style that the
C++ library derived from. (Caps were hard to type on ancient terminals;-)

--
Phlip
http://www.greencheese.org/ZeekLand <-- NOT a blog!!!
Mar 31 '06 #5

"benben" <be******@yahoo.com.au> wrote in message
news:44**********************@news.optusnet.com.au ...
Is there an effort to unify the c++ coding standard? Especially identifier
naming.

Not a big issue but it would be annoying to have to incorporate different
coding styles simultaneously when using more than one library. The
standard library seems to have everything lower-cased while a lot of other
libraries do their own way.

Ben


I hope not, because it seems that everyone has at least a _slightly_
different coding style. (And we all KNOW that my coding style is the only
proper one!) :-)

-Howard
Mar 31 '06 #6
In article <Vw*******************@newssvr30.news.prodigy.com> ,
"Phlip" <ph******@yahoo.com> wrote:
benben wrote:
Is there an effort to unify the c++ coding standard? Especially identifier
naming.


As a Best Practice, a new member of a team should start writing in the
existing code's esthetic style. No more indenting {} just because everyone
else outdents them {}.
Not a big issue but it would be annoying to have to incorporate different
coding styles simultaneously when using more than one library. The
standard library seems to have everything lower-cased while a lot of other
libraries do their own way.


The book /Elements of C++ Style/ is a nice little guide to esthetic issues.
Things like CONSTANTS in all-caps.

And non-Standard libraries should _not_ emulate the C library style that the
C++ library derived from. (Caps were hard to type on ancient terminals;-)


Actually, it's kind of nice that each library uses a different style. I
know what library the function belongs to just by looking at the style.
:-)

A better reason not to use the same style as the standard library. Name
collisions...
--
Magic depends on tradition and belief. It does not welcome observation,
nor does it profit by experiment. On the other hand, science is based
on experience; it is open to correction by observation and experiment.
Mar 31 '06 #7

Daniel T. wrote:
In article <Vw*******************@newssvr30.news.prodigy.com> ,
"Phlip" <ph******@yahoo.com> wrote:
And non-Standard libraries should _not_ emulate the C library style that the
C++ library derived from. (Caps were hard to type on ancient terminals;-)


Actually, it's kind of nice that each library uses a different style. I
know what library the function belongs to just by looking at the style.
:-)

A better reason not to use the same style as the standard library. Name
collisions...


Given the choice, I write code in the same style as the standard
library - after all it is the most beautiful. Capital letters are an
aberration :-)

But more seriously, while I happen to like the same style, I don't
write code in the std namespace. Code I want others to use will be in
its own namespace. I consider that sufficient protection against name
clashes (that being the purpose of namespaces). Why would it not be?
Are you only worried about clients who abuse using declarations and
directives, or is there something else?

Gavin Deane

Mar 31 '06 #8

benben wrote:
Is there an effort to unify the c++ coding standard? Especially
identifier naming.

Not a big issue but it would be annoying to have to incorporate
different coding styles simultaneously when using more than one library.
The standard library seems to have everything lower-cased while a lot of
other libraries do their own way.


Read recommendation #1 of Sutter and Andrescu.

Mar 31 '06 #9
Howard wrote:
I hope not, because it seems that everyone has at least a slightly
different coding style.Â*Â*(AndÂ*weÂ*allÂ*KNOWÂ*thatÂ*myÂ*codingÂ*s tyleÂ*isÂ*theÂ*only
proper one!) :-)


Teamwork is very important in programming. Nobody should "mark their
territory" in code, and the ideal situation is where nobody can tell who
wrote what code just by looking at it.

--
Phlip
http://www.greencheese.org/ZeekLand <-- NOT a blog!!!
Mar 31 '06 #10
> Given the choice, I write code in the same style as the standard
library - after all it is the most beautiful. Capital letters are an
aberration :-)


Some people may think the same. As for me, it doesn't really matter.
What bothers me is the inconsistency.

Regards,
Ben
Apr 1 '06 #11
Howard wrote:
"benben" <be******@yahoo.com.au> wrote in message
news:44**********************@news.optusnet.com.au ...
Is there an effort to unify the c++ coding standard? Especially identifier
naming.

Not a big issue but it would be annoying to have to incorporate different
coding styles simultaneously when using more than one library. The
standard library seems to have everything lower-cased while a lot of other
libraries do their own way.

Ben


I hope not, because it seems that everyone has at least a _slightly_
different coding style. (And we all KNOW that my coding style is the only
proper one!) :-)

-Howard


I might not have made myself very clear in my post. And let me clarify.

I don't mind different styles--that's how you learn from other people.
But, no matter what style you are coding in, it must be consistent. That
is, you follow a certain rule, whatever it is, to name identifiers and
format your code throughout.

But this is very difficult because you eventually may have to use some
libraries that follow different styles. It is not the coding style as a
whole that is troublesome, but the way the public interface is named and
formatted can be significant.

What is in my mind is that perhaps we should (would) at least name our
public interface in a consistent way with other libraries so when more
than one libraries are used the user would at least have consistent user
code.

And you can still keep your personality in your local code as long as it
is not in the public interface. This is more than just pure aesthetics.
It is more about readability.

Regards,
Ben
Apr 1 '06 #12
> Actually, it's kind of nice that each library uses a different style. I
know what library the function belongs to just by looking at the style.
:-)
Sometimes. But when two libraries have similar functions I am quite
reluctant to rely on "style" for disambiguation (for me, not for the
compiler of course.) A better qualified name is more explicit and readable.

A better reason not to use the same style as the standard library. Name
collisions...


There is actually a reason why names collide. After all, they mostly
stand for some more subtle problems, don't they. Again, instead of
relying on styles for preventing name collision it is far better to just
use namespace to qualify them, so that when you read the code, you know
exactly which library it is about.

Regards,
Ben
Apr 1 '06 #13
"benben" <be******@yahoo.com.au> wrote in message
news:44***********************@news.optusnet.com.a u...
Actually, it's kind of nice that each library uses a different style. I
know what library the function belongs to just by looking at the style.
:-)
Sometimes. But when two libraries have similar functions I am quite
reluctant to rely on "style" for disambiguation (for me, not for the
compiler of course.) A better qualified name is more explicit and
readable.

A better reason not to use the same style as the standard library. Name
collisions...


There is actually a reason why names collide. After all, they mostly stand
for some more subtle problems, don't they.


Huh?
Again, instead of relying
on styles for preventing name collision it is far better to just use
namespace to qualify them, so that when you read the code, you know
exactly which library it is about.


That works fine for everything but macro names.

P.J. Plauger
Dinkumware, Ltd.
http://www.dinkumware.com
Apr 1 '06 #14

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Mikkel christensen | last post by:
Hi there I wonder if any of you could point me in a direction where I can find some usefull information about coding standarts. I have some generel experiense in programming but I lack many...
144
by: Natt Serrasalmus | last post by:
After years of operating without any coding standards whatsoever, the company that I recently started working for has decided that it might be a good idea to have some. I'm involved in this...
50
by: Konrad Palczynski | last post by:
I am looking for tool to validate conformity to defined coding standard. I have already found Parasoft's C++ Test, but it is quite expensive. Is there any Open Source alternative? I do not need...
7
by: Robert Seacord | last post by:
The CERT/CC has just deployed a new web site dedicated to developing secure coding standards for the C programming language, C++, and eventually other programming language. We have already...
4
by: steven.sagerian | last post by:
Can anyone suggest a good off the shelf coding standard for embedded real time applications? Thanks, Steve
0
by: pat | last post by:
CodeCheck Coding Standard's Support As a free service to our customers we offer support in developing "rule-files" for automating corporate coding standards. If you have a coding standard that...
8
by: =?ISO-8859-1?Q?Arnaud_Carr=E9?= | last post by:
Hi all, I guess you all know how difficult it is to choose a conding standard. And even more difficult it is to explain the choice to your dev team :-) I'm looking for an "official" c++ coding...
19
by: auratius | last post by:
http://www.auratius.co.za/CSharpCodingStandards.html Complete CSharp Coding Standards 1. Naming Conventions and Styles 2. Coding Practices 3. Project Settings and Project Structure 4....
9
by: dom.k.black | last post by:
Can anyone recommend a good existing C++ coding standard - parctical, pragmatic and sensible? A company I joined recently are moving from C to C++, they are very much into coding standards. But...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.