Hacker News new | ask | show | jobs
by spc476 3353 days ago
I had that same problem. I wrote a C library [1] that has a structure field named "class". It's "class" because the protocol being described (DNS) calls that particular field "class" [2]. And I'm not about to pay lip service to an abomination like C++ [3][4].

[1] https://github.com/spc476/SPCDNS

[2] https://github.com/spc476/SPCDNS/blob/ca5052c3d0c3252071a18e...

[3] I am NOT a fan of C++.

[4] But I had to anyway, but I used the C pre-processor to rename the field.

1 comments

Yeah I super hate this. There's no other language that requires other languages to contort themselves like C++ does. Every time I see `#ifdef __cplusplus` or `klass` my blood pressure spikes.