Improving My Work in Vanilla JS Despite Working Through a Library
I’m having to write commands in such a way that will help me better understand the tools available in a library I’m working in.
A few days ago, I wrote about frameworks and libraries versus base code. In discussing Express and Mongoose, I wrote:
… while the two frameworks make things easier in terms of the tasks they’re built to handle, relying on them makes me feel like I’m utilizing a tool without really understanding how it works, and I don’t like that. Part of me wants to just push forward with these tools because they’re easy and it means I’ll be up and running with my bot faster. However, the rest of me considers this and thinks “at what expense?” Nay, I want to really truly understand what’s happening under the hood of what I’m working with.
Over the course of a series of articles and tweets, I’ve expressed my distaste for this reliance on frameworks and libraries to handle absolutely everything. Articles I read about tools being developed require the use of two or more libraries: “Let me show you how to do this thing, and we’re going to do it with this library and that library.” It seems like the only time I come across articles and videos that aren’t reliant on some library or framework are those that deal with the objects and methods of the vanilla language specifically. If want to learn about the
.reduce() method, there are plenty of articles that discuss it. However, if I want to learn how to parse a url, well, there are plenty of libraries that will help me do it if I follow along with the tutorials.
The general idea, then, becomes about learning libraries rather than getting good at building shit with the base language. And I don’t want to focus on that.
Were I an experienced programmer, I probably wouldn’t have this dilemma. Knowing enough about what I’m developing and how to go about it, I may be able to forego using a library, or perhaps I’m library-happy as well. Whatever the case, that’s not where I’m at, and I find myself begrudgingly utilizing a library because I have no idea how to go about what I want to build otherwise.
“Fine, I’ll go, but I’m going to complain the whole time.”
As it stands, I created a new command that serves one function only: to log everything to the console so I can understand wtf happens when I use whatever tool. It feels a little laborious, but there are two things that are happening as a result:
- The obvious, I’m learning what everything is and does in the library. But also,
.map()method, I’m coming to have a better idea of what’s going on without having to wade through pages of documentation.
Ultimately, the way things are going is not ideal. However, I can still find opportunity to learn and improve my understanding of vanilla JS despite working within a library. I’ll take it.