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

Julien Cugnière julien.cugniere at gmail.com
Fri Feb 21 12:49:02 CET 2020


Le ven. 21 févr. 2020 à 12:29, Giuseppe D'Angelo via Development
<development at qt-project.org> a écrit :
>
> Il 21/02/20 12:15, Ville Voutilainen ha scritto:
> >> without any annotation is not what we want. We'd miss vital information and reduce readability.
> > Can you please explain what that vital information is?
>
> That control is leaving the "local" function, and *anything* can happen
> at that point. Including fun stuff, like finding "this" to be deleted
> (pgrep for QPointer.*this in QWidget code). It's an important annotation
> for a developer IMNSHO.

Isn't that true of any function call though ? Any function could end
up deleting this, or trigerring code in another thread, or anything.
For example, a normal function call could end up emiting a signal, and
as such, any function could be as dangerous as a signal.

The other problem with emit, is that it's not required. So its absence
doesn't mean a signal is not being emitted.


More information about the Development mailing list