When building WordPress plugins for myself or others, several of the things I take into account – as we all should – is the level of maintainability, scalability, and support for the plugin as WordPress continues to move forward.
As the support for ES6 continues to rise, jQuery continues to move forward with development, and the desire to use new APIs to build out our solutions, I believe it’s worth asking the question:
When we talk about the concept of Models in object-oriented programming, we’re usually referring to a class that is a representation of the data stored in the database.
That is is, when information is stored in rows and columns, we populate a class, its attributes, and so on with that information so that we’re able to pass it around the application, manipulate it as needed, and then possibly serialize the data back to the database.
But in a web application, it’s fair to assume that the model might need to be possible to the front-end to be used. That is, imagine a front-end request making a call to the server, requesting a model (or a collection of models), and then rendering them on the front-end.
Though this particular post isn’t code-oriented, I still think it’s worth thinking through the process of translating a model from the server and then rendering it on the front-end of the web application.
One of the things that I dig about the software development industry (others, too, but this is where we are, right?) is that it requires some degree of constant learning.
For some, that can induce a level of fatigue. And I get it because I’ve felt it. I don’t know if it’s an age thing (I’m not old, yet, but there’s a lot to be said from going from just yourself into an apartment into a house and a family, but I digress). I think that comes with a bit of thrashing is continually trying to keep up with every new thing that comes out.
The thing is that the further I get into my career, the less I’m interested in the learning The New Thing the moment it’s released.
And I say this knowing full well it’d be easy to dismiss what I have to say since I’ve written on going deep rather than wide with technology.
As ES6 becomes more and more popular in web development, we’re likely going to be seeing – and writing – less code using other libraries. When it comes to WordPress, jQuery is still very common.
Personally, I don’t think there’s anything inherently wrong with using jQuery (though you might not need it) but I also think it’s important to keep your skills sharp and up to date with newer technologies.
But learning to write ES6 code is not the purpose of this post, nor is how to achieve something using ES6.
Instead, it’s still about WordPress and jQuery. I’ll come back to ES6 at the end of the post. One of the things I’d love to cover, though, is how to remove duplicate items from a list with a common property.