[Development] Using semicolons in JS (QML)

Mitch Curtis mitch.curtis at qt.io
Sun Oct 2 13:58:12 CEST 2016


I don't understand why people get so upset about topics like this. If it's not important to you and not worth your time, don't reply. It's kinda ironic that you're "wasting" time on it at all.

The people who do care about having some consistency to improve the quality of Qt should be able to discuss it without being accused of not having anything better to do.

Personally, I'm for using semicolons everywhere (docs, examples, module code, auto tests), in a similar fashion as many others have already replied (within blocks of code, where there's more than one statement). There are other conventions in Qt that I don't like, but I've gotten so used to following them that it's started to creep into my personal projects. :x

From: Development [mailto:development-bounces+mitch.curtis=qt.io at qt-project.org] On Behalf Of Kai Koehne
Sent: Friday, 30 September 2016 11:00 PM
To: Shawn Rutledge <Shawn.Rutledge at qt.io>; development at qt-project.org
Subject: Re: [Development] Using semicolons in JS (QML)


>> To make a proposal: Let's use semicolons in imperative JS parts of QML in our examples and documentation
>
> Back in Nokia times it was said that we shouldn't use semicolons, because it would speed up the parsing and reduce the size of resources slightly.  (Maybe you think performance isn't impacted by small > things like that, but we are at the same time investing effort into other "optimizations" for which I suspect the runtime performance impact may end up being similarly small.)  So I've been following the > no-semicolons convention ever since, except occasionally when C++ habits get the better of me.



Interesting. Indeed, I wouldn't have thought it makes any measurable difference. IIRC we had a qml mimizer once, I guess this is still around?



> If you think it's important, then write a reformatter tool and figure out how to use it as a git hook.  We are wasting time bikeshedding about coding style (do you really have nothing better to do?

>  all bugs in Qt are fixed?), and IMO the same argument applies in any kind of code: if there's no tool to do the reformatting, maybe it's not so important.



It's certainly not that important to me that I will spend a day on writing a git hook that then nobody will use ;) But a lot of programmers (including me) tend to care about code style consistency. So I was making a suggestion that costs us nothing, but leads to a sllightly more consistent documentation and examples in then end. In the same way as I couldn't care less whether to use tabs or spaces, or what the right indentation level is, as long as we stick to one.



(And yeah, I also enjoy bikeshedding sometimes, be it at the coffee machine or on a mailing list, even if not 'all Qt in bugs are fixed". And honestly speaking I do not see an issue with this.)



> It's just subjective and political, and not the kind of argument I'd ever want to start, personally.


Well, it's an entirely voluntary discussion ;)



Kai

________________________________
From: Development <development-bounces+kai.koehne=qt.io at qt-project.org<mailto:development-bounces+kai.koehne=qt.io at qt-project.org>> on behalf of Shawn Rutledge <Shawn.Rutledge at qt.io<mailto:Shawn.Rutledge at qt.io>>
Sent: Friday, September 30, 2016 5:43:57 PM
To: development at qt-project.org<mailto:development at qt-project.org>
Subject: Re: [Development] Using semicolons in JS (QML)

On 30 Sep 2016, at 14:19, Kai Koehne <Kai.Koehne at qt.io<mailto:Kai.Koehne at qt.io>> wrote:
> To make a proposal: Let's use semicolons in imperative JS parts of QML in our examples and documentation

Back in Nokia times it was said that we shouldn't use semicolons, because it would speed up the parsing and reduce the size of resources slightly.  (Maybe you think performance isn't impacted by small things like that, but we are at the same time investing effort into other "optimizations" for which I suspect the runtime performance impact may end up being similarly small.)  So I've been following the no-semicolons convention ever since, except occasionally when C++ habits get the better of me.

If you think it's important, then write a reformatter tool and figure out how to use it as a git hook.  We are wasting time bikeshedding about coding style (do you really have nothing better to do? all bugs in Qt are fixed?), and IMO the same argument applies in any kind of code: if there's no tool to do the reformatting, maybe it's not so important.  It's just subjective and political, and not the kind of argument I'd ever want to start, personally.

_______________________________________________
Development mailing list
Development at qt-project.org<mailto:Development at qt-project.org>
http://lists.qt-project.org/mailman/listinfo/development
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20161002/9cfda6a8/attachment.html>


More information about the Development mailing list