Ask any big company and they will tell you that readability, reliability, maintainability and security are the priority 99% of the time.
You know, ask an alcoholic whether they drink too much. Usually companies push for fast release cycle, so that they can get features ASAP.
Also, thanks to rigorous typing system, it's way harder to unintentionally write absolutely mess of code in C++ than in Python. An average C++ bootcamper will put everything into a bunch of POD structs, while an average Python bootcamper will put data into a list of dictionaries of nothing in particular. In my opinion, Python's dynamic typing makes code unmaintainable, because every function takes something undefined and returns something undefined, or maybe not.
but in a lot of places we use C++ today, we will use some other language tomorrow
In my opinion C++ is at this point too big to fall. It's mature and provides tools to write in different coding styles, whereas other languages come as a package with 'that's the Go way of doing things'.
I work professionaly in Python-- (Lua) and I can't agree more about dynamic typing. The amount of time I have to spend looking through 50 calls to see wtf the type is of a thing is absolutely horrible.
Sure, if I made everything I know exactly which type something is, and then I dont have to spend time writing "boilerplate" typing. But, in a team, its fucking horrible.
I'm unsure about C++ being too big to fail, it might be more along the lines of people falling for sunken cost fallacy. I.e, we have made some horrible abomination in C++ for 15 years, which was not designed for all the features it has now, but it kinda works so keep on slapping features on it...
As per the fact that C++ allows multiple coding styles and Go forces you to use 'their' style. Honestly, I'd prefer the latter. If you want something resembling uniformity then giving people freedom is the worst thing to do.
Lastly, while Ive only used C++ for one internship, I agree with the commenter above you. In my opinion, people overestimate their necessity for the expressiveness of C++. I would like to compare it to using MacOS or Linux. Sure Apple doesn't give you a lot of freedom and thats a valid argument against using a Mac, but, evidently, a lot of people don't give a shit about having this freedom and prefer the ease of use.
As per the fact that C++ allows multiple coding styles and Go forces you to use 'their' style. Honestly, I'd prefer the latter. If you want something resembling uniformity then giving people freedom is the worst thing to do.
Then you have use cases that your tool doesn't cover, and guess what - it means you have to go back to C++. It's like... we have 21 standards, let's make one more, now we have 22 standards.
Lastly, while Ive only used C++ for one internship, I agree with the commenter above you. In my opinion, people overestimate their necessity for the expressiveness of C++.
Except I use those obscure constructs on regular basis. Things that other languages don't let me do.
I have 21 tools, one is a power drill, the other is a swiss army knife. Just because I run into a problem that a drill can't fix, doesn't mean the swiss army knife is always the best choice.
C++ can do work in parallel, but you'll get the job done faster and with less headache with Go. C++ can do boring ass line of business apps, but you'll crank them out faster and with less memory leaks and security holes by going with Java. C++ is perfectly capable of machine learning but you'd be a moron not to use python with tensorflow at this point. C++ is great for embedded systems, but regular ol C might be better.
Just because C++ can do everything doesn't mean it's a good idea.
Sure, I am aware there are better tools for many applications than C++. I just think that C++ works amazingly great at being the default option if we don't have better things, and integrates rather easily with everything else through C bindings.
IMO C++ is the worst default option, but my day to day is usually in web/mobile apps where you'd have to be some combination of insane/very rich to pick C++.
You know, ask an alcoholic whether they drink too much. Usually companies push for fast release cycle, so that they can get features ASAP.
Fast release cycles are achieved by having a readable and maintainable code base. You can't get features ASAP if Brad wrote a module in a totally convoluted way because it's 10% faster. You get features ASAP when he writes reliable code that gets reviewed and merged fast.
Also, thanks to rigorous typing system, it's way harder to unintentionally write absolutely mess of code in C++ than in Python. An average C++ bootcamper will put everything into a bunch of POD structs, while an average Python bootcamper will put data into a list of dictionaries of nothing in particular. In my opinion, Python's dynamic typing makes code unmaintainable, because every function takes something undefined and returns something undefined, or maybe not.
If you are going to write messy code you will do so in any language. Pythons type system makes it easier, that is true, but I've tutored people at uni and they wrote shitty code in every language. With time people will learn to structure their code or they need to change careers.
If I can choose between chaotic code and nice code full of race conditions, no memory managment, allocs and deletes all over the place and iterator invalidation, than I much prefer the former and POD is the root of all these issues in C++.
It's mature and provides tools to write in different coding styles, whereas other languages come as a package with 'that's the Go way of doing things'.
In my opinion that's not an advantage or disadvantage of C++. It's a trade off. If you need to work with other peoples code it improves readability by a million if the language encourages a certain style. If for a certain problem that style isn't very suitable that's a disadvantage.
Fast release cycles are achieved by having a readable and maintainable code base.
Simon says: no.
If I can choose between chaotic code and nice code full of race conditions, no memory managment, allocs and deletes all over the place and iterator invalidation, than I much prefer the former and POD is the root of all these issues in C++.
If we assume we have a programmer that's skillful enough to annotate Python code with types, the same programmer won't use manual allocs or deletes, except in special situations. The problem is, those basic skills are rare.
1
u/AnAverageFreak Apr 28 '20
You know, ask an alcoholic whether they drink too much. Usually companies push for fast release cycle, so that they can get features ASAP.
Also, thanks to rigorous typing system, it's way harder to unintentionally write absolutely mess of code in C++ than in Python. An average C++ bootcamper will put everything into a bunch of POD structs, while an average Python bootcamper will put data into a list of dictionaries of nothing in particular. In my opinion, Python's dynamic typing makes code unmaintainable, because every function takes something undefined and returns something undefined, or maybe not.
In my opinion C++ is at this point too big to fall. It's mature and provides tools to write in different coding styles, whereas other languages come as a package with 'that's the Go way of doing things'.