U
U
Urukhayy2015-06-21 07:55:33
Programming
Urukhayy, 2015-06-21 07:55:33

Is it normal to have #define set in code instead of magic numbers?

Is it normal to have a great many #define in the code instead of magic numbers?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Roman Kitaev, 2015-06-21
@Urukhayy

Unless it's
#define PI 3.1415
And not
#define SOME_MAGIC_CONSTANT 3.1415

J
jackroll, 2015-06-21
@jackroll

The main thing is that the code is readable.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question