[Qt5-feedback] Better support for asynchronous code
Peter Kümmel
syntheticpp at gmx.net
Sun Jun 5 11:56:28 CEST 2011
Very often it is needed to write asynchronous code
(eg. when networking). Qt provides all necessary
low level stuff: signal, slots, threads,
queued connections.
But the code which implements the asynchronous behavior
is less readable than the code of a synchronous control
flow: Lot of small functions (the slots), several threads,
signals, connections.
This way the risk is high to end up with a modern form of
"Spaghetti Code". In case of Qt I would call it the
"Signal Slot Massacre". (Could eventually be avoided by using
a state machine)
What I like to see in Qt5 is better support to produce
readable asynchronous code.
Maybe other languages (Erlang, Objective-C, Scala, ...) or
libraries (Grand Central Dispatch, Threading Building Blocks)
could inspire solutions which make Qt/C++ better prepared
for asynchronous program flows.
Once I added a more comfortable syntax for message passing to QObjects:
http://lists.qt.nokia.com/pipermail/qt-interest/2009-September/012633.html
But I think there are many other ways to improve Qt/C++ at this topic.
Peter
More information about the Qt5-feedback
mailing list