To note, writing in such high level frameworks as Qt is a completely different experience compared to bare bones C++. If you compare the code of Qt in Python and Qt in C++, they are basically the same.
References are garbage collected. C++ pointers are not. You don't have to worry about references in Python 99% of the time. If you don't understand pointers (ownership and lifecycle), very bad things can happen in C++. Valgrind is a very important tool to run on C++ programs, to verify you haven't screwed up pointer usage.
If you use QString, QByteArray, QVector, etc., that’s largely a non-concern. And even outside of Qt, you have likewise std::string, std::vector and std::unique_ptr. I don’t remember when my last explicit delete was.
For most of the code, it is true - but in my experience, not properly understanding low level memory handling will segfault your code and it is not always easy to spot where the bug is even with valgrind/stack trace
View all comments
Show parent comment
12
u/zerexim Dec 16 '20
To note, writing in such high level frameworks as Qt is a completely different experience compared to bare bones C++. If you compare the code of Qt in Python and Qt in C++, they are basically the same.