Live data from Hacker News

C++ and the Culture of Complexity (2013)

blog.greaterthanzero.com

191–200 of 285 posts

Re: C++ and the Culture of Complexity (2013)

#191
post #167
post #148

Earlier quoted context omitted.

You can assure us based on what? If you have insider knowledge or particular credentials please share. So far it looks like you're ranting.

He assures us based on him being Walter Bright. That’s good enough for me.

Yes, sorry for the confusion. On mobile the final sentence in the quote looked like it actually belonged to notacoward.

My comment was aimed at notacoward.

Re: C++ and the Culture of Complexity (2013)

#192
Isn't there anyway some of a pendant to Conway's law in this? I mean, C++'s standard library is - or at least used to be - rather complex, so the people that would go there and use C++ for their project - would more likely than not - carry at least some of that complexity over into the project...

Re: C++ and the Culture of Complexity (2013)

#194
post #148

Earlier quoted context omitted.

You can assure us based on what? If you have insider knowledge or particular credentials please share. So far it looks like you're ranting.

http://www.walterbright.com/ > Walter Bright is the creator and first implementer of the D programming language and has implemented compilers for several other languages. He's an expert in all areas of compiler technology, including front ends, optimizers, code generation, interpreter engines and runtime libraries. Walter regularly writes articles about compilers and programming, is known for engaging and informative…

Thanks, but my reply was for notacoward. Unfortunately I can't edit or delete it any more.

Re: C++ and the Culture of Complexity (2013)

#195
post #175
post #60

Earlier quoted context omitted.

scare me ... because at least I know for sure what'll happen then. Which is just because once you learned how pointers behave. Similarly, if you'd just take the time to learn the basics of rvalues, moving, RVO, ..., you won't be scared by them anymore. Might thake longer than pointers, sure, but it's worth it.

Maybe this is just my experience, but it took me far longer to understand the subtleties of move semantics, rvalues, and RVO than to understand pointers and references in C++. And this is not even getting into “universal references” (which I don’t have a comfortable understanding of either)

There's a YouTube video [1] of a great talk by Scott Meyers: Effective Modern C++ (part 1). He covers universal references and how they relate to other kinds of references in either that one or Part 2 [2]. I found the videos very helpful.

Edit - I may have the wrong videos linked. It could be his talk on Universal References [3] that I'm thinking of. It's been a while.

[1] https://www.youtube.com/watch?v=fhM24zs1MFA

[2] https://www.youtube.com/watch?v=-7qwpuA3EpU

[3] https://channel9.msdn.com/Shows/Going+Deep/Cpp-and-Beyond-20...

Re: C++ and the Culture of Complexity (2013)

#196
post #39

Earlier quoted context omitted.

Oh give me a break. Following this logic, why aren't you writing your code in English? The real world is complex. Don't confuse hiding complexity with minimizing complexity.

See Brooks's "No Silver Bullet". C++'s complexity is accidental.

I thought of Brooks when I saw the title; as I mentioned in my other comment, I see a kind of amusing pendant to Conway's law here: a complex programming language will produce a complex codebase.

Re: C++ and the Culture of Complexity (2013)

#197
post #38

The author states: >Neither the performance issue that move semantics address nor the perfect forwarding problem exist in classic OO languages that use reference semantics and garbage collection for user-defined types." I understand reference semantics but what are move semantics? Also what is the "perfect forwarding problem"?

Author here. A few years back, I wrote an article about the issues that you're asking about. Since the article still comes up as the #1 result of Google search for "C++ rvalue references", I believe it's ok for me to recommend it here: http://thbecker.net/articles/rvalue_references/section_01.ht... Warning: Read only if you have a serious interest in C++.

Thanks, I thought this was well-written.

Re: C++ and the Culture of Complexity (2013)

#198
post #81

Lots of posts here frame it like "Yes, it's a bit of a complex language, but the C++ committee has the difficult job of keeping everything backwards compatible, so it's understandable." But that's not the reality. The reality is that they (or Stroustroup) made that decision, and that decision was a mistake. The correct way to deal with backwards compatibility issues is the way Go does it, namely to write tools to aut…

This comment is far overestimating the capabilities of gofix. And this isn't a denigration of gofix (which is a good idea in general that more languages should copy), it's simply that Go actually really didn't change very much between 2009 (when Go was publicly announced) and 2011 (when Go 1.0 arrived and things stopped changing). It certainly didn't change nearly as much as "idiomatic" C++ has between 1990 and today.

The lesson here is that languages should restrict their backwards-incompatible changes to only those that are amenable to automatic migration via limited gofix-like tools, but that runs counter to your argument that C++ ought to be casting off its C heritage (which I quite sympathize with).

Re: C++ and the Culture of Complexity (2013)

#199
post #138

Earlier quoted context omitted.

Object Pascal is definitely reference based, not value-based, at least not when I used it back in Delphi 7.

You used Delphi, not Object Pascal. Object Pascal was created by Apple for Lisa and Mac OS, with collaboration from Niklaus Wirth. Borland then adopted it to Turbo Pascal 5.5 for MS-DOS. Turbo Pascal 6.0 and 7.0 for MS-DOS, followed by Turbo Pascal 1.0 and 1.5 for Windows 3.x took up ideas from C++. Borland then rebooted Turbo Pascal with Delphi, but to avoid creating too much confusion among Pascal developers, they…

Nitpick: Borland didn't reboot the object model, they extended it to add the 'class' types, but the 'object' types remained unchanged. The code you wrote works in both Delphi and Free Pascal :-). Object types are used often when you want to allocate objects on the stack or when you want to "embed" objects in other objects/classes (i don't know about Delphi but Free Pascal also extends object types to support newer stuff like properties).

Re: C++ and the Culture of Complexity (2013)

#200
post #147

Earlier quoted context omitted.

I know I'm in dangerous territory here, but what if the C++ community, as in committee, compilers, etc., pull a Javascript strict mode? Basically subsequent C++ compilers provide the possibility of some subset of C++ which is considered modern. Then files can be marked with it, at which point the C++ compilers reject deprecated idioms. Over time this should take over, I think most of the JS in the wild is now using s…

The header inclusion model (where you will be textually including hundreds of thousand lines of random code in a translation unit) doesn't make it easy to have version flags. Also many of the issues are intrinsic to the way the language has evolved (the template compilation model for example), it is not just a matter of deprecating a few features here and there (although that might help)

Headers are what need fixing first. They are why I would never consider using C++ for any new project and avoid jobs that require maintaining C++ code. C++ is the steam power of computing and keeping legacy monoliths running doesn't do anyone any favors. That shit should have been piece-by-piece rewritten by now.
Post reply on HN