[Development] What kind of airplane we want to build?
Simon Everts
simoneverts at gmail.com
Thu Jan 21 23:55:58 CET 2016
2016-01-20 15:48 GMT+01:00 Ziller Eike <Eike.Ziller at theqtcompany.com>:
>
> > But Qt is available in D and Python, too, so ...
> > why do they use C++ if they so hate it?
>
> Maybe they don’t hate it, but still wished it had a less verbose API if you don’t need the verbosity.
Understanding why people choose c++ and Qt is important when you want
to look at the broader picture.
I work in Industrial Automation business and program mainly in c++/Qt,
c#/.NET/WPF and Js/HTML5/Polymer, targeting windows (WES) as that
seems to be the standard in the PLC / Automation industry. At least on
our branch...
I split them in language / framework / user-interface. As that's is
how I would compare them and choose the stack that's best for the job
that needs to be done.
If I would need to choose 1 stack to do it all it would be Qt, but
that's my personal opinion. For our business C#/.NET is the standard
go-to language on our department for desktop applications, simply
because all our programmers know it (easy to learn?) and it's easy to
hire programmers to jump-in if required. The same goes for Js/HTML5,
but we use that more for the mobile / crossplatform apps.
C++/Qt is used in our vision software doing image processing. We'd
like to have more control over the compiler / optimizations, no
garbage collector and no marshalling etc.
When I try to use Qt for other apps I'm not making friends with our
other programmers, but I actually find it easier to create small
applications with Qt because of the simple to use and consistant API.
I also find it harder to do things wrong as opposed to .NET. Also in
QtCreator it's very easy and fast to call up the API reference for
classes. With VisualStudio i always have to search, but maybe i'm
doing something wrong here. The point is that in .NET is always need
to look things up. In Qt the API more intuitive. It's important that
I'm comparing Qt and .NET/WPF here, not c++ and c#.
When comparing c++ and c# then I feel there is a large difference in
productivity. When I've done work in C# using VisualStudio with
Resharper or in Javascript/NodeJS, and then go back to c++ in
QtCreater I feel not very productive. Refactoring plays a role here,
but also language features. Downside of using VisualStudio with c++ is
the lack of intellisense for QML (I do love the progress done in
QtCreator though :) )
In C# it can be very productive to use lambda delegates as signal handlers.
Or in NodeJS a lambda as a callback: const client = net.connect({port:
8124}, () => { //'connect' listener }
Yesterday I tried to do something like this in a quick way for a
unit-test with with the connected event of the QWebSocket, Tried
connecting the signal to a lambda expression and it worked, but I
wonder if it saved me time making it :)
The point here is that if the API supports using those new language
features, than that already could make the language feel a lot more
productive.
Another example would be the chaining of promises in javascript (with
.then and.catch, is that possible with QFuture?) and or the
async/awaitable functions in c#.
When writing the user interface I definitely would prefer QML above
fighting browsers with HTML/CSS or chewing XML with XAML. Although I
sometimes would wish to have an easy way of styling standard
components like in CSS using classes and mixins.
Using qmake for small projects is also ok, it's easier to handle than
a visual studio project for version control. But if the project is
larger and needs to use subdirs, than i would have a hard time
explaining it to other programmers. But showing them a CMakeLists.txt
would scare them away i think ;)
These are just some observations from my point of view, maybe some
points are obvious, but I hope it can contribute to this discussion :)
Best regards,
Simon Everts
More information about the Development
mailing list