[Development] A modest proposal: disable lower-case keywords (emit, foreach, forever, signals, slots) by default

Christian Kandeler Christian.Kandeler at qt.io
Fri Feb 21 14:27:48 CET 2020


On Fri, 21 Feb 2020 15:00:53 +0200
Ville Voutilainen <ville.voutilainen at gmail.com> wrote:

> On Fri, 21 Feb 2020 at 14:58, Sérgio Martins <sergio.martins at kdab.com> wrote:
> > > Why do I need to know that it's a signal being emitted? How is that
> > > "vital information"? I could just as well
> > > invoke any other callback, but I find myself not exactly yearning for
> > > being able to write
> > > callback somethingHappened();
> >
> >
> > Signals have different semantics than regular functions.
> 
> In what way?

They typically call back into "upper layers", which is worth considering on the calling side, e.g. due to the danger of inconsistent state getting accessed if you don't emit the signal at the end of a function, to name just one tyical pitfall.
I, for one, definitely want to see whether I am emitting a signal or not.


Christian


More information about the Development mailing list