Developing locally is considered a best practice. In general, you do not want to be actively developing on a live production website because you could have visitors accessing the site at any time and development involves iterations of breaking code and making it work again. This is not the experience you want to provide to your visitors.
￼￼￼￼￼￼￼￼￼￼￼￼￼￼What is “developing locally?” In short, it means you have a full WordPress installation to which you can make changes, add new code, and fail with impunity. It’s a sandbox, and it’s the first element in a successful deployment cycle.