Live data from Hacker News

Write Libraries, Not Frameworks

brandons.me

61–70 of 338 posts

Re: Write Libraries, Not Frameworks

#61

> Do you introduce a domain-specific language? You're now responsible for part of the build chain, and for editor integration. > Now, if there's a major organization backing the framework, maybe the calculus works out. Google can back Angular... In my experience, even large orgs don't necessarily have the capacity for building out full-featured editor integration and build tools. Google has a great team managing Angu…

I think all the major frontend frameworks are overly complex beasts, they're too big and can't be used as libraries - for example, you can't replace some functionality out of the box without making a fork. I also didn't find any other reactive frontend framework that could fill this requirement, so I decided to write my own. [0] It is the simplest thing I could conceive (to build, not to use - I plan to provide more…

Off the cuff, that sounds a lot like Knockout.

https://knockoutjs.com/

Re: Write Libraries, Not Frameworks

#62

Earlier quoted context omitted.

I think you're right that people - even (especially?) those who use frameworks - should know how the sausage gets made. Though it's hard for me to address your specific wish since the answer varies widely depending on what kind of "app" we're talking about

Any kind of app where you might reach for a framework. The point is to have a reasonable contrast between "here's how you do it with a framework, here's how you do it without one". I think size is important, as I can imagine that the benefits of a framework might show when there's more to do. Personally I'd think of a web app, since this is one place the discussion comes up a lot, but I don't know that's a requiremen…

It has occurred to me in the past that frameworks are often just a way of publicizing a pattern, and that there could be room for something like "open source patterns" that people could reach for and implement themselves without getting locked into an actual dependency and loading a bunch of extra code. That sounds kind of like what you're suggesting.

Re: Write Libraries, Not Frameworks

#63
This has generally been the approach in the Clojure community. Of course, lacking standard frameworks, every library gets abandoned every few years so you have to learn a new even cleverer one. And wherever you might benefit from a group of very cohesive abstractions (e.g. in data science) you’re instead left with a bunch of random incompatible things (that again, will be abandoned in due course).

Re: Write Libraries, Not Frameworks

#64

A framework, usually, must predict ahead of time every kind of thing a user of it might need to do within its walls. The one thing not mentioned in the article is that the above line of thinking is almost guaranteed to lead to an insane level of abstraction, which was parodied in this classic article from nearly 15 years ago: http://web.archive.org/web/20141018110445/http://discuss.joe... (Sadly, that site is gone, b…

You might as well say “i don’t believe sledgehammers make good hammers”.

Re: Write Libraries, Not Frameworks

#65
This feels like an apples vs oranges comparison. Libraries tend to be more focused and single purpose (e.g., provide an interface for technology X).

When you begin composing libraries together to do a multitude of things you tend to end up with a defacto framework whether you call it that or not.

Frankly, I'd rather use a framework that has been battle tasted and hardened through open source and is well documented instead of one that is incomplete and lacks conventions built in-house.

Re: Write Libraries, Not Frameworks

#66
post #12

A framework, usually, must predict ahead of time every kind of thing a user of it might need to do within its walls. The one thing not mentioned in the article is that the above line of thinking is almost guaranteed to lead to an insane level of abstraction, which was parodied in this classic article from nearly 15 years ago: http://web.archive.org/web/20141018110445/http://discuss.joe... (Sadly, that site is gone, b…

The repeated joke about killing your ex-girlfriend did not age well.

I think the same thing every time reading this otherwise-excellent post. I don't think we should attempt to erase history, but it is super jarring, at least for me. Was it ever actually funny?

Re: Write Libraries, Not Frameworks

#67

Earlier quoted context omitted.

I think all the major frontend frameworks are overly complex beasts, they're too big and can't be used as libraries - for example, you can't replace some functionality out of the box without making a fork. I also didn't find any other reactive frontend framework that could fill this requirement, so I decided to write my own. [0] It is the simplest thing I could conceive (to build, not to use - I plan to provide more…

Have you tried React? It feels fairly library-esque to me. You can be useful in as little as two lines of code: const elem = React.createElement('div', null, 'Hello World'); ReactDOM.render(elem, document.querySelector('body')); It's 35.9kB gzipped, although "too big" is subjective. I may be unimaginative, but over my last 5 years or so with it, there isn't much I've wanted to change. As a library consumer, I don't p…

> Have you tried React? It feels fairly library-esque to me.

Because it is, in fact, just a library.

Re: Write Libraries, Not Frameworks

#68

Earlier quoted context omitted.

I think you're right that people - even (especially?) those who use frameworks - should know how the sausage gets made. Though it's hard for me to address your specific wish since the answer varies widely depending on what kind of "app" we're talking about

Any kind of app where you might reach for a framework. The point is to have a reasonable contrast between "here's how you do it with a framework, here's how you do it without one". I think size is important, as I can imagine that the benefits of a framework might show when there's more to do. Personally I'd think of a web app, since this is one place the discussion comes up a lot, but I don't know that's a requiremen…

I'd love to see this as well. Web apps seem really tricky when it comes to not using frameworks though. You can use JQuery - it's tried and true - but it also seems to be on the way out. Great if you know it, but is it worth learning if you don't?

I had the unfortunate experience of building a static site using Nuxt recently which included Jupyter Notebook exports as html files. I ran into so many problems that the complexities of the framework quickly overshadowed the conveniences. Makes me wish I tried doing everything in vanilla JS instead - I might at least have learned something transferable to other projects that way.

Re: Write Libraries, Not Frameworks

#69
post #48

A framework, usually, must predict ahead of time every kind of thing a user of it might need to do within its walls. The one thing not mentioned in the article is that the above line of thinking is almost guaranteed to lead to an insane level of abstraction, which was parodied in this classic article from nearly 15 years ago: http://web.archive.org/web/20141018110445/http://discuss.joe... (Sadly, that site is gone, b…

Most of those crazy looking Spring classes aren't used by users and are just used internally by the framework developers. Of all the complaints people have about Spring, I've never heard "these classes are too abstract" or "these names are too obtuse." There was maybe one instance where I had to deal with obtuseness like that. Definitely not the norm.

After X11 and Spring, the Maximum Abstraction Task Force shifted to focus on infrastructure, which is why your Java Virtual Machine processes are now running as a uniquely allocated user ID in a container scheduled by a control plane on a pool of OS instances separated by the hypervisor service of a dynamically sized cloud placement group.

Re: Write Libraries, Not Frameworks

#70

A framework, usually, must predict ahead of time every kind of thing a user of it might need to do within its walls. The one thing not mentioned in the article is that the above line of thinking is almost guaranteed to lead to an insane level of abstraction, which was parodied in this classic article from nearly 15 years ago: http://web.archive.org/web/20141018110445/http://discuss.joe... (Sadly, that site is gone, b…

"If you wish to make an apple pie from scratch, you must first invent the universe." —Carl Sagan
Post reply on HN