Re: [w3c/IndexedDB] Editorial: Use Bikeshed's algorithm and var more better (#336)

@domenic approved this pull request.

This seems pretty good, but personally I prefer avoiding using `<var ignore>` for "named parameter passing", instead just using positional parameters.

I'd especially suggest avoiding mixing named and positional parameters; I identified one spot where this is done. Otherwise, many of the named parameter passing sites are done when you need to pass an operation. Those could probably be clearer if they were refactored into two steps, one to create the operation as an independent variable, and another to call the operation-accepting algorithm.

>      [=store a record into an object store=] as
-    |operation|, using |store|, the |clone| as |value|, |key|, and
+    <var ignore>operation</var>, using |store|, the |clone| as <var ignore>value</var>, |key|, and
     |no-overwrite flag|.

This is pretty confusing, as it mixes named and positional parameters. I'd suggest just using "_store_, _value_, _key_, and _no-overwrite flag_".

>      [=delete records from an object store=] as
-    |operation|, using |store| and |range|.
+    <var ignore>operation</var>, using |store| and |range|.

How I would phrase this (to avoid the "named parameter passing") is "asynchronously execute a request with this and an algorithm that performs delete records from an object store using store and range". I guess you could even factor it into two steps:

1. Let _operation_ be an algorithm that performs delete records from an object store using _store_ and _range_.
1. Asynchronously execute a request with this and _operation_.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/IndexedDB/pull/336#pullrequestreview-415636251

Received on Wednesday, 20 May 2020 19:14:14 UTC