Intro Download and install Frequently Asked Questions Tips and tricks

Homepage







© J.C. Kessels 2009
MyDefrag Forum
September 01, 2014, 09:59:12 pm *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: longer names for identifiers  (Read 5010 times)
elfring
JkDefrag Hero
*****
Posts: 114


View Profile
« on: September 25, 2007, 01:32:32 pm »

The C programming language does not support namespaces. The consequence is that all API designers must be very careful to avoid naming collisions.
Unfortunately, the source files for the JkDefrag library contain names that might collide with identifiers in other software modules.

Examples:
  • YES, NO
  • RUNNING, STOPPED
  • TreeFirst, TreeInsert
  • DefaultDebugMsg
I propose to choose a naming convention that will be a bit safer for further software development.
Logged
jeroen
Administrator
JkDefrag Hero
*****
Posts: 7220



View Profile WWW
« Reply #1 on: September 25, 2007, 05:55:11 pm »

The current names do not collide with any of the Microsoft libraries. That's good enough for me.
Logged
elfring
JkDefrag Hero
*****
Posts: 114


View Profile
« Reply #2 on: September 25, 2007, 06:46:07 pm »

I propose to lower the probability for name clashes even more. There are more software modules than only Microsoft ones available that want to cooperate with your library without unpleasant surprises.
Logged
elfring
JkDefrag Hero
*****
Posts: 114


View Profile
« Reply #3 on: October 05, 2007, 09:00:24 am »

The values "YES" and "NO" can be replaced by standard specifications "true" and "false" or completely avoided by shorter wording of predicates.

Some global variables and functions that are only used in a single translation unit can be hidden in unnamed namespaces.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.5 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!