Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Generic programming in C

Name: Anonymous 2012-01-12 3:49

I love C so much, and I really want to hate sepples, but I can't help but think that generic programming in C is shit! Macros are no good for generic data structures, as they are clunky and blow out code size, nor are void pointers, as you need to allocate separate memory just to store an integer (don't stuff ints into pointers; zeros won't work on architectures where the null pointer constant is non-zero). I really want to write my data structure library in sepples, where templates allow type genericism without issue. What should I do, /prague/; what should I do?!

Name: Anonymous 2012-01-12 11:56

So use C++ then, and pick and choose your style of programming. C++ doesn't really remove anything of value from C, and it adds a ton of features, at least a handful of which you may find useful. Also, it's a hell of a lot safer than these posts:

>>14
>>15

There's no real benefit to using C over C++ except for a slight performance boost (which really is only slight), it's just that C programmers hate C++ programming practices, which you don't have to use (it's just that C++ programmers consider them safer than the C alternative, which is >>14-15)

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List