Esbjörn Blomquist
2 min readSep 26, 2021

--

Hello Katrina.

I must say: Thank you for your engagement!

But, you seem upset. I respect that we have entirely different views on JS development. It's fine to disagree.

You are making lots of assumptions and even more generalizations ("there's not a soul in the world..." etc). And you too make "misguided value jugements" (I didn't include "completely" as you did). It's a bit hard to take this response fully seriously.

But a few comments:

It is not new and shiny to me. I have used it for 5 years.

If one is familiar to the destructuring syntax it is not at all as horrible as you describe it ("visual clusterfuck", "syntactic mud puddles", "syntactic ball of goop", "gigantic mess" etc).

I "cluttered the function", but it became shorter ;). (I'm only partly serious here, hence the smiley).

For me, one of the points of structuring a function like this (HOF) IS lazy evaluation. That is why "data" is last in this example. So yes, this is how a thunk looks. I agree however that "currying" is strictly the transformation of a function into the possibility of partial application. I'm sorry for this misstake, thank you for pointing that out.

No, it is not because of destructuring that we need a default when we nest it a level. We need that for the same reason that we would or would not need "?.".

To clarify my view...

Consider that you in some function need:

`profile.user.address.street.number` & `profile.user.address.city`

Without destructuring you'd have to type:

`profile?.user?.address?.street?.number ?? ""` & `profile?.user?.address?.city ?? ""`

Yes. If this is highly dynamic data.

With destructuring, made as early as possible in a suitable way for the situation, you know that you have safe short values to work with, easily usable multiple times in the scope:

`streetNumber` & `city`

---

A couple of thoughts about how we might differ that lead us to such different perspectives: Perhaps you have handled more static data than I have, and perhaps you write longer functions than I do (I limit that with ESLint). Perhaps you write more TS and less functional style than me. We don't know.

Best of the best regards

Esbjörn

--

--

Esbjörn Blomquist
Esbjörn Blomquist

Written by Esbjörn Blomquist

Software architect and developer with web and functional JavaScript close to his heart. Worked many years with web solutions mainly within the IoT field.

Responses (1)