[riot-notifications] [RIOT] Replace all numeric constants by macros (#136)

Martin Lenders notifications at github.com
Thu Aug 15 20:15:35 CEST 2013


Sure single valued enums do not make sense. Even for double valued enums you should think twice if a boolean value would not be better, but especially for values of function parameters enums are the better choice (only surpassed by bit flags for multivalued stuff) because the compiler actually can check if the given value is legal or not.
TLDR: My rule of thumb always is: Flag value or some constant => Macro, function parameter value => if (possible values > 2) then enum else boolean arithmetics (0 one value, rest other value). 

---
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/issues/136#issuecomment-22718804
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20130815/dfae9996/attachment.html>


More information about the notifications mailing list