> Enter OOP. In classic OOP there are no function calls, you just send messages to object, and object dispatches > them "somehow"
I don't think that sort of anonymous, decoupled messaging is the definition of OOP. It is perhaps a description of the Observer Pattern, where the "publisher" has no idea what "subscribers" might be out there. But even then, in most OO languages, this is implemented through strongly-typed interfaces - so that if you tried to "publish" a message that wasn't defined, you would get a compile error. Most OO languages - Smalltalk, C++ C#, etc - are strongly typed and have robust compile-time checking, so you can't just accidentally type the wrong name in a method call or property access, and get no error. JavaScript is totally wild west in this regard - you can pretty much type anything and it won't complain. This is not an attribute of OO, it is an attribute of JavaScript. > Don't you have unit tests? Yes. But which is better, to be forced to use an inherently error-prone language (JavaScript) and rely on unit tests to clean up the mess, or to use a robust modern language (C++) and have less bugs to find and fix in the first place? Rob On Wed, Sep 28, 2016 at 10:43 AM, Konstantin Tokarev <annu...@yandex.ru> wrote: > > > 28.09.2016, 00:38, "Rob Allan" <rob_al...@trimble.com>: > > I tend to agree with André (not surprising as he largely agreed with > me!). I'm not so sure about Bo's opinion that there would be lots of pain > and complaint if the C++ classes provided a rich API to the Qt Quick object > model. It seems like the object model is becoming more stable, and given > that PIMPL hides most of the inner workings, it should be possible to > continue to evolve the API with judicious use of "deprecated" pragmas, etc. > Of course there will always be some "true" breaking changes that cause > compile errors for Qt users, but would there really be such an outcry about > that? Not sure. > > > > I quite like QML as a declarative markup language, but am less enthused > about JavaScript. It seems like kind of a toy programming language. I'm a > bit shocked that you can write "code" where you can happily call functions > or access properties that don't even exist on the target object. > > Enter OOP. In classic OOP there are no function calls, you just send > messages to object, and object dispatches them "somehow" > > Qt metaobject system has same properties, e.g. you can assign or read > non-existing properties, connect to missing slots, etc. > > >It is so easy to introduce a typo, or to remove a function or property > that is still needed somewhere else, and not realise it. You won't get a > compile error, or even a runtime crash, just strange behavior and > maybe something in the console log. And having functional code spread > across C++ and JavaScript seems less than ideal. I'm kind of getting used > it, and trying to do only layout-related stuff in the JavaScript, and > anything that is more related to application logic in C++. So you can > certainly make it work - but I still feel you could produce a more robust > application if all of your coding could be done in C++ and none in > JavaScript. > > Don't you have unit tests? >
_______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest