$Objectification
2018-Jun-27, Wednesday 08:57![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
Last night after watching Porco Rosso (more on that later), I went back to do more coding practice and spent a while banging my head against this lesson on destructuring assignment.
It took me a while to even understand what the lesson was asking me to do, since a string is a string, right? Javascript treats a lot of things as objects (like functions), but what I forgot is that it treats string as objects (the String object; note capitalization) sometimes too, like when you write:
it very briefly treats the string as a object with a 'length' property which can be read.
And since I forgot, I googled the lesson and found this thread about it, with a lot of people pointing out perfectly reasonable things like "why not just use .length?" and "The lesson doesn't actually explain why you would want to do this or what benefit it has, especially based on what it requires you to do." There is a post that links to another post with real-world applications, so I do understand why destructuring is good. It's much easier to work with name than it is to work with clientList[currentRegion].clients[i].lastName. But while doing it to a string is supposed to be an easy operation to demonstrate how it works, I don't think it succeeds.
Tonight is the first Anime Chicago event I'm going to, a discussion about Porco Rosso. More on that after it happens.
It took me a while to even understand what the lesson was asking me to do, since a string is a string, right? Javascript treats a lot of things as objects (like functions), but what I forgot is that it treats string as objects (the String object; note capitalization) sometimes too, like when you write:
str.length
it very briefly treats the string as a object with a 'length' property which can be read.
And since I forgot, I googled the lesson and found this thread about it, with a lot of people pointing out perfectly reasonable things like "why not just use .length?" and "The lesson doesn't actually explain why you would want to do this or what benefit it has, especially based on what it requires you to do." There is a post that links to another post with real-world applications, so I do understand why destructuring is good. It's much easier to work with name than it is to work with clientList[currentRegion].clients[i].lastName. But while doing it to a string is supposed to be an easy operation to demonstrate how it works, I don't think it succeeds.
Tonight is the first Anime Chicago event I'm going to, a discussion about Porco Rosso. More on that after it happens.
no subject
Date: 2018-Jun-27, Wednesday 23:19 (UTC)no subject
Date: 2018-Jun-28, Thursday 02:20 (UTC)(Like I said, more later)
I don't remember having a lot of trouble with C++, but the last time I worked with it was twenty years ago in a high school class, so I certainly don't remember very well...
no subject
Date: 2018-Jul-05, Thursday 23:01 (UTC)no subject
Date: 2018-Jul-06, Friday 04:52 (UTC)no subject
Date: 2018-Jul-07, Saturday 17:14 (UTC)no subject
Date: 2018-Jul-08, Sunday 00:44 (UTC)I've had that rain background for years, ever since I first learned how to set a background image. The rest of my blog's style kind of follows from that.
no subject
Date: 2018-Jul-08, Sunday 23:59 (UTC)no subject
Date: 2018-Jul-09, Monday 02:47 (UTC)no subject
Date: 2018-Jul-10, Tuesday 00:30 (UTC)