x.begin(), x.end()

Started by
20 comments, last by Telastyn 15 years, 9 months ago
Quote:Original post by Sneftel
Quote: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]
Advertisement
Quote:Original post by Zahlman
Quote:Original post by Telastyn
I'd not actually seen it, but at a company I used to work for the word was that the entirety of the intrusion detection engine was written in macro. It took about 8 hours to build and by all accounts, inscrutable. (but very, very, very fast)


"intrusion detection engine"?


The software was network intrusion detection. It would monitor a stream of network traffic, and toss flags if the traffic was 'bad'. Most systems just use some signature engine or state machine to process the traffic. This one used a heuristic process, but the goal is the same:

a bit of code to process 1GB/s of network traffic and trigger some event if a remote exploit or similarly malicious bit of traffic is seen.

This topic is closed to new replies.

Advertisement