Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When is it okay to create 'reserved' identifiers?

Tags:

c++

c

I figured one of the best ways I could learn and improve in programming is to look at various source codes. I was looking at Blender's source code and noticed something about the header files. Most of them used #ifndef include guards, where macros were surrounded by double underscores (e.g. __BMESH_CLASS_H__).

It got me thinking, the whole "just don't make anything that starts with underscores at all" advice is good for beginners, but I would think that in order to progress further in programming I should learn when creating my own reserved identifiers is and isn't appropriate.

like image 977
thepufferfish Avatar asked Dec 23 '22 18:12

thepufferfish


1 Answers

I would think that in order to progress further in programming I should learn when creating my own reserved identifiers is and isn't appropriate.

Reserved identifiers are reserved for the implementation, which means roughly the compiler, its runtime library, and maybe parts of the operating system.

So, it's appropriate to create your own when your progression has led to you writing your own compiler or operating system. That's pretty much it.

like image 93
Useless Avatar answered Jan 01 '23 22:01

Useless