News for hackers. Stuff that matters.
Re:Joint Allocations in C++ by svalorzen on Monday September 14, 2015 @05:36AM (#10214265)
It seems to me that you simply don't like what C++ stands for, and that's perfectly OK; but then complaining that C++ follows C++ principles seems foolish to me. To quote the original article:

> should we be using these low level types in this particular class, or use classes that better represent what we need and leave the low level types to them?

There is no mention that we want to remove complexity. Instead, the aim of modern C++ is in fact to hide it, so that high level code can be written as simply as possible while hiding all the implementation details in classes. The code you see in this article is no different from the code you find in the implementation of the standard library; in fact since it is simpler it is even easier. Does not mean that the standard library does not have complexity - but it hides it from me, possibly with low expense. Also it never mentions pointers, the problem there is all the arithmetic which is not portable and highly prone to bugs should it ever need to be modified.

The article is not factoring. It is coalescing a feature in a simple, single purpose class which does very little, and has a very simple use case and usage. If you have no idea of the memory layout, then you need to read the class, exactly as you would if you wanted to know the memory layout of std::list or std::vector. Making a class does not prevent the complexity from existing, it just prevents you making silly mistakes while using it. It never allows you not to know your trade and forget how to program.

It seems to me you are a C guy. Really, I get what you are saying, it is just not the philosophy of C++, and if you disagree, maybe you shouldn't be using C++. That's perfectly fine, and I love that there are C people doing C things - it's not my cup of cake, but I'm happy they're there. And I would understand also if you were complaining about C++ trying to do something it is not. But what's happening here it really not the case, so I don't agree with you either.

Re:Joint Allocations in C++ by Galanwe on Monday September 14, 2015 @06:02AM (#10214350)
You're sort of right. I don't like what C++ has become. I liked C++03 and hoped C++11 would just have added fixed size types and C99. Nowadays I mainly code in C.

Still, this article is the exact reason why I just can't stand "the new C++ trend": Code bloat for no added value, false sense of safety with fragile abstractions, pointless factoring which makes code unreadable :(

Re:Joint Allocations in C++ by mreiland on Monday September 14, 2015 @09:49AM (#10215017)
you keep saying no value when several people have pointed out the value to you.

Why do you keep saying that? Do you think repeating it will make it true?

Re:Joint Allocations in C++ by peterashford on Monday September 14, 2015 @05:45AM (#10214298)
It seems to me that you have a particular idea about what C++ "stands for". C++ doesn't stand for ANYTHING. It's a design-by-committee warty mess that was ill-born to begin with and the surgeons have been grafting new limbs onto it for years trying to make it less horrific. It may now resemble Cthulhu, but pretty it ain't.

IMO, of course.

Re:Joint Allocations in C++ by huhtenberg on Monday September 14, 2015 @05:58AM (#10214340)
Precisely.

Every C++ programmer I know uses their own narrow subset of C++. Except that those using "hardcore" ++ features appear to be far more vocal about their subset being the one true way to use C++.

Re:Joint Allocations in C++ by svalorzen on Monday September 14, 2015 @05:56AM (#10214329)
Are you hoping to accomplish something with this comment or are you just having a bad morning and need to vent?
Re:Joint Allocations in C++ by fit2rule on Monday September 14, 2015 @08:51AM (#10214799)
In point of fact, I agree with what he said, it accomplishes in me an understanding that in fact C++ is a warty thorny bush of mess, and leads me to conclude that a significant aspect of 'being a C++ coder' is to find ones way, beautifully or otherwise, through it all.

I've seen great C++ code that I just thoroughly enjoy reading, because it doesn't make assumptions about anyones' intelligence, and I've seen C++ code that is purely designed exclusively for only the elite who are mighty enough to wield the sticks that the C++ committee provide. C++ really gives all kinds of control authority to any style you wish to use .. another of those quaint software ironies that the power that makes one weak, enlightens another ..

Re:Joint Allocations in C++ by rayiner on Monday September 14, 2015 @09:02AM (#10214825)
I'll third that. C++ jumped the shark with C++98. I don't enjoy reading "modern C++."
Re:Joint Allocations in C++ by peterashford on Tuesday September 15, 2015 @04:45AM (#10219588)
I was hoping to share an opinion. I don't hate C++ when I use it - like every other C++ coder with their sanity intact, I use a subset that I understand and which usually doesn't blow off my toes. The problem is that invariably your safe subset intersects with someone else's and that's when the pain starts.
Re:Joint Allocations in C++ by kabdib on Monday September 14, 2015 @11:19AM (#10215484)
I agree with the guy.

C++ is getting better, but its early development was driven by questionable features (iostreams, ugh) and denial that the language / runtime needed some basic features, like string and buffer types that didn't suck.

I've been using the language since 1987, and still have my own safe subset, augmented recently with some of the C11 stuff that's become solid in the toolchains I use.

But it's still a misfeature-ridden grabfest of a language.