Re: [webkit-dev] Formatting style for inline comments in Python code

2017-11-03 Thread Aakash Jain


> On Nov 3, 2017, at 9:20 AM, Maciej Stachowiak  wrote:
> 
> 
> 
>> On Nov 3, 2017, at 8:59 AM, Aakash Jain > > wrote:
>> 
>> 
>> 
>>> On Nov 2, 2017, at 8:45 PM, Maciej Stachowiak >> > wrote:
>>> 
>>> 
>>> 
 On Nov 2, 2017, at 5:41 PM, Aakash Jain > wrote:
 
 
 
> On Oct 26, 2017, at 10:21 AM, Maciej Stachowiak  > wrote:
> 
> 
> 
>> On Oct 26, 2017, at 10:20 AM, Eric Carlson > > wrote:
>> 
>> 
>> 
>>> On Oct 26, 2017, at 9:50 AM, Brian Burg >> > wrote:
>>> 
>>> 
>>> 
 2017/10/26 午前9:21、Alexey Proskuryakov >のメール:
 
 
 
> 25 окт. 2017 г., в 18:21, Michael Catanzaro  > написал(а):
> 
> On Wed, Oct 25, 2017 at 4:58 PM, Aakash Jain  > wrote:
>> Does anyone else has any opinion/preference for this?
> 
> The number of spaces before a comment really does not matter, but my 
> $0.02: PEP8 is an extremely common style for Python programs that all 
> Python developers are familiar with. I would follow that, and forget 
> about trying to adapt WebKit C++ style to an unrelated language. 
> Trying to adapt the style checker to ignore particular PEP8 rules 
> seems like wasted effort.
 
 
 There is definitely a number of PEP8 rules that we want to follow. But 
 I don't think that there is anything about the two space before 
 comment rule that makes it particularly fitting for Python.
>>> 
>>> This is entirely subjective, so: why differ from the vast majority of 
>>> all other Python code in existence, just to be different? What's the 
>>> point? PEP8 adherence is nearly universal among projects on PyPi, at 
>>> least among those that run style linters.
>>> 
 I think that we should target WebKit developers with the coding style 
 as much as possible, not Python developers. As we all agree on the one 
 space rule elsewhere, why make a part of the code base uncomfortably 
 different for most WebKit developers?
>>> 
>>> I don't understand the distinction between WebKit developers and Python 
>>> developers. Am I not a C++ developer and web developer as well?
>>> 
>>> If "WebKit developers" want to write Python code, perhaps they should 
>>> learn the Pythonic idioms of the language, just as they would use 
>>> idioms of Perl, JavaScript, and C++. For better or worse, PEP8 encodes 
>>> many of these idioms.
>>> 
>>> If someone already knows Python, they will be tripped up by this 
>>> divergence and waste some minutes trying to satisfy the style checker, 
>>> or just ignore it. If they don't know Python well, then they are being 
>>> conditioned to follow some variant that has no benefit and is different 
>>> from what they would see in any other Python code.
>>> 
>>> I see no value in adding arbitrary barriers to new contributions in 
>>> Python code. The code has enough problems as-is, we don't need to make 
>>> up our own for some pretense of consistency. We import other Python 
>>> projects into the tree, and they follow PEP8, so what was proposed is 
>>> to make the Python code in the tree *less* internally consistent.
>>> 
>> 
>> +1
> 
 
 
> I'm very used to WebKit style for C++, and I agree that we should use 
> PEP8 style for Python even where it differs from our C++ style.
 
 I personally prefer following PEP8 while writing python.
 
 Since people have opinions for both C++ style as well as PEP8 style (and 
 comment spacing is anyways a minor thing), I am going to go with Maciej 
 and use PEP8 style for Python (which is the style we have already been 
 following in webkitpy).
>>> 
>>> I mean, I agree with this approach, but don't do it just because I said it. 
>>> :-) These days, I code less C++ and less Python in WebKit than most people 
>>> on this thread.
>> 
>> I am not doing it only because you said this. I discussed it with Alexey 
>> yesterday, and he was fine either way. I personally prefer PEP8. Brian Burg, 
>> Michael Catanzaro and Eric Carlson also supported this. That makes most of 
>> us (who expressed their opinion) favor this approach.
> 
> Sounds good. Do we need to update our style guidelines at all? Maybe just 
> state somewhere that for Python our style is PEP8?

Yeah, I think we should 

Re: [webkit-dev] Formatting style for inline comments in Python code

2017-11-03 Thread Maciej Stachowiak


> On Nov 3, 2017, at 8:59 AM, Aakash Jain  wrote:
> 
> 
> 
>> On Nov 2, 2017, at 8:45 PM, Maciej Stachowiak > > wrote:
>> 
>> 
>> 
>>> On Nov 2, 2017, at 5:41 PM, Aakash Jain >> > wrote:
>>> 
>>> 
>>> 
 On Oct 26, 2017, at 10:21 AM, Maciej Stachowiak > wrote:
 
 
 
> On Oct 26, 2017, at 10:20 AM, Eric Carlson  > wrote:
> 
> 
> 
>> On Oct 26, 2017, at 9:50 AM, Brian Burg > > wrote:
>> 
>> 
>> 
>>> 2017/10/26 午前9:21、Alexey Proskuryakov >> >のメール:
>>> 
>>> 
>>> 
 25 окт. 2017 г., в 18:21, Michael Catanzaro > написал(а):
 
 On Wed, Oct 25, 2017 at 4:58 PM, Aakash Jain > wrote:
> Does anyone else has any opinion/preference for this?
 
 The number of spaces before a comment really does not matter, but my 
 $0.02: PEP8 is an extremely common style for Python programs that all 
 Python developers are familiar with. I would follow that, and forget 
 about trying to adapt WebKit C++ style to an unrelated language. 
 Trying to adapt the style checker to ignore particular PEP8 rules 
 seems like wasted effort.
>>> 
>>> 
>>> There is definitely a number of PEP8 rules that we want to follow. But 
>>> I don't think that there is anything about the two space before comment 
>>> rule that makes it particularly fitting for Python.
>> 
>> This is entirely subjective, so: why differ from the vast majority of 
>> all other Python code in existence, just to be different? What's the 
>> point? PEP8 adherence is nearly universal among projects on PyPi, at 
>> least among those that run style linters.
>> 
>>> I think that we should target WebKit developers with the coding style 
>>> as much as possible, not Python developers. As we all agree on the one 
>>> space rule elsewhere, why make a part of the code base uncomfortably 
>>> different for most WebKit developers?
>> 
>> I don't understand the distinction between WebKit developers and Python 
>> developers. Am I not a C++ developer and web developer as well?
>> 
>> If "WebKit developers" want to write Python code, perhaps they should 
>> learn the Pythonic idioms of the language, just as they would use idioms 
>> of Perl, JavaScript, and C++. For better or worse, PEP8 encodes many of 
>> these idioms.
>> 
>> If someone already knows Python, they will be tripped up by this 
>> divergence and waste some minutes trying to satisfy the style checker, 
>> or just ignore it. If they don't know Python well, then they are being 
>> conditioned to follow some variant that has no benefit and is different 
>> from what they would see in any other Python code.
>> 
>> I see no value in adding arbitrary barriers to new contributions in 
>> Python code. The code has enough problems as-is, we don't need to make 
>> up our own for some pretense of consistency. We import other Python 
>> projects into the tree, and they follow PEP8, so what was proposed is to 
>> make the Python code in the tree *less* internally consistent.
>> 
> 
> +1
 
>>> 
>>> 
 I'm very used to WebKit style for C++, and I agree that we should use PEP8 
 style for Python even where it differs from our C++ style.
>>> 
>>> I personally prefer following PEP8 while writing python.
>>> 
>>> Since people have opinions for both C++ style as well as PEP8 style (and 
>>> comment spacing is anyways a minor thing), I am going to go with Maciej and 
>>> use PEP8 style for Python (which is the style we have already been 
>>> following in webkitpy).
>> 
>> I mean, I agree with this approach, but don't do it just because I said it. 
>> :-) These days, I code less C++ and less Python in WebKit than most people 
>> on this thread.
> 
> I am not doing it only because you said this. I discussed it with Alexey 
> yesterday, and he was fine either way. I personally prefer PEP8. Brian Burg, 
> Michael Catanzaro and Eric Carlson also supported this. That makes most of us 
> (who expressed their opinion) favor this approach.

Sounds good. Do we need to update our style guidelines at all? Maybe just state 
somewhere that for Python our style is PEP8?

 - Maciej

___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev


Re: [webkit-dev] Formatting style for inline comments in Python code

2017-11-03 Thread Aakash Jain


> On Nov 2, 2017, at 8:45 PM, Maciej Stachowiak  wrote:
> 
> 
> 
>> On Nov 2, 2017, at 5:41 PM, Aakash Jain > > wrote:
>> 
>> 
>> 
>>> On Oct 26, 2017, at 10:21 AM, Maciej Stachowiak >> > wrote:
>>> 
>>> 
>>> 
 On Oct 26, 2017, at 10:20 AM, Eric Carlson > wrote:
 
 
 
> On Oct 26, 2017, at 9:50 AM, Brian Burg  > wrote:
> 
> 
> 
>> 2017/10/26 午前9:21、Alexey Proskuryakov > >のメール:
>> 
>> 
>> 
>>> 25 окт. 2017 г., в 18:21, Michael Catanzaro >> > написал(а):
>>> 
>>> On Wed, Oct 25, 2017 at 4:58 PM, Aakash Jain >> > wrote:
 Does anyone else has any opinion/preference for this?
>>> 
>>> The number of spaces before a comment really does not matter, but my 
>>> $0.02: PEP8 is an extremely common style for Python programs that all 
>>> Python developers are familiar with. I would follow that, and forget 
>>> about trying to adapt WebKit C++ style to an unrelated language. Trying 
>>> to adapt the style checker to ignore particular PEP8 rules seems like 
>>> wasted effort.
>> 
>> 
>> There is definitely a number of PEP8 rules that we want to follow. But I 
>> don't think that there is anything about the two space before comment 
>> rule that makes it particularly fitting for Python.
> 
> This is entirely subjective, so: why differ from the vast majority of all 
> other Python code in existence, just to be different? What's the point? 
> PEP8 adherence is nearly universal among projects on PyPi, at least among 
> those that run style linters.
> 
>> I think that we should target WebKit developers with the coding style as 
>> much as possible, not Python developers. As we all agree on the one 
>> space rule elsewhere, why make a part of the code base uncomfortably 
>> different for most WebKit developers?
> 
> I don't understand the distinction between WebKit developers and Python 
> developers. Am I not a C++ developer and web developer as well?
> 
> If "WebKit developers" want to write Python code, perhaps they should 
> learn the Pythonic idioms of the language, just as they would use idioms 
> of Perl, JavaScript, and C++. For better or worse, PEP8 encodes many of 
> these idioms.
> 
> If someone already knows Python, they will be tripped up by this 
> divergence and waste some minutes trying to satisfy the style checker, or 
> just ignore it. If they don't know Python well, then they are being 
> conditioned to follow some variant that has no benefit and is different 
> from what they would see in any other Python code.
> 
> I see no value in adding arbitrary barriers to new contributions in 
> Python code. The code has enough problems as-is, we don't need to make up 
> our own for some pretense of consistency. We import other Python projects 
> into the tree, and they follow PEP8, so what was proposed is to make the 
> Python code in the tree *less* internally consistent.
> 
 
 +1
>>> 
>> 
>> 
>>> I'm very used to WebKit style for C++, and I agree that we should use PEP8 
>>> style for Python even where it differs from our C++ style.
>> 
>> I personally prefer following PEP8 while writing python.
>> 
>> Since people have opinions for both C++ style as well as PEP8 style (and 
>> comment spacing is anyways a minor thing), I am going to go with Maciej and 
>> use PEP8 style for Python (which is the style we have already been following 
>> in webkitpy).
> 
> I mean, I agree with this approach, but don't do it just because I said it. 
> :-) These days, I code less C++ and less Python in WebKit than most people on 
> this thread.

I am not doing it only because you said this. I discussed it with Alexey 
yesterday, and he was fine either way. I personally prefer PEP8. Brian Burg, 
Michael Catanzaro and Eric Carlson also supported this. That makes most of us 
(who expressed their opinion) favor this approach.

> 
> Different number of spaces before a same-line comment has never really fazed 
> me, the fact that the comment delimiter is different is much more noticeable.
> 
> 

___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev


Re: [webkit-dev] Formatting style for inline comments in Python code

2017-11-02 Thread Maciej Stachowiak


> On Nov 2, 2017, at 5:41 PM, Aakash Jain  wrote:
> 
> 
> 
>> On Oct 26, 2017, at 10:21 AM, Maciej Stachowiak > > wrote:
>> 
>> 
>> 
>>> On Oct 26, 2017, at 10:20 AM, Eric Carlson >> > wrote:
>>> 
>>> 
>>> 
 On Oct 26, 2017, at 9:50 AM, Brian Burg > wrote:
 
 
 
> 2017/10/26 午前9:21、Alexey Proskuryakov  >のメール:
> 
> 
> 
>> 25 окт. 2017 г., в 18:21, Michael Catanzaro > > написал(а):
>> 
>> On Wed, Oct 25, 2017 at 4:58 PM, Aakash Jain > > wrote:
>>> Does anyone else has any opinion/preference for this?
>> 
>> The number of spaces before a comment really does not matter, but my 
>> $0.02: PEP8 is an extremely common style for Python programs that all 
>> Python developers are familiar with. I would follow that, and forget 
>> about trying to adapt WebKit C++ style to an unrelated language. Trying 
>> to adapt the style checker to ignore particular PEP8 rules seems like 
>> wasted effort.
> 
> 
> There is definitely a number of PEP8 rules that we want to follow. But I 
> don't think that there is anything about the two space before comment 
> rule that makes it particularly fitting for Python.
 
 This is entirely subjective, so: why differ from the vast majority of all 
 other Python code in existence, just to be different? What's the point? 
 PEP8 adherence is nearly universal among projects on PyPi, at least among 
 those that run style linters.
 
> I think that we should target WebKit developers with the coding style as 
> much as possible, not Python developers. As we all agree on the one space 
> rule elsewhere, why make a part of the code base uncomfortably different 
> for most WebKit developers?
 
 I don't understand the distinction between WebKit developers and Python 
 developers. Am I not a C++ developer and web developer as well?
 
 If "WebKit developers" want to write Python code, perhaps they should 
 learn the Pythonic idioms of the language, just as they would use idioms 
 of Perl, JavaScript, and C++. For better or worse, PEP8 encodes many of 
 these idioms.
 
 If someone already knows Python, they will be tripped up by this 
 divergence and waste some minutes trying to satisfy the style checker, or 
 just ignore it. If they don't know Python well, then they are being 
 conditioned to follow some variant that has no benefit and is different 
 from what they would see in any other Python code.
 
 I see no value in adding arbitrary barriers to new contributions in Python 
 code. The code has enough problems as-is, we don't need to make up our own 
 for some pretense of consistency. We import other Python projects into the 
 tree, and they follow PEP8, so what was proposed is to make the Python 
 code in the tree *less* internally consistent.
 
>>> 
>>> +1
>> 
> 
> 
>> I'm very used to WebKit style for C++, and I agree that we should use PEP8 
>> style for Python even where it differs from our C++ style.
> 
> I personally prefer following PEP8 while writing python.
> 
> Since people have opinions for both C++ style as well as PEP8 style (and 
> comment spacing is anyways a minor thing), I am going to go with Maciej and 
> use PEP8 style for Python (which is the style we have already been following 
> in webkitpy).

I mean, I agree with this approach, but don't do it just because I said it. :-) 
These days, I code less C++ and less Python in WebKit than most people on this 
thread.

Different number of spaces before a same-line comment has never really fazed 
me, the fact that the comment delimiter is different is much more noticeable.


___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev


Re: [webkit-dev] Formatting style for inline comments in Python code

2017-11-02 Thread Aakash Jain


> On Oct 26, 2017, at 10:21 AM, Maciej Stachowiak  wrote:
> 
> 
> 
>> On Oct 26, 2017, at 10:20 AM, Eric Carlson > > wrote:
>> 
>> 
>> 
>>> On Oct 26, 2017, at 9:50 AM, Brian Burg >> > wrote:
>>> 
>>> 
>>> 
 2017/10/26 午前9:21、Alexey Proskuryakov >のメール:
 
 
 
> 25 окт. 2017 г., в 18:21, Michael Catanzaro  > написал(а):
> 
> On Wed, Oct 25, 2017 at 4:58 PM, Aakash Jain  > wrote:
>> Does anyone else has any opinion/preference for this?
> 
> The number of spaces before a comment really does not matter, but my 
> $0.02: PEP8 is an extremely common style for Python programs that all 
> Python developers are familiar with. I would follow that, and forget 
> about trying to adapt WebKit C++ style to an unrelated language. Trying 
> to adapt the style checker to ignore particular PEP8 rules seems like 
> wasted effort.
 
 
 There is definitely a number of PEP8 rules that we want to follow. But I 
 don't think that there is anything about the two space before comment rule 
 that makes it particularly fitting for Python.
>>> 
>>> This is entirely subjective, so: why differ from the vast majority of all 
>>> other Python code in existence, just to be different? What's the point? 
>>> PEP8 adherence is nearly universal among projects on PyPi, at least among 
>>> those that run style linters.
>>> 
 I think that we should target WebKit developers with the coding style as 
 much as possible, not Python developers. As we all agree on the one space 
 rule elsewhere, why make a part of the code base uncomfortably different 
 for most WebKit developers?
>>> 
>>> I don't understand the distinction between WebKit developers and Python 
>>> developers. Am I not a C++ developer and web developer as well?
>>> 
>>> If "WebKit developers" want to write Python code, perhaps they should learn 
>>> the Pythonic idioms of the language, just as they would use idioms of Perl, 
>>> JavaScript, and C++. For better or worse, PEP8 encodes many of these idioms.
>>> 
>>> If someone already knows Python, they will be tripped up by this divergence 
>>> and waste some minutes trying to satisfy the style checker, or just ignore 
>>> it. If they don't know Python well, then they are being conditioned to 
>>> follow some variant that has no benefit and is different from what they 
>>> would see in any other Python code.
>>> 
>>> I see no value in adding arbitrary barriers to new contributions in Python 
>>> code. The code has enough problems as-is, we don't need to make up our own 
>>> for some pretense of consistency. We import other Python projects into the 
>>> tree, and they follow PEP8, so what was proposed is to make the Python code 
>>> in the tree *less* internally consistent.
>>> 
>> 
>> +1
> 


> I'm very used to WebKit style for C++, and I agree that we should use PEP8 
> style for Python even where it differs from our C++ style.

I personally prefer following PEP8 while writing python.

Since people have opinions for both C++ style as well as PEP8 style (and 
comment spacing is anyways a minor thing), I am going to go with Maciej and use 
PEP8 style for Python (which is the style we have already been following in 
webkitpy).

-Aakash

> 
>  - Maciej
> 
> 
> ___
> webkit-dev mailing list
> webkit-dev@lists.webkit.org 
> https://lists.webkit.org/mailman/listinfo/webkit-dev 
> 
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev


Re: [webkit-dev] Formatting style for inline comments in Python code

2017-10-26 Thread Ryosuke Niwa
On Thu, Oct 26, 2017 at 11:05 AM, Alexey Proskuryakov  wrote:

>
>
> 26 окт. 2017 г., в 9:50, Brian Burg  написал(а):
>
> why differ from the vast majority of all other Python code in existence,
> just to be different? What's the point?
>
>
> My point is that people familiar with all other Python code in existence
> will not be hacking on webkitpy. It's WebKit C++ developers who we want to
> contribute to webkitpy more, and super arbitrary differences that are
> impossible to rationalize are an unnecessary barrier to entry.
>

I'm with Alexey here. We don't have a problem of many non-WebKit
contributor Python developers wanting but not being able to contribute to
webkitpy; we have a problem where nobody who hacks on C++ code can make
changes they want to make to webkitpy.

We should lower the barrier to hack on webkitpy as much as possible, and
that involves matching WebKit coding style guideline as much as possible.

> If "WebKit developers" want to write Python code, perhaps they should
> learn the Pythonic idioms of the language
>
> For what purpose? I don't see why having two spaces before a comment is a
useful idioms of Python to adopt. Semantics such as using a list
comprehension instead of for/while loop and using duck typing instead of
creating a completed class hierarchy is a lot more important idioms of
Python.

- R. Niwa
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev


Re: [webkit-dev] Formatting style for inline comments in Python code

2017-10-26 Thread Alexey Proskuryakov


> 26 окт. 2017 г., в 9:50, Brian Burg  написал(а):
> 
> why differ from the vast majority of all other Python code in existence, just 
> to be different? What's the point?


My point is that people familiar with all other Python code in existence will 
not be hacking on webkitpy. It's WebKit C++ developers who we want to 
contribute to webkitpy more, and super arbitrary differences that are 
impossible to rationalize are an unnecessary barrier to entry.

> If "WebKit developers" want to write Python code, perhaps they should learn 
> the Pythonic idioms of the language

I don't know if many people have the muscle memory to type a different number 
of spaces before a comment. I think that in practice, it's just about more 
iterations before EWS style checker is happy. What are we gaining by this?

- Alexey

___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev


Re: [webkit-dev] Formatting style for inline comments in Python code

2017-10-26 Thread Maciej Stachowiak


> On Oct 26, 2017, at 10:20 AM, Eric Carlson  wrote:
> 
> 
> 
>> On Oct 26, 2017, at 9:50 AM, Brian Burg > > wrote:
>> 
>> 
>> 
>>> 2017/10/26 午前9:21、Alexey Proskuryakov >> >のメール:
>>> 
>>> 
>>> 
 25 окт. 2017 г., в 18:21, Michael Catanzaro > написал(а):
 
 On Wed, Oct 25, 2017 at 4:58 PM, Aakash Jain > wrote:
> Does anyone else has any opinion/preference for this?
 
 The number of spaces before a comment really does not matter, but my 
 $0.02: PEP8 is an extremely common style for Python programs that all 
 Python developers are familiar with. I would follow that, and forget about 
 trying to adapt WebKit C++ style to an unrelated language. Trying to adapt 
 the style checker to ignore particular PEP8 rules seems like wasted effort.
>>> 
>>> 
>>> There is definitely a number of PEP8 rules that we want to follow. But I 
>>> don't think that there is anything about the two space before comment rule 
>>> that makes it particularly fitting for Python.
>> 
>> This is entirely subjective, so: why differ from the vast majority of all 
>> other Python code in existence, just to be different? What's the point? PEP8 
>> adherence is nearly universal among projects on PyPi, at least among those 
>> that run style linters.
>> 
>>> I think that we should target WebKit developers with the coding style as 
>>> much as possible, not Python developers. As we all agree on the one space 
>>> rule elsewhere, why make a part of the code base uncomfortably different 
>>> for most WebKit developers?
>> 
>> I don't understand the distinction between WebKit developers and Python 
>> developers. Am I not a C++ developer and web developer as well?
>> 
>> If "WebKit developers" want to write Python code, perhaps they should learn 
>> the Pythonic idioms of the language, just as they would use idioms of Perl, 
>> JavaScript, and C++. For better or worse, PEP8 encodes many of these idioms.
>> 
>> If someone already knows Python, they will be tripped up by this divergence 
>> and waste some minutes trying to satisfy the style checker, or just ignore 
>> it. If they don't know Python well, then they are being conditioned to 
>> follow some variant that has no benefit and is different from what they 
>> would see in any other Python code.
>> 
>> I see no value in adding arbitrary barriers to new contributions in Python 
>> code. The code has enough problems as-is, we don't need to make up our own 
>> for some pretense of consistency. We import other Python projects into the 
>> tree, and they follow PEP8, so what was proposed is to make the Python code 
>> in the tree *less* internally consistent.
>> 
> 
> +1

I'm very used to WebKit style for C++, and I agree that we should use PEP8 
style for Python even where it differs from our C++ style.

 - Maciej


___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev


Re: [webkit-dev] Formatting style for inline comments in Python code

2017-10-26 Thread Eric Carlson


> On Oct 26, 2017, at 9:50 AM, Brian Burg  wrote:
> 
> 
> 
>> 2017/10/26 午前9:21、Alexey Proskuryakov > >のメール:
>> 
>> 
>> 
>>> 25 окт. 2017 г., в 18:21, Michael Catanzaro >> > написал(а):
>>> 
>>> On Wed, Oct 25, 2017 at 4:58 PM, Aakash Jain >> > wrote:
 Does anyone else has any opinion/preference for this?
>>> 
>>> The number of spaces before a comment really does not matter, but my $0.02: 
>>> PEP8 is an extremely common style for Python programs that all Python 
>>> developers are familiar with. I would follow that, and forget about trying 
>>> to adapt WebKit C++ style to an unrelated language. Trying to adapt the 
>>> style checker to ignore particular PEP8 rules seems like wasted effort.
>> 
>> 
>> There is definitely a number of PEP8 rules that we want to follow. But I 
>> don't think that there is anything about the two space before comment rule 
>> that makes it particularly fitting for Python.
> 
> This is entirely subjective, so: why differ from the vast majority of all 
> other Python code in existence, just to be different? What's the point? PEP8 
> adherence is nearly universal among projects on PyPi, at least among those 
> that run style linters.
> 
>> I think that we should target WebKit developers with the coding style as 
>> much as possible, not Python developers. As we all agree on the one space 
>> rule elsewhere, why make a part of the code base uncomfortably different for 
>> most WebKit developers?
> 
> I don't understand the distinction between WebKit developers and Python 
> developers. Am I not a C++ developer and web developer as well?
> 
> If "WebKit developers" want to write Python code, perhaps they should learn 
> the Pythonic idioms of the language, just as they would use idioms of Perl, 
> JavaScript, and C++. For better or worse, PEP8 encodes many of these idioms.
> 
> If someone already knows Python, they will be tripped up by this divergence 
> and waste some minutes trying to satisfy the style checker, or just ignore 
> it. If they don't know Python well, then they are being conditioned to follow 
> some variant that has no benefit and is different from what they would see in 
> any other Python code.
> 
> I see no value in adding arbitrary barriers to new contributions in Python 
> code. The code has enough problems as-is, we don't need to make up our own 
> for some pretense of consistency. We import other Python projects into the 
> tree, and they follow PEP8, so what was proposed is to make the Python code 
> in the tree *less* internally consistent.
> 

+1

eric


___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev


Re: [webkit-dev] Formatting style for inline comments in Python code

2017-10-26 Thread Brian Burg


> 2017/10/26 午前9:21、Alexey Proskuryakov のメール:
> 
> 
> 
>> 25 окт. 2017 г., в 18:21, Michael Catanzaro > > написал(а):
>> 
>> On Wed, Oct 25, 2017 at 4:58 PM, Aakash Jain > > wrote:
>>> Does anyone else has any opinion/preference for this?
>> 
>> The number of spaces before a comment really does not matter, but my $0.02: 
>> PEP8 is an extremely common style for Python programs that all Python 
>> developers are familiar with. I would follow that, and forget about trying 
>> to adapt WebKit C++ style to an unrelated language. Trying to adapt the 
>> style checker to ignore particular PEP8 rules seems like wasted effort.
> 
> 
> There is definitely a number of PEP8 rules that we want to follow. But I 
> don't think that there is anything about the two space before comment rule 
> that makes it particularly fitting for Python.

This is entirely subjective, so: why differ from the vast majority of all other 
Python code in existence, just to be different? What's the point? PEP8 
adherence is nearly universal among projects on PyPi, at least among those that 
run style linters.

> I think that we should target WebKit developers with the coding style as much 
> as possible, not Python developers. As we all agree on the one space rule 
> elsewhere, why make a part of the code base uncomfortably different for most 
> WebKit developers?

I don't understand the distinction between WebKit developers and Python 
developers. Am I not a C++ developer and web developer as well?

If "WebKit developers" want to write Python code, perhaps they should learn the 
Pythonic idioms of the language, just as they would use idioms of Perl, 
JavaScript, and C++. For better or worse, PEP8 encodes many of these idioms.

If someone already knows Python, they will be tripped up by this divergence and 
waste some minutes trying to satisfy the style checker, or just ignore it. If 
they don't know Python well, then they are being conditioned to follow some 
variant that has no benefit and is different from what they would see in any 
other Python code.

I see no value in adding arbitrary barriers to new contributions in Python 
code. The code has enough problems as-is, we don't need to make up our own for 
some pretense of consistency. We import other Python projects into the tree, 
and they follow PEP8, so what was proposed is to make the Python code in the 
tree *less* internally consistent.

> - Alexey
> 
> ___
> webkit-dev mailing list
> webkit-dev@lists.webkit.org
> https://lists.webkit.org/mailman/listinfo/webkit-dev

___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev


Re: [webkit-dev] Formatting style for inline comments in Python code

2017-10-26 Thread Alexey Proskuryakov


> 25 окт. 2017 г., в 18:21, Michael Catanzaro  
> написал(а):
> 
> On Wed, Oct 25, 2017 at 4:58 PM, Aakash Jain  wrote:
>> Does anyone else has any opinion/preference for this?
> 
> The number of spaces before a comment really does not matter, but my $0.02: 
> PEP8 is an extremely common style for Python programs that all Python 
> developers are familiar with. I would follow that, and forget about trying to 
> adapt WebKit C++ style to an unrelated language. Trying to adapt the style 
> checker to ignore particular PEP8 rules seems like wasted effort.


There is definitely a number of PEP8 rules that we want to follow. But I don't 
think that there is anything about the two space before comment rule that makes 
it particularly fitting for Python.

I think that we should target WebKit developers with the coding style as much 
as possible, not Python developers. As we all agree on the one space rule 
elsewhere, why make a part of the code base uncomfortably different for most 
WebKit developers?

- Alexey

___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev


Re: [webkit-dev] Formatting style for inline comments in Python code

2017-10-25 Thread Michael Catanzaro
On Wed, Oct 25, 2017 at 4:58 PM, Aakash Jain  
wrote:

Does anyone else has any opinion/preference for this?


The number of spaces before a comment really does not matter, but my 
$0.02: PEP8 is an extremely common style for Python programs that all 
Python developers are familiar with. I would follow that, and forget 
about trying to adapt WebKit C++ style to an unrelated language. Trying 
to adapt the style checker to ignore particular PEP8 rules seems like 
wasted effort.


Michael

___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev


Re: [webkit-dev] Formatting style for inline comments in Python code

2017-10-25 Thread Aakash Jain
As Ryosuke said, we can modify check-webkit-style and in-fact I will update 
that if we decide to use Webkit style for this case.

Does anyone else has any opinion/preference for this?

Thanks
Aakash


> On Oct 25, 2017, at 12:22 PM, Brian Burg  wrote:
> 
> In this case, I always prefer the PEP8 rules, because check-webkit-style will 
> complain if you don't do so.
> 
> Brian
> 
>> 2017/10/25 午後0:13、Aakash Jain > >のメール:
>> 
>> Hi All,
>> 
>> There is one case in which Webkit style guidelines and Python style 
>> guidelines do not match. This is about spacing before inline comments.
>> 
>> WebKit style guidelines 
>> (https://webkit.org/code-style-guidelines/#comments-eol 
>> ) says: "Use only 
>> one space before end of line comments and in between sentences in comments."
>> 
>> Python PEP8 style guidelines 
>> (https://www.python.org/dev/peps/pep-0008/#inline-comments 
>> ) says: "Inline 
>> comments should be separated by at least two spaces from the statement."
>> 
>> Should we use "one space" or "two spaces" before the inline comments in 
>> python code inside Webkit?
>> 
>> Thanks
>> Aakash
>> 
>> Reference: https://bugs.webkit.org/show_bug.cgi?id=171506 
>> ___
>> webkit-dev mailing list
>> webkit-dev@lists.webkit.org 
>> https://lists.webkit.org/mailman/listinfo/webkit-dev
> 

___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev


Re: [webkit-dev] Formatting style for inline comments in Python code

2017-10-25 Thread Ryosuke Niwa
On Wed, Oct 25, 2017 at 12:22 PM, Brian Burg  wrote:

> In this case, I always prefer the PEP8 rules, because check-webkit-style
> will complain if you don't do so.
>
> Brian
>

It's not like we can't fix the style checker. We also follow the usual
WebKit style guidelines in other places like indentations. Instead of
aligning the beginning of each line, we indent by exactly four spaces.

- R. Niwa
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev


Re: [webkit-dev] Formatting style for inline comments in Python code

2017-10-25 Thread Ryosuke Niwa
We should probably use one space to be consistent across the project.

- R. Niwa

On Wed, Oct 25, 2017 at 12:13 PM, Aakash Jain  wrote:

> Hi All,
>
> There is one case in which Webkit style guidelines and Python style
> guidelines do not match. This is about spacing before inline comments.
>
> WebKit style guidelines (https://webkit.org/code-
> style-guidelines/#comments-eol) says: "Use only *one* *space* before end
> of line comments and in between sentences in comments."
>
> Python PEP8 style guidelines (https://www.python.org/dev/
> peps/pep-0008/#inline-comments) says: "Inline comments should be
> separated by at least *two spaces* from the statement."
>
> Should we use "one space" or "two spaces" before the inline comments in
> python code inside Webkit?
>
> Thanks
> Aakash
>
> Reference: https://bugs.webkit.org/show_bug.cgi?id=171506
>
> ___
> webkit-dev mailing list
> webkit-dev@lists.webkit.org
> https://lists.webkit.org/mailman/listinfo/webkit-dev
>
>
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev


Re: [webkit-dev] Formatting style for inline comments in Python code

2017-10-25 Thread Brian Burg
In this case, I always prefer the PEP8 rules, because check-webkit-style will 
complain if you don't do so.

Brian

> 2017/10/25 午後0:13、Aakash Jain のメール:
> 
> Hi All,
> 
> There is one case in which Webkit style guidelines and Python style 
> guidelines do not match. This is about spacing before inline comments.
> 
> WebKit style guidelines 
> (https://webkit.org/code-style-guidelines/#comments-eol 
> ) says: "Use only one 
> space before end of line comments and in between sentences in comments."
> 
> Python PEP8 style guidelines 
> (https://www.python.org/dev/peps/pep-0008/#inline-comments 
> ) says: "Inline 
> comments should be separated by at least two spaces from the statement."
> 
> Should we use "one space" or "two spaces" before the inline comments in 
> python code inside Webkit?
> 
> Thanks
> Aakash
> 
> Reference: https://bugs.webkit.org/show_bug.cgi?id=171506 
> ___
> webkit-dev mailing list
> webkit-dev@lists.webkit.org
> https://lists.webkit.org/mailman/listinfo/webkit-dev

___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev


[webkit-dev] Formatting style for inline comments in Python code

2017-10-25 Thread Aakash Jain
Hi All,

There is one case in which Webkit style guidelines and Python style guidelines 
do not match. This is about spacing before inline comments.

WebKit style guidelines (https://webkit.org/code-style-guidelines/#comments-eol 
) says: "Use only one 
space before end of line comments and in between sentences in comments."

Python PEP8 style guidelines 
(https://www.python.org/dev/peps/pep-0008/#inline-comments 
) says: "Inline 
comments should be separated by at least two spaces from the statement."

Should we use "one space" or "two spaces" before the inline comments in python 
code inside Webkit?

Thanks
Aakash

Reference: https://bugs.webkit.org/show_bug.cgi?id=171506
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev