Live data from Hacker News

Why I Hate Frameworks (2005)

factoryfactoryfactory.net

151–160 of 407 posts

Re: Why I Hate Frameworks (2005)

#151

Earlier quoted context omitted.

I see a lot of people online advising against taking CS degrees (in europe, where it's not economically impossible to study). They argue that bootcamps and quick courses are enough, or that chatgpt exists now so programming is a dead profession. I disagree, I think I've had a lot of use from having had education… but I might be biased. But I've had to explain things occasionally.

The carpenter doesn't need a degree. The architect and structural engineer do. If you plan to be a programmer all your life, and a journey-man one at that, then feel free to learn-programming-in-21-days. If you're planning a career in software, then I think understanding fundamentals (database normalisation, the Order of a solution, the ideas of Coupling and Uncoupling, memory usage versus performance, the impact of…

The way I like to explain the difference between the two approaches — and therefore the two educational requirements — you are outlining here is the difference between being a software developer and a software architect. A software developer is focused on developing a certain feature or fixing a certain bug within the context of an architecture that's already determined, rarely making decisions about how to structure the overall data or control flow of a system or what abstractions the system uses, but accepting what's already there; meanwhile, a software architect is going to be making those more broad abstract philosophical decisions that form the framework of how further features are implemented.

This is not to suggest that there is a rigid distinction between the two — all software architects are going to also be software developers in the process of building an architecture, or when new architecture is not needed, and many software developers will occasionally act as software architects. Nor is this intended to suggest that the architecture of a software project must be planned out in advance with all of the concepts and data and control flow either — just that there are points in the process of developing software where these large-scale architectural decisions about what abstractions to use and the flow between them must be made. But there do seem to be two somewhat distinct "hats" people who program wear.

Re: Why I Hate Frameworks (2005)

#152
post #48

I don't get it. I assume the author is trying to make it sound absurd that you would need all these layers of factories to build a simple spice rack and, by analogy, that frameworks are also absurd. But if you were building spice racks at scale, of course you would build them in a factory! And you'd use machinery made in other factories. And those factories would have tools and machines made in yet other factories. T…

And the spice rack itself is just a container for preprepared ingredients from spice factories, to enable a cook to easily access them.

The end product here is the food, after all.

When you go to cook a meal you’re oblivious to the framework of abstractions that go to make it possible for you to obtain and store and conveniently dispense your spices - as well you should be.

Re: Why I Hate Frameworks (2005)

#153

Earlier quoted context omitted.

Yea it’s nonsense. Factories are fantastic. If you want to do something as a hobby, sure don’t use the most advanced tools and do it by hand, but for everyone else especially professionals who are charging other people for their time and effort using the best possible tooling is essential. In fact, if somebody didn’t use a common library or framework and instead “rolled their own” it’s downright irresponsible, obnoxi…

I use the same argument for IDEs versus fancy text editors like EMACS. Sure, you might prefer the specific keyboard shortcuts, but IDEs objectively make developers more productive through features like source code integration, debuggers, and refactoring capabilities. Use whatever you like on your home projects, but at work you should be using whatever is most efficient.

And interestingly, your argument also falls apart in the same way as the framework argument. It might make the average developer more productive on an average project. But most projects are not average, and neither are most developers. Everyone has some unique combination of strengths, just like every project has special cases that don’t fit within the box of a framework.

A framework is great if you don’t know much about the domain and just want to get something together quickly. But if you’re working on anything novel, then eventually you’ll bump against the walls of the framework. Hopefully you designed the project in such a way that you can break out of the framework for these inevitable special cases.

And I like frameworks! I’ve used a few in various languages and think they do a good job organizing the code for the basic cases. But every professional project I’ve worked on has eventually been trapped by piling workarounds on top of the framework to make it work for some unsupported or complex case, or an inevitable architecture fail which the framework has not considered an escape hatch for.

Just like developers and their tools. I have an IDE and nvim at work. The IDE has a lot of power for major refactoring and hinting features, and it’s reasonable enough for an untrained dev.

But it is very slow for the other 99.8% of my job where I’m not doing a big “find and rename all instances”. I am usually wading through a large project and jumping between files to try to understand a complex system. Once I understand it, I’m jumping between those files again to make my changes. All of that is much faster in a lightweight editor than an IDE. But I still open up the IDE every now and then to double-check some change that I made, or do those big fancy refactors.

Re: Why I Hate Frameworks (2005)

#154
So coming from c++ these factories are sounding a lot like compilers, how does a framework differ from a new language and standard library?

Or for that matter, an os and POSIX?

A language is just a standardized framework, and languages are created to solve general cases of specialized problems.

Sure, I don't need the python framework to do something, but if I don't care overly much about performance, why would I want to deal with manual memory management of c.

And just because c exists means we should not use c++ or rust?

Choose the right tool for the job, but starting at a high level of abstraction and working down as needed often makes a lot more sense than starting low and working up.

Maybe don't use unproven frameworks and all frameworks has a different level of provenness. yes there are some people out there that don't need anything, and can program a http server and website in assembly. But it's either a toy or fun side project if they do.

Re: Why I Hate Frameworks (2005)

#155

Earlier quoted context omitted.

React is arguably just a library though. NextJS is React as a framework

React: - completely changes how you write your frontend - changes the language itself (JS -> JSX with embedded HTML) - has lots of react-* libs built around it - comes with a script initializing an app skeleton I would call that a framework. And it's a very good one.

> completely changes how you write your frontend

You can use it for only a part of your UI, and you can implement any parts of your UI that are embedded within react components without react as well. It doesn't lock you into doing things its way in any manner whatsoever, it is literally just a library with functionality that you can utilize wherever relevant in your app.

> completely changes how you write your frontend

JSX is not an integral part of react. It's quite feasible to use react without using JSX, and I have done so in the past in some of my side projects when I wanted to avoid setting up a build system for a while. JSX just compiles down to plain old function calls, and you can use those directly without JSX without any issues.

> (JS -> JSX with embedded HTML)

JSX doesn't really have embedded HTML, it's just syntactic sugar for plain function calls that only somewhat approximates HTML.

> has lots of react-* libs built around it

Which are usually either libs that implement a react component with react or just wrap some non-react library in a way that's slightly easier to use than using the library directly in an app using react, but it's not like that latter is impossible or even difficult.

> comes with a script initializing an app skeleton

Such scripts exist, but they are not integral parts of react and are by no means required to use react. React is just a library, and if you want to, you can use it without doing anything else except including a single .js file with a in your html file, even if the more usual way of including react in your project is a lot more convoluted.

Re: Why I Hate Frameworks (2005)

#156

Yeah but React is really good. A lot of these articles[0] delve into an analogy that they twist into a complicated mess and say "hey look at how complicated frameworks are." But React isn't complicated. Most kinds of interaction, even for the smallest apps, are easier with React than with vanilla JS. I've never felt like I'm managing a factory factory factory when using React. And if I do, it's easy to peel back the…

>Most kinds of interaction, even for the smallest apps, are easier with React than with vanilla JS.

I think the difference isn't between the difficulty/complexity of that individual action but the overall complexity of everything up to that point. Once upon a time the simplest web tutorials might have involved "Open a text editor (already on your PC), write these 10 lines, save it in this directory on your web server or open the file in a browser". Now even the simplest tutorials have way more dependencies/prerequisites and often involve building projects, installing things, framework choices, etc

Once you're already setup and going it may not feel complicated but from the perspective of the dude just trying to buy a hammer it certainly looks complicated.

Re: Why I Hate Frameworks (2005)

#157

Earlier quoted context omitted.

React is arguably just a library though. NextJS is React as a framework

React: - completely changes how you write your frontend - changes the language itself (JS -> JSX with embedded HTML) - has lots of react-* libs built around it - comes with a script initializing an app skeleton I would call that a framework. And it's a very good one.

You're conflating React the library with create-react-app which is a collection of pre-configured tooling for making SPAs. React on it's own is very much just a library with a couple functions.

Re: Why I Hate Frameworks (2005)

#158
post #48

I don't get it. I assume the author is trying to make it sound absurd that you would need all these layers of factories to build a simple spice rack and, by analogy, that frameworks are also absurd. But if you were building spice racks at scale, of course you would build them in a factory! And you'd use machinery made in other factories. And those factories would have tools and machines made in yet other factories. T…

Spice racks are assembled by hand in factories.

The pieces are mass produced, the assembly is done by humans. Because unlike software they are not insane.

There is no at scale for 99% of companies.

The break even point for a factory building spice racks buying machines instead of humans is an immense volume of spice racks - like 100+ spice racks an hour type thing. Maybe more.

Just like software, the number of companies that need to produce spice racks at this volume is miniscule. Unlike software, the ones dumb enough to buy machines they don't need go bankrupt very quickly.

Re: Why I Hate Frameworks (2005)

#159
post #22

Related: Why I Hate Frameworks (2005) - https://news.ycombinator.com/item?id=28920095 - Oct 2021 (296 comments) Why I hate frameworks (2005) - https://news.ycombinator.com/item?id=12635142 - Oct 2016 (66 comments) Why I Hate Frameworks (2005) - https://news.ycombinator.com/item?id=9203959 - March 2015 (63 comments) Why I Hate Frameworks (2005) - https://news.ycombinator.com/item?id=6542817 - Oct 2013 (37 comments) Wh…

[deleted]

Re: Why I Hate Frameworks (2005)

#160
post #94

Earlier quoted context omitted.

That's the reason why CS classes and degrees exist. Or at least it should be. No company will pay you for several years just to learn complexity theory, write sorting algorithms, study schedulers, rewrite UNIX tools, understand hardware architectures, etc... They want you to be productive right away, and the shortest path is just to follow recipes with the latest framework. That's the point of education, universities…

This misses the mark. CS classes and degrees are akin to reading books about swinging hammers rather than just swinging the hammer.

[deleted]
Post reply on HN