2 ms·
Hiding pointer behind a typedef is a terrible idea (like non-const reference arguments in C++). You never know if something you pass into functions could be mod
by kgabis 9y ago
Hiding pointer behind a typedef is a terrible idea (like non-const reference arguments in C++). You never know if something you pass into functions could be modified by them or not. I'd much rather change every place in code where set was used than deal with code that hides such important information.
- yawaramin 9y agoHa, I knew someone would say this ;-) You never know, that is, unless you just follow the type to its declaration and find out in like a couple of seconds. A modern IDE should just show the typedef on hover.
- Too 9y agoWith that argument you might as well redeclare everything with unexpected macros, your ide will do macro expansion on hover anyway. Or why write descriptive function names at all? Ctrl-click to view the implementation of the function is just one click away... Typedef pointer is a huge anti pattern.