C++17

Era Scarecrow via Digitalmars-d digitalmars-d at puremagic.com
Tue Jan 26 16:56:13 PST 2016


On Wednesday, 27 January 2016 at 00:16:58 UTC, Atila Neves wrote:
> I've recently spent about 2 or 3 months writing C++14 at work. 
> I ended up complaining a lot. Most of the time because I'd 
> written a bug that wouldn't have happened in D. The rest was 
> usually due to something supposedly simple taking an inordinate 
> amount of work.

The deepest I've personally gone into C++ was when writing a 
quicksort and other sort functions. The whole thing fell 
spectacularly apart for something that was tiny and obscure and 
looked correct. It was quite a pain.

> The penny really dropped when I wrote D again for the 1st time 
> after weeks and weeks of C++14. It was night and day. Suddenly 
> my thoughts started getting to converted to code all that 
> faster, with fewer bugs to distract and annoy me.

> Do you know how you split a string in C++? You install boost, 
> that's how.

  Heh, considering strings are still based on C's implementation 
which null terminated, mostly due to memory constraints that the 
original computers had (64k, OR LESS of memory), EVERY byte was 
precious. I'm not sure how Boost would deal with splitting a 
string, but I can think of a way that would do the job (well two 
ways if you want one that doesn't mutate the original data).

  I personally think C++ should probably be abandoned for a better 
language since it's insistence on backwards compatibility chains 
it to some very bad design decisions; And it's horrid syntax 
*Yuck!* which has kept me from using it for over two decades; Not 
to mention the STL looks confusing and only makes some sense 
after a good video tutorial where the basics of the principles 
were explained.

  Good code and API's shouldn't need a lot of explaining to get 
them to work. Good design shouldn't need a lot of fiddling to get 
it to work in a way that logically makes sense.


More information about the Digitalmars-d mailing list