Home twitter


044

Objects? Or Functions?

June 13, 2020

Coming off the heels of learning about the Objects Linked to Other Objects (OLOO) prigramming style, and eager to begin applying it, I very quickly got stumped when I attempted to refactor code in a library I've been working on. I didn't quite understand how to seamlessly change some of these perceived classes into their base objects counterparts without losing much of detail, or having to reconstruct much of it entirely. And maybe reconstruction is necessary, at this point. I don't know. I read and reread the code a few times over, in an effort to clarify what was being called where and how to manage the flow of data throughout the entire package. What I finally decided is that I needed to study further and get a better handle on not just objects, but on perceived classes in JavaScript (for the purpose of deconstructing them), and take a deeper dive into functions.

As a result, I started digging into Kyle Simpson's Functional-Light JavaScript, which, it turns out, is far more than I had anticipated as far as functions are concerned. However, it may be just what I need at this time in my learning journey.

I intend to finish the book and get a grasp on Simpson's 'light' version of Functional Programming, as applied to JavaScript. With another tool under my belt, such as this one, I think I'll be better able to choose the write approach for the programs I write.