# Unreadability of JS, #1394

**URL:** <https://forum.kirupa.com/t/unreadability-of-js-1394/639581>\
**Category:** web dev\
**Created:** [March 30, 2019, 7:54pm UTC](https://forum.kirupa.com/t/unreadability-of-js-1394/639581 "2019-03-30T19:54:03Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![kirupa](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/kirupa/32/11616_2.png) [@kirupa](https://forum.kirupa.com/u/kirupa)\
**Post date:** [March 30, 2019, 7:54pm UTC](https://forum.kirupa.com/t/unreadability-of-js-1394/639581/1 "2019-03-30T19:54:03Z")

</div>

> <https://twitter.com/housecor/status/1111710454362054656?s=21>

Maybe I am getting all curmedgeony, but if I saw that code in regular usage, I wouldn’t know where to begin 😛

---

<div class="post-metadata">

**Author:** ![REB\_412](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/reb_412/32/9233_2.png) [@REB\_412](https://forum.kirupa.com/u/REB_412)\
**Post date:** [March 30, 2019, 11:20pm UTC](https://forum.kirupa.com/t/unreadability-of-js-1394/639581/2 "2019-03-30T23:20:53Z")

</div>

And the author probably would not know what is going on too six months or more after it was written.

---

<div class="post-metadata">

**Author:** ![senocular](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/senocular/32/7217_2.png) [@senocular](https://forum.kirupa.com/u/senocular)\
**Post date:** [March 31, 2019, 12:47pm UTC](https://forum.kirupa.com/t/unreadability-of-js-1394/639581/3 "2019-03-31T12:47:10Z")

</div>

Here you have one of those operator precedence things that, unless you know, you don’t really know. In a code review, I would suggest adding parens to make it clear the result of the whole expression is being spread.

The other bit is the behavior of object spread on non-spreadable values (not just falsey). I guess here you either know or don’t. But it’s a little confusing in the object spread case because unlike array spread, object spread won’t error when attempting to spread an non-spreadable value. Array spread, on the other hand, requires iterables to spread (object spread accepts any value with own properties).

Note: `document.all` is a falsy value that _will_ spread, but thats just because `document.all` is a monstrosity.

---

<div class="post-metadata">

**Author:** ![prg9](https://avatars.discourse-cdn.com/v4/letter/p/8dc957/32.png) [@prg9](https://forum.kirupa.com/u/prg9)\
**Post date:** [April 1, 2019, 12:14am UTC](https://forum.kirupa.com/t/unreadability-of-js-1394/639581/4 "2019-04-01T00:14:53Z")

</div>

So the bigger question is, is there any code that :sen: @senocular doesn’t understand? 😜

---

<div class="post-metadata">

**Author:** ![krilnon](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/krilnon/32/34_2.png) [@krilnon](https://forum.kirupa.com/u/krilnon)\
**Post date:** [April 1, 2019, 2:16am UTC](https://forum.kirupa.com/t/unreadability-of-js-1394/639581/5 "2019-04-01T02:16:28Z")

</div>

> [@kirupa](#):
>
> Maybe I am getting all curmedgeony, but if I saw that code in regular usage, I wouldn’t know where to begin 😛

Well, first you criticize the trailing comma and semicolon. And `obj` isn’t a great middle ground between concision and clarity. [/s]

* * *

The main thing I noticed about this thread is that 1394, while seeming like a random number, is the IEEE standard number for FireWire:

> **[IEEE 1394](https://en.wikipedia.org/wiki/IEEE_1394)**
>
> IEEE 1394 is an interface standard for a serial bus for high-speed communications and isochronous real-time data transfer. It was developed in the late 1980s and early 1990s by Apple in cooperation with a number of companies, primarily Sony and Panasonic. It is most commonly known by the name FireWire (Apple), though other brand names exist such as i.LINK (Sony), and Lynx (Texas Instruments).
> The copper cable used in its most common implementation can be up to 4.5 metres (15 ft) long. Power an...

* * *

> [@prg9](#):
>
> So the bigger question is, is there any code that :sen: @senocular doesn’t understand? 😜

Tragically, yes, it’s the code that powers his own, mechanical heart.

---

<div class="post-metadata">

**Author:** ![senocular](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/senocular/32/7217_2.png) [@senocular](https://forum.kirupa.com/u/senocular)\
**Post date:** [April 1, 2019, 4:19am UTC](https://forum.kirupa.com/t/unreadability-of-js-1394/639581/6 "2019-04-01T04:19:49Z")

</div>

> [@krilnon](#):
>
> The main thing I noticed about this thread is that 1394, while seeming like a random number, is the IEEE standard number for FireWire

🤓
