Hacker News new | past | comments | ask | show | jobs | submit login

Disagree. In the sense that the code one writes gets simpler. Range based for loop alone does a lot. Auto destructuring of tuples, initialization lists, std::variant... etc. all do their part in making new code less verbose and less bureaucratic. It's just sugaring but it's at least a standard sugaring.



While I agree that C++ has improved a lot, and while all these extensions to the standard library can, when used carefully, considerably increase readability... well, there remains the fact that they still need to be used with extreme care.

See https://github.com/isocpp/CppCoreGuidelines/issues/1038 for an example of what I'm talking about.

So, readability increases, but the mental load of making sure that stuff doesn't break in subtle and non-euclidian ways keeps increasing, at least when refactoring existing codebases.


Yeah, memory handling is still challenging to handle correctly - in the sense it need forethought and constantly remembering what one can and can't do (list iterators good long term references, vector iterators bad long term references, etc). string_view is a good example of a situation where garbage collector would save a lot of headache.


Also, small functions are generally free to call and are often inlined. So you can keep your function simple and at a consistent abstraction level without paying for it. Do this until proven otherwise, with real perf data. I find a lot of people are afraid of this or they say that they don't know what is going on. I suspect some may also prefer writing in asm and not using abstractions to tell the story.


The code one writes does get simpler. Unfortunately, the code some dozen developers write ends up with all imaginable ways of writing the same thing. That's my biggest pain with C++.


"the code some dozen developers write ends up with all imaginable ways of writing the same thing."

I do know what you mean. But that's not really the languages problem but of the coding guidelines and using code review to maintain legibility.


I don't know. I don't have the same problem with Lua and Python. Lua is simply small enough not to have baggage and Python seems to have a healthy community that keeps updated with best practices. It also helps that both languages are designed to be readable. C is also simple enough, as long as code doesn't abuse pointers.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: