Each plugin will store the majority of its code inside functions that you define. While it is technically possible to have a plugin that has nothing but a header, or to have a plugin that does not use user-defined functions, it is highly unlikely you would ever write such a plugin outside of a purely academic exercise.
Ready to proceed? Let's make a doomed plugin.
You may not be used to writing your own functions in your code, especially for trivial tasks. However, when you are writing WordPress plugins, it is virtually impossible to get away with having all your code naked in the main code block. Let's take a closer look at how WordPress works and you will see why you need to shepherd your code into functions.
Normal users will use the Add New button in the Dashboard to search the WordPress repository for published plugins, but we as developers will be creating our own plugins from scratch. To do this, all we need is our trusty text...