News for hackers. Stuff that matters.
Re:Get rid of boolean function parameters by paulmd on Monday June 15, 2015 @10:35AM (#9719533)
I'll say that I do that (define constants to variables/consts/#DEFINE/etc and then use them as arguments), and I do it for exactly the reasons you describe. I also try to make magic numbers as self-explanatory as possible - rather than (say) use the number 84600 I'll write 60 * 60 * 24 for when I want the number of seconds per day.

It's way easier to remember what's going on when you come back a year later, and all but the simplest compilers will be smart enough to bash it down to constant parameters if that's possible.

Yeah, more lines of code, but I think readability trumps terseness (within reason). Some functions just use a bunch of parameters and it's not really the extra line to name the parameter that's causing the issue. Also if you're using an editor that does code folding you could just fold that block away.

Re:Get rid of boolean function parameters by chrisheller on Monday June 15, 2015 @10:50AM (#9719658)
I'm not sure if the transposition was intended, but your comment shows another reason why using a calculated value here is good.