4 ms·
Don't the compilers optimize this? I always believed functional programming to be popular among compiler experts because it's easier to write certain optimizati
by jetru 13y ago
Don't the compilers optimize this? I always believed functional programming to be popular among compiler experts because it's easier to write certain optimizations on a program because of it's many properties like state not changing etc. I don't know if this leads to realistically faster programs in real life.
- yetanotherphd 13y agoThat is just theory. In practice, it is going to be very hard for the compiler to know, at the time that you change a single value in a huge array, that you are never going to refer to the old array, and so it can just mutate the array.