Live data from Hacker News

Help me sort out the meaning of “{}” as a constructor argument

scottmeyers.blogspot.com

11–20 of 181 posts

Re: Help me sort out the meaning of “{}” as a constructor argument

#11
post #4

Earlier quoted context omitted.

My god c++ is atrocious.

Like "Wargames", the best way to win is not to play. Between moving from MS to POSIX environments in the 90s, and the "death" of Borland, this left me with few options other than another Faustian deal with Java-land, alas. I'm actually liking Javascript nowadays, though. Especially as more of an FP-capable language than an OOP-mandatory language.

I'm loving the fact fact that languages seem to be moving towards some of the better parts of FP and away from some of the worse parts of OOP. I'm not particularly fond of fully FP languages but they have some really nice ideas that I've been enjoying using.

Re: Help me sort out the meaning of “{}” as a constructor argument

#12
post #6

Earlier quoted context omitted.

A similar defect that was "fixed" breaking backward compatibility was the resolution of initializer_list constructors of recursive types: T(initializer_list ); Before, if you did T element; T list = {element}; the second initialization would be dispatched to the initializer_list constructor; after the fix (for GCC, after 4.9) it would call the copy constructor. See http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defe…

And that fix is still far from fixing the language. I had tought that deprecating brace elision for initializer_list and always requiring double braces would be a workable, although backward incompatible fix, but it still cause issues. There was a recent thread on the topic on std-discussion recently. [hi ot, long time no see]

Yeah, double-braces was also my first guess but found out that Clang and GCC handled it differently (!) so I didn't even try to understand what the std mandates.

[hey! :)]

Re: Help me sort out the meaning of “{}” as a constructor argument

#13
I've been programming professionally for over 20 years, most of it in C++. I really like developing fast code, and C++ used to be my favorite tool for the job.

But the language complexity gets more insane with every revision. It's now at the point where Scott Freakin' Meyers can't figure out the interpretation of a short little chunk of code.

I'm now actively looking for gigs in which I can develop high-performance code in a language _other than_ C++, just because it's such a minefield.

I don't follow the discussions of the standards committee carefully, but it seems like they must place almost no premium on keeping the language (and its programs) understandable by non-language-lawyers.

Re: Help me sort out the meaning of “{}” as a constructor argument

#14

I've been programming professionally for over 20 years, most of it in C++. I really like developing fast code, and C++ used to be my favorite tool for the job. But the language complexity gets more insane with every revision. It's now at the point where Scott Freakin' Meyers can't figure out the interpretation of a short little chunk of code. I'm now actively looking for gigs in which I can develop high-performance c…

Any sense of where the C++ refugees are heading?

Rust? Go?

Re: Help me sort out the meaning of “{}” as a constructor argument

#15
post #4

Earlier quoted context omitted.

My god c++ is atrocious.

Like "Wargames", the best way to win is not to play. Between moving from MS to POSIX environments in the 90s, and the "death" of Borland, this left me with few options other than another Faustian deal with Java-land, alas. I'm actually liking Javascript nowadays, though. Especially as more of an FP-capable language than an OOP-mandatory language.

That said... if you are grinding out games on a $200 piece of console hardware (a "toaster emulator"), C/++ is your gig. Possibly with a thin patina of scripting over the top of it, I suppose.

Re: Help me sort out the meaning of “{}” as a constructor argument

#16

I've been programming professionally for over 20 years, most of it in C++. I really like developing fast code, and C++ used to be my favorite tool for the job. But the language complexity gets more insane with every revision. It's now at the point where Scott Freakin' Meyers can't figure out the interpretation of a short little chunk of code. I'm now actively looking for gigs in which I can develop high-performance c…

Any sense of where the C++ refugees are heading? Rust? Go?

"C with classes". (I'm not joking)

Re: Help me sort out the meaning of “{}” as a constructor argument

#17

I've been programming professionally for over 20 years, most of it in C++. I really like developing fast code, and C++ used to be my favorite tool for the job. But the language complexity gets more insane with every revision. It's now at the point where Scott Freakin' Meyers can't figure out the interpretation of a short little chunk of code. I'm now actively looking for gigs in which I can develop high-performance c…

I would like to thank Mr Meyers for his Effective C++ book, back in the 90s. Said book for me was the tipping point with C++. Having used Borland Pascal-with-Objects, and read about Eiffel, that book confirmed for me, at least, that C++ was a tool of last resort for trying to build on top of existing C code.

C++ devs are a hardy breed :-)

Re: Help me sort out the meaning of “{}” as a constructor argument

#18
post #4

Earlier quoted context omitted.

My god c++ is atrocious.

Like "Wargames", the best way to win is not to play. Between moving from MS to POSIX environments in the 90s, and the "death" of Borland, this left me with few options other than another Faustian deal with Java-land, alas. I'm actually liking Javascript nowadays, though. Especially as more of an FP-capable language than an OOP-mandatory language.

I miss Delphi, it was awesome for rapid GUI development :(

Re: Help me sort out the meaning of “{}” as a constructor argument

#19
post #16

Earlier quoted context omitted.

Any sense of where the C++ refugees are heading? Rust? Go?

"C with classes". (I'm not joking)

And yet, I'm laughing. As you know, that was what we called the C preprocessor thing back in the mid 80s (as discussed in Uni - I never used it until about 1990)

Re: Help me sort out the meaning of “{}” as a constructor argument

#20

I've been programming professionally for over 20 years, most of it in C++. I really like developing fast code, and C++ used to be my favorite tool for the job. But the language complexity gets more insane with every revision. It's now at the point where Scott Freakin' Meyers can't figure out the interpretation of a short little chunk of code. I'm now actively looking for gigs in which I can develop high-performance c…

Any sense of where the C++ refugees are heading? Rust? Go?

Haskell, at least in my case.
Post reply on HN