4 ms·
>C++ is a much more complex language than C While this might be true, generic containers, sane strings, RAII and the possibility of not having to deal with poi
by blackpill0w 4y ago
>C++ is a much more complex language than C
While this might be true, generic containers, sane strings, RAII and the possibility of not having to deal with pointers makes C++ an easier language to work with.
You certainly need to worry about much less things long as performance is not a priority.
- bsder 4y ago> sane strings So, explain to me why every C++ program always has its own String implementation? > long as performance is not a priority. Then C++ is a disastrous choice. Almost anything is better.
- zabzonk 4y ago>So, explain to me why every C++ program always has its own String implementation? i have no idea where you are reading about c++, but every c++ program i have read or written in the past 20 years or so does #include <string> std::string greet = "hello, world"; the full-stop in front of the hash is something with HN, not me or c++, and only seems to show up when editing.
- blackpill0w 4y ago>So, explain to me why every C++ program always has its own String implementation? *saner :) >Then C++ is a disastrous choice. Almost anything is better. True, C and C++ are most of the time not the right tool for the job nowadays. But, if it's just a project that you're working on in your free time, it wouldn't harm to write it in your favorite language. I write in C++ a lot even if I could do the same thing much easier in other languages.
- camel-cdr 4y agoThis is only the case, because the C standard library is quite small and has many bad parts. You can use something like STC [1] to even the playing field. [1] https://github.com/tylov/STC https://github.com/tylov/STC