4 ms·
Do people end up finding concepts useful? They seem nice in theory but I have yet to find a practical case where I want to reach for them. The errors aren't (at
by dataflow 6y ago
Do people end up finding concepts useful? They seem nice in theory but I have yet to find a practical case where I want to reach for them. The errors aren't (at least currently) noticeably better than normal template errors, and they can end up being redundant in practice.
- CoastalCoder 6y ago> Do people end up finding concepts useful? I'll get back to you when my work projects are allowed to use a C++ version newer than C++11. </rant> But, more seriously: I'm curious if so few people are actually using C++20 (for work, at least) that it will take a while to answer questions like yours.
- pjmlp 6y agoIt is the same problem as with C, Java and Python. In many business, many coders learn just enough to get the job done and never care about moving forward with their knowledge unless obliged to do so. When doing contracting where one gets to jump into random codebases just for a couple of months, it is quite sadding the quality of code that we routinely find out. It is like playing Mikado with code.
- einpoklum 6y agoThis is not really a problem in C, since there's little beyond the "just enough". But agreed about other languages. With C++ you're basically always at a point where you only know a little, even if you've worked on your C++ skills for years... :-P
- pjmlp 6y agoIt is because it means many code against the security considerations of K&R C.
- einpoklum 6y agoI'm not sure I understand what you mean. Can you give a concrete example?
- pjmlp 6y agoThe many book examples would be exploitable under the traditional attack vectors nowadays in practice, or would generate tons of red lights when put under a static analyser, yet that is how many still program in C. Bare bones strcpy() and memcpy(), pointer arithmetic all over the place without helper functions to validate application invariants, #ifdef spaghetti code, not using translation units as poor man's modules,...
- ok123456 6y agoI think a major benefit is you can use auto parameter types and have the compiler propagate constraints about what methods and fields are required at compile time.