On Wed, Sep 28, 2016 at 12:43:37AM +0300, Konstantin Tokarev wrote: > > 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.
And that's why one doesn't use the MO system *extensively* in non-trivial applications. It's powerful and dangerous. It's extremely useful to bridge some gaps that the core language left, like "soft" dependencies between plugins or introspection for generated bindings. Beyond that? No, thanks. Definitely. > >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? To catch mis-typed identifiers? No. Why should I? I have a compiler. Andre' _______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest