[Development] A modest proposal: disable lower-case keywords (emit, foreach, forever, signals, slots) by default
Mitch Curtis
mitch.curtis at qt.io
Mon Feb 24 14:25:45 CET 2020
> -----Original Message-----
> From: Edward Welbourne <edward.welbourne at qt.io>
> Sent: Monday, 24 February 2020 1:35 PM
> To: Mitch Curtis <mitch.curtis at qt.io>
> Cc: Qt development mailing list <development at qt-project.org>; Lars Knoll
> <lars.knoll at qt.io>; Thiago Macieira <thiago.macieira at intel.com>
> Subject: Re: [Development] A modest proposal: disable lower-case
> keywords (emit, foreach, forever, signals, slots) by default
>
> Mitch Curtis (24 February 2020 13:22)
> > I don't think anyone has explained what that harm is yet.
>
> #define emit
>
> causes problems when you import a header that declares
>
> void emit(Type arg);
>
> and the compiler sees
>
> void (Type arg);
>
> and throws a wobbly.
>
> Eddy.
Sorry, I should have been more specific: I meant any form of emit (e.g. qEmit) that doesn't conflict. So far the arguments have been:
- It's ugly.
Purely subjective. Are code comments also ugly?
- It can be misused
I've never seen it happen. In the very few cases where it does, the consequences are so insignificant as to not even be worth considering.
- It's redundant
Only when the major/popular IDEs that a significant portion of Qt users use can highlight signal emissions. Until then, it's not redundant if it improves readability.
More information about the Development
mailing list