to not have this discussion again later.
Jan Arve
Fra: Development på
vegne av Simon Hausmann
Sendt: mandag 3. september 2018 16.31.07
Til: development@qt-project.org
Emne: Re: [Development] Naming convention for (scoped) enums
Am 31.08.18 um 11:56 schrieb
Am 31.08.18 um 11:56 schrieb Tor Arne Vestbø:
I think Simon’s reasoning in the review that spurred this discussion summarises
it nicely:
On 31 Aug 2018, at 10:24, Simon Hausmann (Code Review)
wrote:
Simon Hausmann has posted comments on this change.
Change subject: Convert QQEventPoint
Enumerations inside of classes makes dependency breaking harder. We don't use
that in Qt but users of our interface may do. It's still possible but much more
complex because you generally get much more dependencies. A simple header file
for enumerations instead can simply be included without
Hey,
> On 31 Aug 2018, at 14:50, Jan-Arve Sæther wrote:
>
> For me it seems that enum classes can help us create a more structured API,
> because they also gives more semantic information, e.g:
> QQuickPointerDevice::PointerType::Finger
> gives more information than
>
5 øre
---
Jan Arve Sæther
Senior Software Engineer
Fra: Development på
vegne av Tor Arne Vestbø
Sendt: fredag 31. august 2018 11.56.15
Til: Alex Blasche
Kopi: development@qt-project.org
Emne: Re: [Development] Naming convention for (scoped) enums
I thi
> On 31. Aug 2018, at 11:56, Tor Arne Vestbø wrote:
>
> I think Simon’s reasoning in the review that spurred this discussion
> summarises it nicely:
>
>> On 31 Aug 2018, at 10:24, Simon Hausmann (Code Review)
>> wrote:
>>
>> Simon Hausmann has posted comments on this change.
>>
>> Change
I think Simon’s reasoning in the review that spurred this discussion summarises
it nicely:
> On 31 Aug 2018, at 10:24, Simon Hausmann (Code Review)
> wrote:
>
> Simon Hausmann has posted comments on this change.
>
> Change subject: Convert QQEventPoint and QQPointerDevice enums to enum
> -Original Message-
> From: Development project.org> On Behalf Of Simon Hausmann
> > I don't consider the longer names detrimental for writability and usability.
> Writability is easily solved with code completion and readability is actually
> better
> because the type adds
Simon Hausmann (31 August 2018 11:01)
> If we decide to allow deciding on a case-by-case basis, then I encourage
> everyone to carefully look at newly introduced enums, their values and
> their context in the upcoming "API review season".
or, indeed, s/upcoming/ongoing/ ;-)
Eddy.
On 8/15/18 9:32 AM, Alex Blasche wrote:
-Original Message-
From: Tor Arne Vestbø
1. Scoped enums (enum class) for the sake of avoiding name clashes is useful for
global enums, but when the enum lives inside a class, the chance that we’ll see
a
naming clash is minor, and using scoped
On Wed, Aug 15, 2018 at 07:32:48AM +, Alex Blasche wrote:
> I don't think we have ever not permitted exceptions to official
> policy. Therefore, take it for granted that the policy can be ignored
> such as in the case presented by Allan. Having said that the default
> should be the use of
> On 15. Aug 2018, at 11:33, Tor Arne Vestbø wrote:
>
>
>
>> On 15 Aug 2018, at 09:32, Alex Blasche wrote:
>>
>>
>>
>>> -Original Message-
>>> From: Tor Arne Vestbø
>>> 1. Scoped enums (enum class) for the sake of avoiding name clashes is
>>> useful for
>>> global enums, but
> On 15 Aug 2018, at 09:32, Alex Blasche wrote:
>
>
>
>> -Original Message-
>> From: Tor Arne Vestbø
>> 1. Scoped enums (enum class) for the sake of avoiding name clashes is useful
>> for
>> global enums, but when the enum lives inside a class, the chance that we’ll
>> see a
>>
> -Original Message-
> From: Tor Arne Vestbø
> 1. Scoped enums (enum class) for the sake of avoiding name clashes is useful
> for
> global enums, but when the enum lives inside a class, the chance that we’ll
> see a
> naming clash is minor, and using scoped enums in that case arguably
> On 14 Aug 2018, at 15:29, Allan Sandfeld Jensen wrote:
>
> I agree, at least in most cases. There are still cases where I would prefer
> unscoped enums. For instance in my recent QColorSpace patch, I ended up using
> both types of enums under QColorSpace. The enum that represented
I’ve lost track of what you are arguing for here
To bring the discussion back, here are my main points:
1. Scoped enums (enum class) for the sake of avoiding name clashes is useful
for global enums, but when the enum lives inside a class, the chance that we’ll
see a naming clash is minor,
On Dienstag, 14. August 2018 14:27:27 CEST Alex Blasche wrote:
> > -Original Message-
> > From: Tor Arne Vestbø
>
>
>
> > > To quote the policy:
> > >
> > >
> > >
> > > "By comparison the following example illustrates the dangers of missing
> > > type
>
> > safety and giving general
> On 14. Aug 2018, at 13:18, Tor Arne Vestbø wrote:
>
>
>> On 14 Aug 2018, at 13:13, Eike Ziller wrote:
>>
>> http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2347.pdf states the
>> problems that were the driver for creating strongly typed enums:
>>
>> 1. Implicit conversion to
> -Original Message-
> From: Tor Arne Vestbø
> > To quote the policy:
> >
> > "By comparison the following example illustrates the dangers of missing type
> safety and giving general names to conventional enum values:"
> > ...
> > " One guideline for naming enum types is to repeat at
> On 14 Aug 2018, at 13:13, Eike Ziller wrote:
>
> http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2347.pdf states the
> problems that were the driver for creating strongly typed enums:
>
> 1. Implicit conversion to integer
> 2. Inability to specify underlying type
> On 14. Aug 2018, at 12:30, Tor Arne Vestbø wrote:
>
>>
>> On 14 Aug 2018, at 12:13, Alex Blasche wrote:
>>
>>
>>
>>> -Original Message-
>>> From: Tor Arne Vestbø
>>> That circular logic Or at least arguing that we should maintain the
>>> policy not
>>> because it makes sense,
> On 14 Aug 2018, at 12:13, Alex Blasche wrote:
>
>
>
>> -Original Message-
>> From: Tor Arne Vestbø
>> That circular logic Or at least arguing that we should maintain the policy
>> not
>> because it makes sense, but just because we’ve done so in the past.
>>
>> You are not
> -Original Message-
> From: Tor Arne Vestbø
> That circular logic Or at least arguing that we should maintain the policy
> not
> because it makes sense, but just because we’ve done so in the past.
>
> You are not questioning _why_ we have done so in the past (for decades as you
>
> On 14 Aug 2018, at 09:16, Alex Blasche wrote:
>
>> I
>> do not think that using class enums inside existing classes is a win for code
>> readability/writability:
>>
>> When you have
>>
>> switch (point->state()) {
>>
>> It's pretty obvious what case QQuickEventPoint::Pressed: refers to.
> -Original Message-
> From: Tor Arne Vestbø
> Sent: Monday, 13 August 2018 16:40
> To: Alex Blasche
> Cc: development@qt-project.org; Simon Hausmann
> Subject: Re: [Development] Naming convention for (scoped) enums
>
> Bringing this up again in light of e.
On Aug 13, 2018, at 18:12, Giuseppe D'Angelo via Development
wrote:
> Il 13/08/2018 16:40, Tor Arne Vestbø ha scritto:
>> Or:
>> if (event->device()->pointerType() != QQuickPointerDevice::Finger
>> Gives me all the info I need, and having to type or read this instead is
>> worse in my
Il 13/08/2018 16:40, Tor Arne Vestbø ha scritto:
>>> Or:
>>> if (event->device()->pointerType() != QQuickPointerDevice::Finger
>>> Gives me all the info I need, and having to type or read this
>>> instead is worse in my opinion:
On 13 Aug 2018, at 18:12, Giuseppe D'Angelo via Development
On 13 Aug 2018, at 18:12, Giuseppe D'Angelo via Development
wrote:
>
> Il 13/08/2018 16:40, Tor Arne Vestbø ha scritto:
>> Or:
>> if (event->device()->pointerType() != QQuickPointerDevice::Finger
>> Gives me all the info I need, and having to type or read this instead is
>> worse in my
Il 13/08/2018 16:40, Tor Arne Vestbø ha scritto:
Or:
if (event->device()->pointerType() != QQuickPointerDevice::Finger
Gives me all the info I need, and having to type or read this instead is worse
in my opinion:
This is actually against the old "non-enum class" coding standards: one
Tuesday, 22 May 2018 9:30:18 AM
> To: Christian Kandeler
> Cc: Qt development mailing list
> Subject: Re: [Development] Naming convention for (scoped) enums
>
>
>
>> On 17 May 2018, at 11:35, Christian Kandeler
>> wrote:
>>
>> On Thu, 17 May 2018 08:14:15
sday, 22 May 2018 9:30:18 AM
To: Christian Kandeler
Cc: Qt development mailing list
Subject: Re: [Development] Naming convention for (scoped) enums
> On 17 May 2018, at 11:35, Christian Kandeler <christian.kande...@qt.io> wrote:
>
> On Thu, 17 May 2018 08:14:15 +
> Alex Bl
> On 17 May 2018, at 11:35, Christian Kandeler wrote:
>
> On Thu, 17 May 2018 08:14:15 +
> Alex Blasche wrote:
>
>> The naming conventions for enums state that each enum value name must repeat
>> a part of the enum Type name (for
On Thu, 17 May 2018 08:14:15 +
Alex Blasche wrote:
> The naming conventions for enums state that each enum value name must repeat
> a part of the enum Type name (for details see
> https://wiki.qt.io/API_Design_Principles#Naming_Enum_Types_and_Values)
>
> In case
> On 17 May 2018, at 10:14, Alex Blasche wrote:
>
> Hi,
>
> The naming conventions for enums state that each enum value name must repeat
> a part of the enum Type name (for details see
> https://wiki.qt.io/API_Design_Principles#Naming_Enum_Types_and_Values)
>
> In
Il 17/05/2018 10:14, Alex Blasche ha scritto:
In case of scoped enums this becomes a superfluous rule as the type has to be
mentioned anyway. Does anybody object to modifying the above definition by
adding an exception for scoped enums where you do not have to repeat a part of
the enum type
Hi,
The naming conventions for enums state that each enum value name must repeat a
part of the enum Type name (for details see
https://wiki.qt.io/API_Design_Principles#Naming_Enum_Types_and_Values)
In case of scoped enums this becomes a superfluous rule as the type has to be
mentioned anyway.
36 matches
Mail list logo