Building plugins from scratch

First of all, we're here to learn about WordPress, so in this particular case, we will indeed build things from scratch. This is always the best approach to get an in-depth look into how a particular technology works.

However, later on, once you're working with WordPress on a regular basis, and managing your own or other people's websites, I advise you to always look for an already existing plugin before deciding to write a new one yourself. As I mentioned earlier, there are around 55,000 plugins in the official directory alone, not to mention all the premium plugins available all over the web. In short, if you need some functionality, most likely, there's a plugin for it, so you can just go out and get it.

Why is this the recommended approach? If I'm correct, you've chosen to use WordPress because you wanted to make your website as functional as possible, with the least amount of effort possible. Following this line of thought, using an existing plugin simply requires much less effort than building one. Also, many existing plugins are already used by thousands of other people and have large communities supporting them. Choosing a high-quality plugin is, therefore, a safer path to take.

I feel that I should emphasize this clearly because experience tells me that many young WordPress developers tend to press their peers to create things from scratch just for the heck of it, despite the fact that there are other, better solutions available.

Moreover, remember that everything that's a derivative work based on WordPress is available under the GNU General Public License (GPL). So, there's nothing stopping you from taking an existing plugin, building upon it, making it better, and then re-sharing your version with the world. That way, we all win and there's no redundant work.

However, before we can do that, we indeed must learn the craft by constructing something of our own from start to finish. Onward, then!