Not only the endless layers of multi-millennial history, even the current state of the inhabitants is extremely diverse. It's also surprisingly safe.
IMHO the city got ruined in so many ways during the Turkish economic boom the last 5 decades and yet you can tell that the city "still got it". In your runtime analogy, the current state of the modern istanbul is like everything new being like bloated Electron app.
The current mayor is from the secular Turks with western values and he is doing some great things to reduce the bloatware and re-surface the hidden gems through full rewrites.
But sometimes he encounters unexpected behaviour. Just recently, he converted Feshane(old factory where they used to produce Fez style hats during the Ottoman times) into an art gallery but due to some undocumented API the islamist started protesting him for not respecting their values.
Here is the Feshane after the conversion: https://twitter.com/ekrem_imamoglu/status/167157892814888143...
Here is the protest: https://twitter.com/tcbuyuksehir/status/1678147852453683206
Note: Before the conversion, Feshane was used for food markets and such.