In this instructable I'm going to talk about how you can avoid hard-coding your WiFi credentials into your Arduino sketches using a really awesome library called WiFiManager. It will only take a couple of minutes to go through these steps.
Check out the video or continue reading here to find out how to add it and how it works.
If you have hard-coded values in your sketch, if you change your WiFi router or want to bring your device to somewhere else, you are going to need to re-program your esp8266, which isn't ideal!
It also makes your sketches less sharable, as you probably will want to replace your SSID and Password with placeholders before uploading to somewhere public like GitHub and anyone who is using your code is going to have to update the code before they can use it on their network.