Komische Frage, aber könnte man das Lernen einer Programmiersprache, bei einer Virtuellen Maschine machen?
Hallo Leute, ich habe gehört, dass man bei Programmiersprachen sich beim Code ziemlich verbocken kann mit Memory Leaks und anderen Risiken beim unsicheren Code.
Also ist es eine bessere Idee in einer Virtuelle Maschine zu Coden, falls zu solchen Probleme kommt, dass man ein Backup macht, die virtuelle Maschine löscht und dann eine neue Maschine aufsetzt.
Mir ist es bewusst, dass virtuelle Maschine auch Performanceeinbrüche haben und wenn man kein guten PC/Laptop hat, ist sowas schon unmöglich. Und falls man eine Grafikkarte braucht, falls man ein rechenintensives Spiel programmiert, bräucht man 2 davon wenn man QEMU benutzt, bei Virtualbox ist es unmöglich und Virtualbox wäre aus meiner Sicht auch kaum geeignet dafür.
Was denkt ihr dazu?
That only makes sense when you run kernel development.
In all other applications, the program crashes at Memory Leaks or the like, or you have corrupted data afterwards, for example if you have an export of data to a file.
I program my applications in C++/Qt on my “normal” system Debian 12 and not in a VM.
That’s nonsense. Memory Leaks don’t break anything, so you don’t need it. And for inspecting there are also tools.
QEMU makes sense if you want to develop operating systems. If you use Windows, a Linux VM (Linux subsystem for Windows) can be useful as Linux in parts facilitates development and then you can also test on Linux.
What tools are there for this?
Under Linux, for example, valgrind and GDB. under Windows various visual studio tools.
Yes, you can do this even if Memory Leaks can cause problems only after a longer time.
Sometimes, however, shorter programs can also crash the machine.