Quote:Original post by SneftelQuote:Original post by Rydinare
Of course what took the cake was when I saw an STL-like linked list class implemented as a single macro back at my prior company. Pretty brutal.
That's long been a common C idiom, actually. Gives tighter code than void*, and actual type-safety. Terrifying to have to work with, of course. The existence of that idiom is pretty much the reason templates exist.
Oh sure, I hear you on that. It actually wasn't so bad until I had to debug in it. At that point, I was ready to cry (well, not literally). [smile]
The scary part was is that I don't think it was legacy. I think it was just one developer on that project wasn't aware of templates. There were other things like that that were done with templates by other developers, so might just've been that guy.
Hmm, of course I've seen much scarier things in code, but that's a story for another day. [grin]