Re:Having fun abusing the C language
by chc on Tuesday October 25, 2016 @02:47PM
(#12790515)
What's the problem with typedef? It just names a new type rather than making things work differently than you'd expect.
[ Parent
| on HN ]
Re:Having fun abusing the C language
by hairy_man674 on Tuesday October 25, 2016 @03:18PM
(#12790817)
The main misuse, again this is opinion based, is that it hides (obscures) the type of variable. If you have (say) a very large struct containing several member variables and functions, a programmer can be misled into returning it from a function or declaring it on the stack.
Of course there are reasonable uses for it. Contrary, to the above you might use it to intentionally make an object opaque as a way of abstracting its details from users or when declaring use of int/long in code.