473,508 Members | 2,236 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Naming convention from my point of view

7 1505
"DEX" <I@ddmrm.com> wrote
Main page of my NC:
http://www.ddmrm.com/coding/cpp/nami...ming.main.html
Rules of my NC:
http://www.ddmrm.com/coding/cpp/nami...ing.rules.html

Comments are welcome. ...


I had no idea someone could come up with a naming scheme that's worse than
hungarian notation. That takes skill.

Claudio Puviani
Jul 22 '05 #2
"DEX" <I@ddmrm.com> wrote in news:c6************@ID-231885.news.uni-
berlin.de:
Main page of my NC:
http://www.ddmrm.com/coding/cpp/nami...ming.main.html
Rules of my NC:
http://www.ddmrm.com/coding/cpp/nami...ing.rules.html

Comments are welcome. ...


Are you a robot?
Jul 22 '05 #3
DEX wrote:
Main page of my NC:
http://www.ddmrm.com/coding/cpp/nami...ming.main.html
Rules of my NC:
http://www.ddmrm.com/coding/cpp/nami...ing.rules.html

Comments are welcome. ...


Your convention is scary. It's Hungarian notation on steroids.

Instead of:

GI_a-> F1vc_b( &Pi_c );

I would much rather see:

pConnection->receiveMessage(&localMessageBuffer);

Many C++ IDEs can tell me everything else at a glance, so
there's no need to clutter my otherwise sensible names with
obsufcated metadata that requires a decoder ring for a new
developer to even begin to grasp.

Just my $0.02.
Jul 22 '05 #4
On Tue, 20 Apr 2004 16:52:21 +0200, "DEX" <I@ddmrm.com> wrote in
comp.lang.c++:
Main page of my NC:
http://www.ddmrm.com/coding/cpp/nami...ming.main.html
Rules of my NC:
http://www.ddmrm.com/coding/cpp/nami...ing.rules.html

Comments are welcome. ...


Why should we care?

But my comment is, I don't like it.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html
Jul 22 '05 #5
DEX wrote:

Main page of my NC:
http://www.ddmrm.com/coding/cpp/nami...ming.main.html
Rules of my NC:
http://www.ddmrm.com/coding/cpp/nami...ing.rules.html

Comments are welcome. ...


You made me think of two things that I find quite important in
regards to naming:

0) The famous rule of uniformity.
Loosely put, things that look alike should behave alike; and
the other way around, things that look different should behave
differently. "Should" means "I expect them to".

Normally, when I say
ClassName obj;
obj.f(a+b);

I don't care about the types or constness of a and b, whether f() is
virtual or not or whether ClassName is actually the name of a class or a
typedef-specialisation of a class template, etc. I shouldn't care.
This is why any sort of a la Hungarian notation hinders me, not helps,
in understanding the code. Even "m_" for member variables is too much
and too ugly for me. One notable exception is "p_" before pointer
variable names; pointers are actually different to references in their
syntax and behaviour.

1) Name compactness or maximum of signal-to-noise ratio.
Any extra decoration that is not readily intelligible makes the name
harder to read and understand. The same goes for suffixing/postfixing
that is recongisable but superfluous. Most of it is just noise to me.
This doesn't sound like a big deal ("just ignore it"), but it is. It
takes away a huge amount of energy in the form of concentration.

Suffixing is still used for scoping in large projects, but C++ classes
and namespaces have greatly reduced the need for it.

Denis
Jul 22 '05 #6
Denis Remezov wrote:
DEX wrote:

Main page of my NC:
http://www.ddmrm.com/coding/cpp/nami...ming.main.html
Rules of my NC:
http://www.ddmrm.com/coding/cpp/nami...ing.rules.html

Comments are welcome. ...


You made me think of two things that I find quite important in
regards to naming:

0) The famous rule of uniformity.
Loosely put, things that look alike should behave alike; and
the other way around, things that look different should behave
differently. "Should" means "I expect them to".

Normally, when I say
ClassName obj;
obj.f(a+b);

I don't care about the types or constness of a and b, whether f() is
virtual or not or whether ClassName is actually the name of a class or a
typedef-specialisation of a class template, etc. I shouldn't care.
This is why any sort of a la Hungarian notation hinders me, not helps,
in understanding the code. Even "m_" for member variables is too much
and too ugly for me. One notable exception is "p_" before pointer
variable names; pointers are actually different to references in their
syntax and behaviour.

1) Name compactness or maximum of signal-to-noise ratio.
Any extra decoration that is not readily intelligible makes the name
harder to read and understand. The same goes for suffixing/postfixing
that is recongisable but superfluous. Most of it is just noise to me.
This doesn't sound like a big deal ("just ignore it"), but it is. It
takes away a huge amount of energy in the form of concentration.

Suffixing is still used for scoping in large projects, but C++ classes
and namespaces have greatly reduced the need for it.

Denis


I agree: prefixes and suffixes make code unreadable (I hate MS-Hungarian
notation). Library prefixes are better substituted with namespaces. I don't
even use p_ before pointers.

The only convention I try to follow and find pleasing resembles that of
Java:

-Capitalized Class Names
-lowercase variables and functions
-uppercase preprocessor macros and enums

Jul 22 '05 #7
DEX
Some of answers on your question/coments are on page:
http://www.ddmrm.com/coding/cpp/nami...aming.faq.html

some are on main page:
http://www.ddmrm.com/coding/cpp/nami...ming.main.html

dex

Jul 22 '05 #8

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

Similar topics

3
1428
by: C# Learner | last post by:
Why can't people abide by naming conventions?! It seems that most people have to have their /own/ custom convention.
4
7135
by: Mark Broadbent | last post by:
stupid question time again to most of you experts but this is something that continually bothers me. I am trying to get into the habit of naming variables and controls in an assembly as per...
14
3110
by: 42 | last post by:
Hi, Stupid question: I keep bumping into the desire to create classes and properties with the same name and the current favored naming conventions aren't automatically differentiating them......
11
4973
by: MP | last post by:
Hi, Coming from a vb6 background I am accustomed to prefixing variable names to indicate their usage. Now just beginning to try to learn database stuff I've been lurking here and working on my...
114
7732
by: Jonathan Wood | last post by:
I was just wondering what naming convention most of you use for class variables. Underscore, "m_" prefix, camel case, capitalized, etc? Has one style emerged as the most popular? Thanks for...
35
12130
by: Smithers | last post by:
Is it common practise to begin the name of form classes with "frm" (e.g., frmOneForm, frmAnotherForm). Or is that generally considered an outdated convention? If not "frm" what is a common or...
14
1522
by: Ronald S. Cook | last post by:
I've been weaning myself off of Hungarian notation because that's what Microsoft is telling me to do, and I want to be a good little MS developer. But things keep coming up that make me miss my...
9
7017
by: BillCo | last post by:
I'm coming from a MS Access background and so I'm very used to and comfortable with the hungarian (Leszynski et al) naming conventions. However, I'm getting started into my first SQL Server...
23
2407
by: Thorsten Kampe | last post by:
Okay, I hear you saying 'not another naming conventions thread'. I've read through Google and the 'naming conventions' threads were rather *spelling conventions* threads. I'm not interested...
0
7227
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7127
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
7331
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7391
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...
1
7054
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
5056
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3204
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3188
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
768
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.