How to program the ESP32
Some common environments to develop for the ESP32 devices are:
Arduino IDE (C++)
Arduino is a very popular IDE among hobbyist developers. Even though the ESP32 is not part of the default installation, you only need to install a plugin to gain access to the Arduino ecosystem. The default programming language for Arduino is C++.
ESP-IDF (C and C++)
The ESP-IDF is the official Integrated Development Framework from Espressif to develop for ESP devices. The ESP-IDF grants the most control over the devices however it is also one of the more difficult environments to set up and use, it needs to be installed as an addon on an existing IDE. The ESP-IDF also supplies an extensive library of examples to get you started with most concepts. The default programming language for the ESP-IDF is C, however, modifying the projects for C++ is fairly easily accomplished.
PlatformIO falls somewhere in between Arduino and ESP-IDF. You will be able to use both toolchains for projects and the setup is fairly straightforward. The default programming language for PlatformIO is dependent on the underlying environment. If you use the ESP-IDF toolchain then the programming language will be C whereas if you use the Arduino toolchain then the programming language will be C++.
Thonny is a python IDE. Despite the tagline as being for beginners, I found it to be sufficiently feature-rich in terms of support. Thonny supports MicroPython for the ESP32 out of the box. You will have to install firmware that supports the micropython interpreter on the ESP32 device before python can be used on the device. Fortunately, Thonny has the tool built in to do just that over the serial port.
This is an interesting one. You need to load custom firmware on the ESP32 to get this to work. This is one of my favorites. C# is easier to use than both C and C++ and you get to use Visual Studio if running windows otherwise VS-code. The debugger that you get to use over the serial port must not be overlooked, it helps tremendously to find bugs in your code.
There are several ways to develop for the ESP32 and each method has its place.
For single-purpose projects, Python will be a good option. If you are familiar with the Arduino ecosystem and want to create relatively simple projects then Arduino is a good option. If you are not concerned about using the latest version of the ESP-IDF then PlatformIO might be a good option. For large projects that need to make use of all of the features that the ESP32 devices have to offer then the ESP-IDF is the way to go. Nanoframework should also be considered for complex projects.