← Back to context

Comment by ryandrake

1 day ago

I was always kind of uncomfortable with MOC too, but I couldn't really articulate why. I consider it "wizardry that works but I don't understand" and I never bothered to go in and really understand it. The more I program though, the less I want any kind of "wizardry" in my code, whether or not I understand it.

Does this motivate me to go back into all my C++/Qt projects and try to un-MOC-ify them? No. But if I started a new project, maybe I'd try to do with without MOC and instead do more in handwritten C++ code.

MOC just seemed to me like an unnecessary hack - an unwanted layer between me and my C++ code that was hard to justify. I suppose it may have served more of a purpose in the early days of Qt (1st release was 1995), but IMO could/should have been phased out when C++11 came along with things like std::function well suited to signals & slots.