Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

C++ is safer than C

Name: Anonymous 2019-01-10 7:01

this is the often said sentiment, because C++ has more complex type/class system
In reality, bugs in C++ are hidden behind layers of abstraction while C bugs are in plain sight. Fixing complex C++ code is far harder and takes much more time to properly debug. The Stroutstrup copypasta is true.
Just look at any medium size C++ project and you'll see its filled with bugs and bug reports that developers can't deal with it. C projects in constrast fix everything really fast because the bugs are obvious "in-you-face" violations of logic and common sense.

Name: Anonymous 2019-01-10 23:36

why are there so many if they're "obvious "in-you-face" violations of logic and common sense" then?

Name: Anonymous 2019-01-11 7:53

>>2
Because most C programmers are brainlets, program at night/drunk/drugged and don't use unit tests/fuzzing/valgrind/etc.
C has very low learning curve and allows anyone to start writing code now.
Hire a low-skilled programmer and you get shit code fast.
C/C++ separates the wheat from the chaff.
If "safe languages" you just hire minimum wage pajeets and the compiler ensures the code isn't 99% filled with exploits.

Name: Anonymous 2019-01-11 9:00

Both seem about as unsafe to me. Should have used a language with dependent types instead.

Name: Anonymous 2019-01-11 9:20

>>4
your're are an anus

Name: Anonymous 2019-01-11 10:56

>>4
C++ might add dependent types in the future, keep an eye on C++ Concepts

Name: Anonymous 2019-01-11 12:01

C++ allows smart pointers, which is basically reference counting garbage collection. It is very slow, but indeed makes code safer. C++ also has expandable arrays and index checking, which reduces buffer overflow bugs to just logged crashes.

Name: Anonymous 2019-01-11 13:29

>>7
reference counting garbage collection
This is true if you are talking about std::shared_ptr and std::weak_ptr. On the other hand, std::unique_ptr does not count references, since it owns the managed pointer. Hence, the overhead of using std::unique_ptr is minimal and its use should be preferred over std::shared_ptr.

Name: Anonymous 2019-01-11 14:53

>>8
std::unique_ptr is also completely unintuitive as far as writing code. It changes the value of other variables without you using it. C++'s smart pointers are anything but.

Name: Anonymous 2019-01-11 16:41

>>9
Its fairly trivial to write your own pointer container than use C++ stdlib trash. Besides that, references are far better than unique_ptr in most cases.

Name: Anonymous 2019-01-11 19:16

>>10
Anytime anyone wants to rewrite std::string or the pointers, it's a good indication you should stop working with them. It's just too hard to manage.

Name: Anonymous 2019-01-12 1:11

>>8,10
in most cases if you use std::unique_ptr without doing anything weird, the compiler will produce the same code as if you used a raw pointer and new/delete. there's literally no reason not to use it.

Name: Anonymous 2019-01-14 7:22

>>12
no reason other than the fact that new Anus(); is far easier to read and write than std::gonorrhea<niggers>()->[],,FUCK``,::pointer_abstractions.movable.make_unique(std::herpes::unique_pointer_constructor(Anus)).to_rlxyzvalue()

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List