logoalt Hacker News

whobreyesterday at 6:52 PM7 repliesview on HN

> auto main() -> int {

Dude…


Replies

cocotoyesterday at 9:54 PM

In my opinion this syntax is super good, it allows to have all functions/method names starting at the same level, it’s way easier to read the code that way, huge readability improvement imo. Sadly nobody uses this and you still have the classic way so multiple ways to do the same thing…

show 1 reply
rovingeyeyesterday at 9:49 PM

This has been valid C++ since C++ 11

show 1 reply
sethops1yesterday at 9:29 PM

As someone who quit c++ over 15 years ago it's been comical to watch what this language has become.

webdevveryesterday at 8:27 PM

i was sincerely hoping i could get

    auto main(argc, argv) -> int
         int argc;
         char **argv;
to work, but alas it seems c++ threw pre-ansi argument type declarations out.
show 1 reply
CamperBob2yesterday at 7:16 PM

It's like calling a Ford Mustang Mach-E the "Model T++."

on_the_trainyesterday at 6:55 PM

It's been the go-to syntax for 15 years now

show 2 replies
fewyesterday at 7:31 PM

And their code example doesn't actually return a value!

show 1 reply