Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Kirk to Enterprise -- beam down yeoman Rand and a six-pack.


devel / comp.lang.javascript / Re: Statement-Continuation Rule

SubjectAuthor
* Statement-Continuation RuleLawrence D'Oliveiro
+- Re: Statement-Continuation RuleJon Ribbens
+- Re: Statement-Continuation RuleLawrence D'Oliveiro
+* Re: Statement-Continuation RuleLawrence D'Oliveiro
|`* Re: Statement-Continuation RuleJohn Harris
| `* Re: Statement-Continuation RuleLawrence D'Oliveiro
|  `- Re: Statement-Continuation RuleJohn Harris
`* Re: Statement-Continuation RuleMild Shock
 `* Re: Statement-Continuation RuleLawrence D'Oliveiro
  `* Re: Statement-Continuation RuleMild Shock
   `* Re: Statement-Continuation RuleLawrence D'Oliveiro
    `- Re: Statement-Continuation RuleJohn Harris

1
Statement-Continuation Rule

<uq1bhn$1lp15$4@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=18331&group=comp.lang.javascript#18331

  copy link   Newsgroups: comp.lang.javascript
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.javascript
Subject: Statement-Continuation Rule
Date: Thu, 8 Feb 2024 01:42:15 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 12
Message-ID: <uq1bhn$1lp15$4@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 8 Feb 2024 01:42:15 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="5894b09826b61230d924acc4bad71243";
logging-data="1762341"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18fVFewUa+1T5p8QfU6jZTo"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:FAL+5ZeYA8L8FsbPuYY2Lxc4cr0=
 by: Lawrence D'Oliv - Thu, 8 Feb 2024 01:42 UTC

Is this valid code?

function escape_html(s)
{
return s
.replaceAll("&", "&amp;") /* always do first, rest can be in any order */
.replaceAll("\"", "&quot;")
.replaceAll("<", "&lt;")
.replaceAll(">", "&gt;")
.replaceAll("\t", "&#9;")
.replaceAll("\n", "&#10;")
} /*escape_html*/

Re: Statement-Continuation Rule

<slrnus8eug.5tp.jon+usenet@raven.unequivocal.eu>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=18332&group=comp.lang.javascript#18332

  copy link   Newsgroups: comp.lang.javascript
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: jon+usenet@unequivocal.eu (Jon Ribbens)
Newsgroups: comp.lang.javascript
Subject: Re: Statement-Continuation Rule
Date: Thu, 8 Feb 2024 02:26:24 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 15
Message-ID: <slrnus8eug.5tp.jon+usenet@raven.unequivocal.eu>
References: <uq1bhn$1lp15$4@dont-email.me>
Injection-Date: Thu, 8 Feb 2024 02:26:24 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="7f31ddab0b39b801364f3f3d1d6181a4";
logging-data="1774204"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/uPRtwWluddMKYgqe8rgqJrg67Jj5Lth0="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:3G9082ALU0mT9AhStIzDFZcfsyg=
 by: Jon Ribbens - Thu, 8 Feb 2024 02:26 UTC

On 2024-02-08, Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
> Is this valid code?
>
> function escape_html(s)
> {
> return s
> .replaceAll("&", "&amp;") /* always do first, rest can be in any order */
> .replaceAll("\"", "&quot;")
> .replaceAll("<", "&lt;")
> .replaceAll(">", "&gt;")
> .replaceAll("\t", "&#9;")
> .replaceAll("\n", "&#10;")
> } /*escape_html*/

Why wouldn't it be?

Re: Statement-Continuation Rule

<uq8pam$3padl$7@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=18334&group=comp.lang.javascript#18334

  copy link   Newsgroups: comp.lang.javascript
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.javascript
Subject: Re: Statement-Continuation Rule
Date: Sat, 10 Feb 2024 21:20:22 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 27
Message-ID: <uq8pam$3padl$7@dont-email.me>
References: <uq1bhn$1lp15$4@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 10 Feb 2024 21:20:22 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="cb0aecca639ac885e888a888c6c2d7ce";
logging-data="3975605"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19cxWOZfFyVSJIXo+0av41I"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:w9buy07uMD6goQMMSTbXZoCuUgE=
 by: Lawrence D'Oliv - Sat, 10 Feb 2024 21:20 UTC

How about this:

const SECONDS_PER_MINUTE = 60
const SECONDS_PER_HOUR = 3600

document.getElementById("content").innerHTML =
Array.from
(
function*() /* generate entries */
{
for (let i = 0; i <= 32; ++i)
{
yield i * SECONDS_PER_HOUR / 4
} /*for*/
}(),
function(t) /* format entries as hh:mm */
{
const hours = Math.floor(t / SECONDS_PER_HOUR)
const minutes = Math.floor((t - hours * SECONDS_PER_HOUR) / SECONDS_PER_MINUTE)
return "" + hours + ":" + (minutes < 10 ? "0" : "") + minutes
}
).reduce
(
(sofar, elt) => /* join entries into a single string */
sofar + (sofar != "" ? ", " : "") + elt,
""
)

Re: Statement-Continuation Rule

<ur1fbi$2bqel$4@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=18341&group=comp.lang.javascript#18341

  copy link   Newsgroups: comp.lang.javascript
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.javascript
Subject: Re: Statement-Continuation Rule
Date: Tue, 20 Feb 2024 06:03:30 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 26
Message-ID: <ur1fbi$2bqel$4@dont-email.me>
References: <uq1bhn$1lp15$4@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 20 Feb 2024 06:03:30 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="9a4f3fe2663ca2b9e7bae5acf1565dcf";
logging-data="2484693"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/npq3HbJkh5atID+pV+gI+"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:jSyvWD7fiOWZ0yU2Y1e9Swd+fLg=
 by: Lawrence D'Oliv - Tue, 20 Feb 2024 06:03 UTC

Another example. This doesn’t work:

return
{
source : "/autocomplete/search-widget.php",
select :
function (event, ui)
{
$("#select_widget_name").val(ui.item.label)
$("#select_widget_id").val(ui.item.value)
} /*function*/,
}

but this does:

res =
{
source : "/autocomplete/search-widget.php",
select :
function (event, ui)
{
$("#select_widget_name").val(ui.item.label)
$("#select_widget_id").val(ui.item.value)
} /*function*/,
}
return res

Re: Statement-Continuation Rule

<ur210q$2f9ce$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=18342&group=comp.lang.javascript#18342

  copy link   Newsgroups: comp.lang.javascript
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: niam@jghnorth.org.uk.invalid (John Harris)
Newsgroups: comp.lang.javascript
Subject: Re: Statement-Continuation Rule
Date: Tue, 20 Feb 2024 11:04:57 +0000
Organization: A noiseless patient Spider
Lines: 21
Message-ID: <ur210q$2f9ce$1@dont-email.me>
References: <uq1bhn$1lp15$4@dont-email.me> <ur1fbi$2bqel$4@dont-email.me>
Reply-To: jgharris@ic4life.net
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 20 Feb 2024 11:04:58 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="b50a18ec0b98647729843918dd0479dc";
logging-data="2598286"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18kZW1kY2UC2j0ApJodo1KET+wd2yEOf18="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:IOsurTzzhKTsnghABnRf5Lr3as4=
In-Reply-To: <ur1fbi$2bqel$4@dont-email.me>
Content-Language: en-US
 by: John Harris - Tue, 20 Feb 2024 11:04 UTC

On 20/02/2024 06:03, Lawrence D'Oliveiro wrote:
> Another example. This doesn’t work:
>
> return
> {
> source : "/autocomplete/search-widget.php",
> select :
> function (event, ui)
> {
> $("#select_widget_name").val(ui.item.label)
> $("#select_widget_id").val(ui.item.value)
> } /*function*/,
> }

<snip>

Why do you call it "Statement-Continuation Rule"? Isn't it expression
evaluation?

John

Re: Statement-Continuation Rule

<ur2v78$2lhr7$2@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=18344&group=comp.lang.javascript#18344

  copy link   Newsgroups: comp.lang.javascript
Path: i2pn2.org!rocksolid2!news.neodome.net!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.javascript
Subject: Re: Statement-Continuation Rule
Date: Tue, 20 Feb 2024 19:40:24 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 7
Message-ID: <ur2v78$2lhr7$2@dont-email.me>
References: <uq1bhn$1lp15$4@dont-email.me> <ur1fbi$2bqel$4@dont-email.me>
<ur210q$2f9ce$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 20 Feb 2024 19:40:24 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="9a4f3fe2663ca2b9e7bae5acf1565dcf";
logging-data="2803559"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/JiZ7ShX5PGRH7PuDth7k2"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:1HfJAKM3e2dUj7tGJjyAAQxxZ+I=
 by: Lawrence D'Oliv - Tue, 20 Feb 2024 19:40 UTC

On Tue, 20 Feb 2024 11:04:57 +0000, John Harris wrote:

> Why do you call it "Statement-Continuation Rule"? Isn't it expression
> evaluation?

No, it’s about when a statement is considered to continue onto another
line, and when it isn’t.

Re: Statement-Continuation Rule

<ur76t0$3qc4j$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=18350&group=comp.lang.javascript#18350

  copy link   Newsgroups: comp.lang.javascript
Path: i2pn2.org!i2pn.org!newsfeed.endofthelinebbs.com!nyheter.lysator.liu.se!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: niam@jghnorth.org.uk.invalid (John Harris)
Newsgroups: comp.lang.javascript
Subject: Re: Statement-Continuation Rule
Date: Thu, 22 Feb 2024 10:16:00 +0000
Organization: A noiseless patient Spider
Lines: 14
Message-ID: <ur76t0$3qc4j$1@dont-email.me>
References: <uq1bhn$1lp15$4@dont-email.me> <ur1fbi$2bqel$4@dont-email.me>
<ur210q$2f9ce$1@dont-email.me> <ur2v78$2lhr7$2@dont-email.me>
Reply-To: jgharris@ic4life.net
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 22 Feb 2024 10:16:00 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="34916ad1c8647b06da5e3d45e2ca681e";
logging-data="4010131"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/vaJxWHPTcCq1nqmbReMFM4APK6qEnvfE="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:eJ0sBFVFpjm2r8Oi7luLJvXph2o=
In-Reply-To: <ur2v78$2lhr7$2@dont-email.me>
Content-Language: en-US
 by: John Harris - Thu, 22 Feb 2024 10:16 UTC

On 20/02/2024 19:40, Lawrence D'Oliveiro wrote:
> On Tue, 20 Feb 2024 11:04:57 +0000, John Harris wrote:
>
>> Why do you call it "Statement-Continuation Rule"? Isn't it expression
>> evaluation?
>
> No, it’s about when a statement is considered to continue onto another
> line, and when it isn’t.

Is that what ECMA 262 calls "automatic semicolon insertion" ?

John

Re: Statement-Continuation Rule

<ur7860$f3dd$1@solani.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=18351&group=comp.lang.javascript#18351

  copy link   Newsgroups: comp.lang.javascript
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From: janburse@fastmail.fm (Mild Shock)
Newsgroups: comp.lang.javascript
Subject: Re: Statement-Continuation Rule
Date: Thu, 22 Feb 2024 11:37:52 +0100
Message-ID: <ur7860$f3dd$1@solani.org>
References: <uq1bhn$1lp15$4@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 22 Feb 2024 10:37:52 -0000 (UTC)
Injection-Info: solani.org;
logging-data="495021"; mail-complaints-to="abuse@news.solani.org"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Firefox/91.0 SeaMonkey/2.53.18.1
Cancel-Lock: sha1:OOh+lV9LRc4IZNJXzDgoLOoEKYY=
In-Reply-To: <uq1bhn$1lp15$4@dont-email.me>
X-User-ID: eJwFwQkBACAIBLBKAscXBwX6R3BTMbLnMDXo6kYODCwsu5ReOjTsZ7AI7bLuQ324EX5vuQcSy2GvKa9ofT14FRM=
 by: Mild Shock - Thu, 22 Feb 2024 10:37 UTC

Looks like an instance of method chaining style
https://en.wikipedia.org/wiki/Method_chaining

It is heralded as something powerful:

Method chaining is a powerful programming pattern that allows you to
call multiple methods on an object in a single line of code. It enhances
code readability and conciseness by eliminating the need for
intermediate variables or repeated method calls. In this blog post,
we'll explore method chaining in Python, explain it using a simple
example, discuss its use cases, and conclude with its benefits.
https://nikhilakki.in/understanding-method-chaining-in-python

But I have my doubts. Its also related to so called
Fluent Interfaces. When you design APIs so that they
support method chaining:
https://en.wikipedia.org/wiki/Fluent_interface

So called builders often exhibit a fluent interfrace. I
recently had a revelation, that many builders
are rather cheaters, for example I thought the appropriate
thing to do would be:

builder = builder.header(key, value);

So the fluent interface would give me a new version of the
build, with each method chaining call. Just like the replaceAll
gives a new string. But this is often not the case,

it would require that all headers are copied somehow. So we
find in the implementation of header() that it just returns
this, and the method chaining works with a side effect:

public HttpRequestBuilderImpl header(String name, String value) {
checkNameAndValue(name, value);
headersBuilder.addHeader(name, value);
return this;
}

So method chaining might not always satisfied the same expectations
about being a more "functional" approach.

Lawrence D'Oliveiro schrieb:
> Is this valid code?
>
> function escape_html(s)
> {
> return s
> .replaceAll("&", "&amp;") /* always do first, rest can be in any order */
> .replaceAll("\"", "&quot;")
> .replaceAll("<", "&lt;")
> .replaceAll(">", "&gt;")
> .replaceAll("\t", "&#9;")
> .replaceAll("\n", "&#10;")
> } /*escape_html*/
>

Re: Statement-Continuation Rule

<ur87of$1rr1$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=18352&group=comp.lang.javascript#18352

  copy link   Newsgroups: comp.lang.javascript
Path: i2pn2.org!i2pn.org!news.swapon.de!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.javascript
Subject: Re: Statement-Continuation Rule
Date: Thu, 22 Feb 2024 19:36:47 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 5
Message-ID: <ur87of$1rr1$1@dont-email.me>
References: <uq1bhn$1lp15$4@dont-email.me> <ur7860$f3dd$1@solani.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 22 Feb 2024 19:36:47 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="0628152959bd9fc4f57a17e17cabba1f";
logging-data="61281"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18/bd76v6VaqYmz3M0R9fhV"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:1BrGALt4egupSaeXKcSsVwQnqBc=
 by: Lawrence D'Oliv - Thu, 22 Feb 2024 19:36 UTC

On Thu, 22 Feb 2024 11:37:52 +0100, Mild Shock wrote:

> But I have my doubts.

Show us your non-method-chained-style version, then.

Re: Statement-Continuation Rule

<ur8mhl$ftfd$1@solani.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=18353&group=comp.lang.javascript#18353

  copy link   Newsgroups: comp.lang.javascript
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From: janburse@fastmail.fm (Mild Shock)
Newsgroups: comp.lang.javascript
Subject: Re: Statement-Continuation Rule
Date: Fri, 23 Feb 2024 00:49:08 +0100
Message-ID: <ur8mhl$ftfd$1@solani.org>
References: <uq1bhn$1lp15$4@dont-email.me> <ur7860$f3dd$1@solani.org>
<ur87of$1rr1$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 22 Feb 2024 23:49:10 -0000 (UTC)
Injection-Info: solani.org;
logging-data="521709"; mail-complaints-to="abuse@news.solani.org"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Firefox/91.0 SeaMonkey/2.53.18.1
Cancel-Lock: sha1:vexdeowavlHwK6bCmOHJFjWH/rE=
In-Reply-To: <ur87of$1rr1$1@dont-email.me>
X-User-ID: eJwNy0cBwDAMA0BMViwPOB4Jfwjt/Y/HxMbVaMrHFzirLbPQVA+Uc5vlwNZ2XtzilQ4iYdnjzjcoIOYfyQ9QORU9
 by: Mild Shock - Thu, 22 Feb 2024 23:49 UTC

No syntactical doubts, only semantical doubts:

> So method chaining might not always satisfied the
> same expectations about being a more "functional" approach.

Guido von Rossum suggest to not always use method chaining:

https://mail.python.org/pipermail/python-dev/2003-October/038855.html

Lawrence D'Oliveiro schrieb:
> On Thu, 22 Feb 2024 11:37:52 +0100, Mild Shock wrote:
>
>> But I have my doubts.
>
> Show us your non-method-chained-style version, then.
>

Re: Statement-Continuation Rule

<ur8t35$6ap6$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=18354&group=comp.lang.javascript#18354

  copy link   Newsgroups: comp.lang.javascript
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.javascript
Subject: Re: Statement-Continuation Rule
Date: Fri, 23 Feb 2024 01:40:54 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 13
Message-ID: <ur8t35$6ap6$1@dont-email.me>
References: <uq1bhn$1lp15$4@dont-email.me> <ur7860$f3dd$1@solani.org>
<ur87of$1rr1$1@dont-email.me> <ur8mhl$ftfd$1@solani.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 23 Feb 2024 01:40:54 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="1c30df426ba638bd6ae2f81f1dfd3d68";
logging-data="207654"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18NjYcm6A40MEcPcP6edYNI"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:eJ38qz6WyQ/O5HAX4xYtwG3WZSo=
 by: Lawrence D'Oliv - Fri, 23 Feb 2024 01:40 UTC

On Fri, 23 Feb 2024 00:49:08 +0100, Mild Shock wrote:

> Lawrence D'Oliveiro schrieb:
>
>> On Thu, 22 Feb 2024 11:37:52 +0100, Mild Shock wrote:
>>
>>> But I have my doubts.
>>
>> Show us your non-method-chained-style version, then.
>>
> Guido von Rossum suggest to not always use method chaining:

Which is not really answering my question, is it?

Re: Statement-Continuation Rule

<ura132$gs2i$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=18355&group=comp.lang.javascript#18355

  copy link   Newsgroups: comp.lang.javascript
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: niam@jghnorth.org.uk.invalid (John Harris)
Newsgroups: comp.lang.javascript
Subject: Re: Statement-Continuation Rule
Date: Fri, 23 Feb 2024 11:55:13 +0000
Organization: A noiseless patient Spider
Lines: 23
Message-ID: <ura132$gs2i$1@dont-email.me>
References: <uq1bhn$1lp15$4@dont-email.me> <ur7860$f3dd$1@solani.org>
<ur87of$1rr1$1@dont-email.me> <ur8mhl$ftfd$1@solani.org>
<ur8t35$6ap6$1@dont-email.me>
Reply-To: jgharris@ic4life.net
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 23 Feb 2024 11:55:14 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="2bd80c7d6e32b2db928781d04f350b06";
logging-data="553042"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18k+4vZOk6A0xDEo/UWP/cV4Szra1kbkDA="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:UwAgZyTjcKGEk59KRs0jUxTXB2g=
Content-Language: en-US
In-Reply-To: <ur8t35$6ap6$1@dont-email.me>
 by: John Harris - Fri, 23 Feb 2024 11:55 UTC

On 23/02/2024 01:40, Lawrence D'Oliveiro wrote:
> On Fri, 23 Feb 2024 00:49:08 +0100, Mild Shock wrote:
>
>> Lawrence D'Oliveiro schrieb:
>>
>>> On Thu, 22 Feb 2024 11:37:52 +0100, Mild Shock wrote:
<snip>
>> Guido von Rossum suggest to not always use method chaining:
>
> Which is not really answering my question, is it?

In some scenarios it makes sense to allow chaining.
For instance when building the answer to a query where the parts to be
included depend on circumstances. As in x.a().b().e().g();

In other scenarios it just makes things confusing for anyone reading the
code, including the writer.

In other words it depends on design judgement, something that disturbs
people who prefer a 300 page book of rules.

John

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor