4 ms·
"More verbose"? Just how... you tell me. A line? This no JavaScript/Coffescript land, this is freaking good old C++. Don't tell me about verbosity on this level
by talles 13y ago
"More verbose"? Just how... you tell me. A line? This no JavaScript/Coffescript land, this is freaking good old C++. Don't tell me about verbosity on this level.
Ah, and you found a gap in the template usage. Something not well thought. Some little case that the standard falls for it. Join the line, son. You got to understand and accept this. If you do you have a wonderful toolbox to architect whatever you want with it. If you don't you are another guy on the internet shouting that "C++ sucks".
Again, the analysis is interesting, but it misses the real deal when trying to make a point. Guy named Robert in the comment section does hit the nail by the head by the way. The real point is that structs are raw data structures while classes are fully featured OOP entities. Don't put they in the same box.
- nicolasgz 13y ago> structs are raw data structures while classes are fully featured OOP entities. Don't put they in the same box. That's not true. Structs and classes are identical except for the minor functional differences highlighted in the article.
- talles 13y agoBy the way C++ standardized it? Yes, the only big difference is property accessors. By convention? Nope. The term struct pretty much stands for a pure data construct. C++ attempted (and pretty much failed) to make this distinction. Some languages, like C#, did a much better job. In the real world we are always urging to being consistent. While other languages do a pretty good job by enforcing it, on C++ this is more on your shoulders.