DEV Community

Discussion on: Getting Cozy With C++

Collapse
 
vimmer9 profile image
Damir Franusic

Great article. I spent the last 8 years doing only c++ network programming. Then after thinking things through, I thought to myself that this is overly complex for what I'm doing and OOP is something I can live without. Also, I can easily replicate it with function pointers which I also use in C++ anyway.

This was just a quick intro, you should stick with C++ if you like it; you wrote a great post about it anyway. Now, here's the reason I'm writing this comment; there's an alternative to Valgrind which you could consider using once you get more acquainted with C++. Valgrind incurrs 20x slowdon or was 10x I don't rememeber honestly, but it can get quite slow and eat up a huge amount of memory. The other alternative that doesn't cause any noticeable slowdown are gcc/clang fsanitize methods

gcc -ggdb -o a.out a.cpp \
-fsanitize=address \
-fno-omit-frame-pointer

When I first started coding in C++ I also usw Valgrind; not even sure if fsanitize methods were available back then.

Happy programming and congrats on this great post.

DF

Collapse
 
deciduously profile image
Ben Lovy

Ah, thank you for the tip! I didn't know about that flag.

Collapse
 
vimmer9 profile image
Damir Franusic

It's a series of flags, check out the man pages of gcc/clang or look it up online.

Good luck with segfaults 😉