6 ms·
I have been programming professionally for over 20 years in languages ranging from assembly to Lisp and everything inbetween and applications from embedded to L
by lmilcin 5y ago
I have been programming professionally for over 20 years in languages ranging from assembly to Lisp and everything inbetween and applications from embedded to Linux kernel, to OS, to backend systems to algorithmic trading.
That I don't touch C++ is my choice because after years of development I decided that most of all I value simple and readable code, working with people who like to write simple and readable code or helping projects write simple and readable code. And C++ and community is, in my opinion, anything but about simplicity and readability.
For some reason I do not fully understand, C++ projects I have participated are a contest of who can think of more convoluted C++ construct that nobody ever will be able to understand and C++ seem to be absolutely perfect platform for it.
Even if I am able to understand it (which I frequently do not), I just can't rationalize putting crap like that in a project that is expected to then be grokked and modified by new developers.
I have tried restricting the types of constructs and C++ syntax used in projects in the past but this inevitably causes flamewars and lots of discussions about why these rules were instituted and whether they are necessary. I am sick and tired of explaining the value that exists in moderation and restriction.
- harry8 5y agoyep. That's a reasonable view. Hence: >> they may not want to talk of course. C++ as an indicator of dud project, poor team and programmer lack of taste is valid. It isn't necessarily always true but there's no reason for you to care if you've gone that way and it worked.
- wruza 5y agoNo upvote can tell how much I relate to this. The only way to get a good maintainable C++ code is to hire very mediocre programmers whose “C++” really means “Qt with some shared ptrs”. The reason (I believe) is that complex things are like hard drugs for smart people. Instead of solving business tasks, which honestly are often just boring, they long for an art in programming. In C++ this inevitably leads to solving non-existing problems in a most complex, efficient and unstable way that requires a hard set of prerequisites to work, and then these break. You can see it on forums. C, python, js folks discuss libraries, idioms and best practices, and C++ folks discuss a turing completeness of template metaprogramming and the most obscure ways to pass results up the callstack without copying 8 to 24 bytes. Almost no one I talked with there actually worked for someone who actually needed these microscopic gains all over the code. Or who understood what they do beyond “it’s complex and expensive, but in the end they deliver the results we need, so that’s justified”.
- lmilcin 5y ago> The reason (I believe) is that complex things are like hard drugs for smart people. That is the golden explanation I kind of understood internally but never formulated consciously. Yes, that's exactly it. It takes willpower to be able to refrain from all those shiny toys. You see one and you are immediately imagining what you could use it for. Writing C is like using typewriter or distraction-free editor, putting away your phone and disconnecting the Internet. Just imagine your team is told to write all their pieces of code in any language they want. Writing C is like telling the team: sorry, you can't do that. We know all those languages exist and they even may have fancy features that could improve your work, but for reasons of sanity we want you to stay programming single language.
- ksec 5y ago>The reason (I believe) is that complex things are like hard drugs for smart people. >That is the golden explanation I kind of understood internally but never formulated consciously. I am thinking would it be fair to say C++ are for the wicked smart but C are for ones with age old wisdom.
- lmilcin 5y agoSome more: Any problem has many possible solutions, but only one (well... few) are simplest. It doesn't take much intelligence to write complicated code, this is just finding "a" solution. Finding simple solution requires understanding of range of all possible solutions or at least a lot of them, understanding what makes them simple, and selecting the one that is simplest. If you are smart and want to show it, why not show your smarts by finding simple solution to the problem?
- ksec 5y agoOne problem is these sort of simple solutions are hard to judge by seniors for your bonus. Part of Resume Driven Development problem?
- pclmulqdq 5y ago
- Quekid5 5y ago> For some reason I do not fully understand, C++ projects I have participated are a contest of who can think of more convoluted C++ construct that nobody ever will be able to understand and C++ seem to be absolutely perfect platform for it. I think it both a culture and a more technical language problem. There seems to be a sort of extreme "ackshually, ..." one-upmanship and/or pedantry in all the C++ forums I've ever participated in. Of course this is itself driven by the crazy complexity of just the base C++ language itself and the numerous edge cases for everything. I think it's very telling that nobody, not even long-time committee members, can even claims to know all of C++[0]. This is exacerbated further by the committee's unwillingness to remove anything. I mean even such an obsolete feature as trigraphs was only removed in C++17, probably about 15-20 years after it mattered to anybody but IBM with their EBCDIC. Another little fun observation: Initializing a variable can be done in soooo many ways. I think it's at something like 20+ different ways at last count... Not a good sign. I say all of the above as someone who actually appreciates a lot of things about C++. [0] Even to a first approximation. Obviously there will always be obscure corners of any practical language such that no human can know literally all of it.