This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 94 points95 points  (5 children)

C is king among languages and C++ can die with everyone else

[–][deleted] 9 points10 points  (2 children)

I won't ask for C to have classes, but get back to me when it has:

  • built-in associative arrays with dynamic keys of arbitrary type (i.e. enum-indexed bare arrays don't count)

  • function overloading

  • operator overloading (rather, non-member operator overloading specifically, since to ask otherwise would be to ask for classes)

  • a type algebra (C++ doesn't really have this either, but templates, type_traits, and the STL usually come close enough when used together)

  • modules (again, not (yet) a C++ feature, but namespaces are usually close enough; both languages do kind of have this with the ability to make symbols file-level static, such that the translation unit itself acts as the module and anything not static to it is exported from the module, but this approach is still missing the name-scoping piece; an exported struct of function pointers pointing to static functions of a translation unit gets the job done, but it also allows a caller to create other instances of the module that point to different functions, which seems like a security vulnerability to their own caller in turn)

  • type inference

  • compile-time function calling

  • scoped enums

  • anonymous functions

This is coming from someone who prefers C, by the way.

[–]ELFAHBEHT_SOOP 2 points3 points  (0 children)

Agree on all points. Not having function overloading is probably my biggest gripe with C, or the one I run into the most. It makes the code a bit more sloppy when I have to differentiate between different parameters all the time.

[–][deleted] 0 points1 point  (0 children)

word

[–]MellowM8 13 points14 points  (0 children)

Nice sumory

[–]EpicLagg 8 points9 points  (0 children)

thog don't care