Live data from Hacker News

A list of modern C++ features

github.com

61–68 of 68 posts

Re: A list of modern C++ features

#61

Earlier quoted context omitted.

Rust?

A very heavily biased rookie response. Not trying to be snarky. Rust would be an obvious choice for what I described. It's been on my personal list for a while to learn Rust and make use of it. I think I will pretty soon. I've been demotivated (to start) by reading over here on HN or elsewhere about how much of a learning curve it is to learn Rust. Perhaps, it was the bias that I already know what C++ was like in ter…

> I've been demotivated (to start) by reading over here on HN or elsewhere about how much of a learning curve it is to learn Rust.

That learning curve is necessary for safety. If you want a safe C++-like language without Rust's learning curve, you either (1) have a brilliant solution nobody has come up with yet or (2) don't actually want a safe language after all.

Re: A list of modern C++ features

#62
post #50

Earlier quoted context omitted.

First of all what if I am lunatic xD There are so many parts of C that are unsafe that a secondary tool is needed to have an reasonable type-checking and that tends to be devastating if they can be easily avoided by even safety critical engineers. https://users.ece.cmu.edu/~koopman/pubs/koopman14_toyota_ua_... "Toyota does not claim to have followed MISRA Guidelines" And honestly I dont think we agree on what "a few"…

"Decided by one man" != "decided on a whim".

"...despite the changes that it has undergone since its first published description, which was admittedly informal and incomplete..." ~ Dennis M. Ritchie

It took a decade to even decide what the C language really was and standardize it -- sounds pretty undefined and whimsical to me. But we all use and understand words differently so let's agree to disagree :)

Re: A list of modern C++ features

#63

Earlier quoted context omitted.

You guys don't use -pedantic? :D

-Weverything is even more pedantic than -pedantic: http://clang.llvm.org/docs/UsersManual.html#diagnostics-enab... - pedantic can be a bit annoying, but Weverything is downright infuriating on a modern codebase

That's why you combine it with -Wno-... as appropriate on a per-project as well as per-file basis in addition to a simple way to disable warnings completely.

When using make, it could look something like this:

    CC := clang
    CFLAGS := -std=c99
    WFLAGS := -Weverything -Werror
    NOWARN := vla
    COMPILE = $(CC) -c $(CFLAGS) $(WFLAGS) $(NOWARN:%=-Wno-%) -o $@ $
Building without warnings would be achieved via

    make WFLAGS=""

Re: A list of modern C++ features

#64

I really wish a group of really smart dev get together and come up with a new language based just on the modern C++. Perhaps even call it MC++ (Modern C++). Make it's syntax as simple and easy to learn as Python and yet give us the performance close to the compiled C++. I'd take that knowing very well that I can't do all the powerful stuff I could with C, yet I have a safe and idiot-proof language to work with in my…

Rust?

I think it does not meet this requirement:

> Make it's syntax as simple and easy to learn as Python

Re: A list of modern C++ features

#65
post #17

Earlier quoted context omitted.

In a word: C++ is probably not for you(r application).

Disagree. C++ has the philosophy of "You don't pay for what you don't use". Just use the parts that help with your problem. If your problem grows and you need more, you aren't trapped - the language has more. But if you don't need it, don't use it. For that matter, I'd argue that this is a reasonable approach for every language.

I completely disagree. C++ was not created to extend or enhance C; its an entirely new language providing backwards compatability only for legacy reasons. Using C in C++ introduces deficiencies and dangers that C++ was designed to overcome. As a C++ developer I come across a lot of code where people still use things like FILE* and close the handle in a goto. That should be frowned upon, there is no advantage for this method vs. using a stream; which handles the file handle while being scope bounded. Promoting the use of C in C++ is something terrible misguided and plain wrong.

Re: A list of modern C++ features

#66

I really wish a group of really smart dev get together and come up with a new language based just on the modern C++. Perhaps even call it MC++ (Modern C++). Make it's syntax as simple and easy to learn as Python and yet give us the performance close to the compiled C++. I'd take that knowing very well that I can't do all the powerful stuff I could with C, yet I have a safe and idiot-proof language to work with in my…

To replace C++ it you would either have to make a near human quality automated converter (which is likely impossible right now) or make it compatiable with C++, in the way Groovy is compatiable with java.

Re: A list of modern C++ features

#67
post #66

I really wish a group of really smart dev get together and come up with a new language based just on the modern C++. Perhaps even call it MC++ (Modern C++). Make it's syntax as simple and easy to learn as Python and yet give us the performance close to the compiled C++. I'd take that knowing very well that I can't do all the powerful stuff I could with C, yet I have a safe and idiot-proof language to work with in my…

To replace C++ it you would either have to make a near human quality automated converter (which is likely impossible right now) or make it compatiable with C++, in the way Groovy is compatiable with java.

A better example is the way C++ was compatible with C when it first came out. Apache Groovy has lots of little incompatibilities with Java, e.g. == has a different meaning in many cases.

Re: A list of modern C++ features

#68
post #49

I really wish a group of really smart dev get together and come up with a new language based just on the modern C++. Perhaps even call it MC++ (Modern C++). Make it's syntax as simple and easy to learn as Python and yet give us the performance close to the compiled C++. I'd take that knowing very well that I can't do all the powerful stuff I could with C, yet I have a safe and idiot-proof language to work with in my…

Nim is closer to that ideal than Rust, I think; Rust requires provable object ownership that doesn't go bad, Nim uses an (optional, but strongly suggested) GC. Nim's syntax is mostly pythonic, and it's metaproramming language is Nim (unlike C++'s abominable template metaprogramming language).

...and it compiles to C to leverage its speed and portability and it can use system libraries very easily.
Post reply on HN