Live data from Hacker News

C++ is not a superset of C

mcla.ug

41–50 of 114 posts

Re: C++ is not a superset of C

#41

I never heard anyone say that C++ is a superset of C. Sure, the first version was a preprocessor on top of C and certainly that is common knowledge. But a superset? Never heard it. ObjC on the other hand...

You evidently haven't been looking at the stackoverflow questions coming in at the [c] and [c++] tags... ;) A frightening amount of [c][c++] tagging is expunged there every day.

Which is often just meaningless pedanticism. There are a lot of questions about C APIs where it's irrelevant whether the answer uses C or C++. The latter might not be an exact superset, but in most cases it's easily close enough.

Re: C++ is not a superset of C

#42

Nearly everything that is mentioned in this blog is a subject of change / addition to the latest C standard, code named C2x. They are in discussions to introduce the following in C: * nullptr * auto * __has_include * make false and true first-class language features * constexpr and lots of other goodies [1]. https://gustedt.wordpress.com/2018/11/12/c2x/

Are they trying to make C literally become the same as C++ except classes and templates?

Are classes and templates not the bulwark of what makes C++ C++ though

Re: C++ is not a superset of C

#43

The C++ specification has an entire appendix devoting to listing incompatibilities with C. Some features missing from this list: * A char literal is an expression of type int in C, but type char in C++. * String literals are const in C++ but non-const in C (although attempts to modify them are undefined behavior). * This program is legal C but not C++: int i; int i; * structs and unions occupy a different name space…

[deleted]

Re: C++ is not a superset of C

#45

Nearly everything that is mentioned in this blog is a subject of change / addition to the latest C standard, code named C2x. They are in discussions to introduce the following in C: * nullptr * auto * __has_include * make false and true first-class language features * constexpr and lots of other goodies [1]. https://gustedt.wordpress.com/2018/11/12/c2x/

Are they trying to make C literally become the same as C++ except classes and templates?

Well, they are trying to slim down, so to speak, the gap between C and C++ for the sake of a safer interoperability between the languages and for the sake of safer and secure code.

If C could fix _Generic from C11 and make it behave more like a lightweight version of templates, then I could say we have a huge potential of having a safer version of what we currently have.

Re: C++ is not a superset of C

#46
post #33
post #32

That pink background to the left weighs 6 MB. Do you really think it's necessary?

I should probably make it smaller! 6MB is pretty indulgent. But I do like how it looks and this is mostly just a fun blog for myself :)

I think your blog looks great. The color palette you are using for text is very pleasing.

Re: C++ is not a superset of C

#48
post #46
post #33

Earlier quoted context omitted.

I should probably make it smaller! 6MB is pretty indulgent. But I do like how it looks and this is mostly just a fun blog for myself :)

I think your blog looks great. The color palette you are using for text is very pleasing.

Thank you! ^_^

Re: C++ is not a superset of C

#49
post #33
post #32

That pink background to the left weighs 6 MB. Do you really think it's necessary?

I should probably make it smaller! 6MB is pretty indulgent. But I do like how it looks and this is mostly just a fun blog for myself :)

You are also contributing to global warming. It takes a energy to transfer this data all over the world. And poor people will will run out of their monthly phone data limit.

Re: C++ is not a superset of C

#50
post #33
post #32

That pink background to the left weighs 6 MB. Do you really think it's necessary?

I should probably make it smaller! 6MB is pretty indulgent. But I do like how it looks and this is mostly just a fun blog for myself :)

I've converted it to jpg and it's now 448K :)
Post reply on HN