4 ms·
Next time you write some code, try this: #define ONE 1 #define TWO 2 #define THREE 3 ... etc. Then use the words in place of integers wherever you need them.
by drcube 14y ago
Next time you write some code, try this:
#define ONE 1
#define TWO 2
#define THREE 3
...
etc.
Then use the words in place of integers wherever you need them. Hell, mix and match. And tell me if you are just as productive as you would be sticking with the regular integers you know and love.
- MartinCron 14y agoI think that wouldn't be a meaningful bottleneck on my productivity. But I could be wrong.
- jff 14y agox = ONETHREEZEROEIGHT;
- jeremyarussell 14y agoThat seems like a bad comparison, writing out multiple digits in place of a single digit should ALWAYS be less efficient.
- kylek 14y agoAgree....wouldn't having more language for these things make it MORE efficient? I'm down for a symbol for pi/2 (tau/4)!
- Groxx 14y agoSure. And in return, you can't use constants, but must instead type out 3.141592653... to whatever decimal place you deem important. Nor typedefs. Nor named flags (`FileRead | FileWrite` is just long-hand for `3`). At the end of the day we'll see who's pulling their hair more. Then we'll go back in a couple weeks, and look at the same code again. Mine's wordy. Yours is cryptic, and requires looking up the use of everything.