2 ms·
All the time. The easiest example is that we have a search box on the top of every screen that makes the same API calls and has the same results (wiki-style app
by muzani 6y ago
All the time. The easiest example is that we have a search box on the top of every screen that makes the same API calls and has the same results (wiki-style app). The code also shares a lot of similar functionality that's on almost every screen, like displaying a loading prompt. We put these in some base classes.
Larger codebases also use them extensively. I worked on a project which had multi-millions in funding. Basically it was video streaming functionality, dealt with DRM/CA, rewind, optimization, all that done. We were on the UI team, meaning we build a different UI based for a specific client brand, utilizing the same code as in done in many countries.
With those, you don't build a custom code from scratch. You just inherit and modify.
I only use them heavily in Java though, never JavaScript, even though we built that video streaming app in both. It's just a different paradigm. I can live fine without inheritance though. It's just a nice to have.