3 ms·
> Why are frameworks popular? Because... That's an extremely open question, and I wouldn't agree that frameworks, in any way, "provide a way for people to coll
by explaingarlic 4y ago
> Why are frameworks popular? Because...
That's an extremely open question, and I wouldn't agree that frameworks, in any way, "provide a way for people to collaborate" any more than a whip does. They seem to me to limit the ability to write the code you want for no value other than providing confirmation bias.
The idea that the same thing being outputted on the screen will have two implementations by two uncommunicative engineers that vary in such a way that they become impractical, impossible or even at all harder to debug, is simply a myth. I highlighted the word "engineer" because that's the key point - if you are hired to solve a problem, you are probably going to solve it the easiest and most convenient way. You are trusted to write code, not use an API. I find it hard to buy the idea that 20 year old aspx code is any easier to debug than pure JavaScript written around that time.
As far as why frameworks have become the norm, I would personally put it down to, in no particular order, the following ideas:
- Some are genuinely useful - functionality is limited in the parent environment's API and must be implemented in some way. This is rare, in my (mild) experience.
- The company had learned the lesson that contractors (especially ones that win the bidding wars) write horrific and unmanageable code. Therefore, it decided that a cost-free way to alleviate this issue is to force all engineers, permanent or on-contract, to use a specific framework.
- The above point spread between companies as people (directors of engineering) shifted around, word spread that someone was able to make significant cost savings etc.
- They are in place to allow one to follow idioms better. I recently interviewed for a company that followed, quite closely, the clean architecture book by Martin Fowler, with their own internal framework. They had a good plan in mind - they wanted components to be interchangeable, usually at compile time, and needed to ensure that they followed procedure in order to write code that was manageable at scale in order to achieve this. They made their own framework and have used it for 10+ years. This proper, elegant use of a framework is very rare.
I do not mean to say that frameworks are useless - however, JQuery has always been absolutely worthless to me in my personal endeavours - which often included quite bespoke DOM manipulations - the exact place that JQuery is meant to shine. To me, it is a great example of something that was phased in as a Band-Aid solution to people writing terrible code as they had no ownership of the product.
I will admit that I use little helpers, such as
function $(usuallyASwearWord){
// Yes I really use element by id for this when writing my own fun code. Not query selector.
return document.getElementById(usuallyASwearWord);
}
and I wouldn't be using these if JQuery never exploded in popularity - but it's just a skeuomorph. A cute little oddity that has some minor, pointless, boring history/flavour behind it. I don't think that JQuery has provided the world with any significant net effort savings, and that it is far from the only framework that will have this legacy.