Welcome, Guest. Please login or register.

Author Topic: Naming conventions and type definition  (Read 1030 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Mr_CapehillTopic starter

  • Full Member
  • ***
  • Join Date: May 2002
  • Posts: 189
    • Show only replies by Mr_Capehill
Naming conventions and type definition
« on: May 13, 2004, 02:12:47 PM »
Hello, I'm starting a cross-platform project and wondering what kind of naming convention I should go for. I think that Hungarian notation is an ugly overkill solution for me. Also: do you begin member functions with a capital letter? Class name with 'C'?

Another problem is deciding if I should use my own types for int, float etc...Any good suggestions here?

Thanks...
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16867
  • Country: gb
  • Thanked: 4 times
    • Show only replies by Karlos
Re: Naming conventions and type definition
« Reply #1 on: May 13, 2004, 02:30:22 PM »
I use the UML style (as used in java).

Capital letter for the beginning of each word in the name of a class or struct, eg: "MyClassName".

All class members have lowercase first word then upper for every following one, eg "myMethodName(), myVariable"

All constants are uppercase.

All elemental types (and in C/C++ typedefs thereof) are lowercase, eg "int32, uint32".

AmigaOS has its own standards for stuff, but my code always sits a layer above so I never see it outside of some implementation.
int p; // A