Code is rarely ever final.
It may ship. The job may be done. But the code? It can almost always be refactored or optimized. Additional tests, contingencies and new features can always be added to account for new user expectations, or to account for use cases that may not have been apparent at the original time of deployment.
Things change, rapidly, and so should our code.
Two years ago I wrote a piece for Smashing Magazine titled “Making Modal Windows Better For Everyone“. I had a great time working on that article, researching how to make the best modal window and pushing my findings out into the world.
In the end, the code that I wrote, it wasn’t perfect. The comments will surely point that out! But it was more than just taking care of a bug or two. I developed the script in the context of the article. I was writing to educate and point to the many accessibility issues with modals, and to promote methods for overcoming those issues. My script did its job, but it would require further modifications, extensions, and refactoring to take care of the bugs that were found and allow for it to be put to greater use against multiple different scenarios that required it to fit into puzzles it wasn’t always ready to fit into.
Two years later, after learning even more ways to ensure a better user experience, modifications and full rewrites to the script, I wanted to share what I’ve created, again.
The revised modal script is not perfect. And it surely isn’t the final version. But I don’t think it ever will be, because there will always be ways to make the modal window better, for everyone.
Want to learn more about my modal window script?