News for hackers. Stuff that matters.
Re:Function overloading in C by halosghost on Sunday July 26, 2015 @01:57PM (#9951709)
C++ is not just a newer version of C with newer features. It is a completely disparate language. That's not a bad thing (tradition is not always good), but to say that if you want generics, you should just leave C behind is a little misguided.
Re:Function overloading in C by ectoplasm on Sunday July 26, 2015 @02:20PM (#9951767)
With a couple of minor exceptions, C++ is a superset of C.
Re:Function overloading in C by halosghost on Sunday July 26, 2015 @05:00PM (#9952184)
It's not just a couple. There are a large variety of things in C that Cxx does not support at all (e.g., VLAs and _Generic), and many more things that, though they are in both languages behave very differently (e.g., sizeof).

It's fine for people to like Cxx, but I do wish we could stop perpetuating the falsehood that C is just a subset of Cxx. Cxx, when it started was a pure superset of C, but that is no longer the case.

Re:Function overloading in C by ectoplasm on Sunday July 26, 2015 @07:24PM (#9952593)
Alright, I'll rephrase. There are a zillion differences, but with a couple of minor exceptions, there is very little C++-incompatible C that cannot be straightforwardly expressed as C++-compatible C. I mean, gcc -Wall even turns on -Wc++11-compat and -Wc++14-compat now.

Also, sizeof doesn't behave differently, the arguments that get passed to sizeof are different in a few cases, e.g. sizeof('x'). See Annex C:

http://www.lcdf.org/c%2B%2B/clauseC.html

Re:Function overloading in C by vortico on Sunday July 26, 2015 @05:05PM (#9952195)
However, with all the "great" features of C++ like templates, RAII, and overloading, programmers use and abuse every corner of them to build overly complicated ways to basically create domain-specific languages. It happens in over half of the C++ libraries I've used, otherwise they would just make their API in C.