2 ms·
In terms of performance, bad code is bad code. There's nothing about OOP that inherently results in non-performant code. Like all things, one needs to know wh
by TimJYoung 9y ago
In terms of performance, bad code is bad code. There's nothing about OOP that inherently results in non-performant code. Like all things, one needs to know what they're doing and, more importantly, what their compiler/runtime is doing.
For example, anyone that has been using OO in a non-GC'ed language for a reasonable amount of time will know that it's bad news to constantly create and free small objects due to the MM overhead. However, I constantly encounter JS-heavy web sites/apps that a) become slower as you use them and use an inordinate amount of memory, and b) really thrash the GC because they simply don't pay attention to allocations at all and constantly use constructs that result in one-off allocations that then need to be recycled.
The fact is that the browser and the DOM is a UI layer, and UI frameworks fit perfectly when implemented using OO architecture.