[Development] The age-old T* foo vs. T *foo
Vitaly Fanaskov
vitaly.fanaskov at qt.io
Fri Oct 18 12:02:29 CEST 2019
Hi,
I think that this discussion is pointless. Style is mostly the matter of
preferences, but:
1) We have a huge code base with the certain code style.
2) We have official guidelines.
3) We have a tool for auto code formatting.
I don't see any good reasons to change the entire code base or make it
inconsistent, and adjust docs and tools. If a person is not used to the
Qt style, he or she might use clang formatting tool for this.
On 10/17/19 8:04 PM, Ville Voutilainen wrote:
> Since we are about to do a major version upgrade, should be stop being
> a special snowflake in the C++ world and start attaching pointer-stars
> and reference-ampersands to the type instead of to the variable?
>
> As a quick example of how our current style is just odd, consider
>
> for (auto &&x : oink)
>
> Sure, that's in accordance with our style. It looks very out of place when
> coming back to our code after adventures in other code. Quick reading
> of it tends to suggest that it's a by-value thing since quick eyes see
> auto without any decorations.
>
> I don't expect the transition, should we agree to have it, to be easy
> for people accustomed to the Qt style. I also don't have any sort of numbers
> about whether our style is used elsewhere. In contrast, people with lots
> of exposure to non-Qt style tend to have to fight ours, it just doesn't come
> naturally.
> _______________________________________________
> Development mailing list
> Development at qt-project.org
> https://lists.qt-project.org/listinfo/development
--
Best Regards,
Fanaskov Vitaly
Senior Software Engineer
The Qt Company / Qt Quick and Widgets Team
More information about the Development
mailing list