@SimonSchroeder said in Where are the .ui files?:
I am so vocal about it because I was taught to use pointers and new everywhere when I started with C++. Turns out that this was the source of most bugs. So, using stack variables almost everywhere (except for Qt's objects with parents assigned) helps to prevent a lot of bugs. (There are other reasons to use pointers related to OOP and polymorphism, but even then there are fewer cases than I was taught initially.)
True. This correlates also with my experience.
@Pl45m4 said in Where are the .ui files?:
Have seen beginners creating everything, Qt and non-Qt related stuff, on the heap regardless... that could need some optimization :)
Could be "bad" teachers, wrong guides or courses... or just the wrong assumptions that it needs to be done this way.
People have heard "C++ is hard", "C++ is complicated", "Lots of bad black memory/pointer magic you can do"... which is kinda accurate... so they take the sledgehammer to crack a nut :D
And maybe they get "inpired" by other OOP languages like Java, where you don't have to manage your memory yourself and new'ing something does not come with any drawback, therefore it's most used.