The biggest problem with the ESP8266 is that it is a single core device so running code that is too ""intense" does not give the module time to check wifi tasks. If the wifi tasks timeout, the WDT restarts the chip (with a numeric value to explain why it restarted - reported out via serial connection (whether or not you started serial communication). Also, some modules will report out the "garbage" at an odd baud rate of 74880 so the Serial Monitor (Arduino IDE) will only see garbage unless the right baud rate is selected.
There is a command "feedWDT()" to let it check wifi - yield() and delay() reportedly allow the same functionality in Arduino IDE.
I'm still working the bugs (features?) out of the ESP32 but it seems easier to use than ESP8266 - until its not. Getting the ultra-low power Deep-sleep() to work is a challenge because there is so much garbage and current-draining circuitry on the DevBoards that the deepSleep is useless. I have three more different versions on order and ready to play over Christmas. The ESP12F is a great board (based on ESP8266EX chip) with minimal overhead. You can pull the Tin can off and substitute an ultra-low power memory chip for battery driven devices (or simply latch the enable pin with an I/O pin then set the IO pin Low to get to single-digit microAmps in shutdown mode).
Also, I'm not sure the Arduino IDE has been reviewed sufficiently snd debugged to insure all of the ESP IDE commands are accessible and implemented properly. Also, the board libraries above 3.5 keep failing to allow Flashing code so I've settled on the quirks of v3.5 for the "generic 8266 board" option.