Live data from Hacker News

Using a framework will harm the maintenance of your software

berk.es

241–250 of 550 posts

Re: Using a framework will harm the maintenance of your software

#241

It's been a whilst since we've had one of these on HN. What a bit of fun. My 2c. There's a choice about the work you do. does your work satisfy a business requirement, or does it satisfy your ego. I need a site for work for a 3 year project, CRUD, users, auth, sessions. Django's perfect for my team of 1.5. It wouldn't be responsible to roll my own, when I can have the bare bones of that site up and ready to go within…

I did some Django but in the days, and I completely agree that as long as you have CRUD, Django shines. The issue starts when you cannot really fit your uses cases into simple CRUD and you start to fight against the framework to achieve this. The author also made a point of negligible gains - even if you spend a week to setup auth, sessions etc. if still negligible for longer running projects

I've worked on to many long dead projects with scant doco and the best ones are always where people colored inside the lines. Remember google web toolkit? That flamed out hard 15? years ago.

I've recently had to make a mod to a decaying app written in GWT. It was easy because no one got creative. I think theres a long term risk with rolling you're own that you box yourself into a lot of corners without knowing it.

Re: Using a framework will harm the maintenance of your software

#242

Earlier quoted context omitted.

> perhaps all of them (every single one) have not actually experienced writing an application without a framework I actually have written software without a framework, so by this standard I feel qualified to comment. Not all software has an implied framework within it. Most Unix command-line utilities do not, for example, with only a few exceptions, and discounting the C standard library as something worthy of the la…

> Not all software has an implied framework within it. The definitions of "framework" are always a sticky issue. If you take "framework" at face value, it's minimally a set of idioms. "an essential supporting structure which other things are built on top of" - which necessarily includes a mental model of execution. This relates closely to why naming, in software development, is considered so difficult. All software h…

> The definitions of "framework" are always a sticky issue.

Hence why the article defines what it means by framework, and by the definition in the article, software rarely has any implied frameworks within as one of the definition points is that there is code in the framework the user is not free to change.

There certainly can be frameworks emerging within large projects, but by the definition in the article they're not problematic because they don't lock you in: You can change those pieces. You in particular ultimately remain in charge of the flow of control in the code. Those "frameworks" don't take away control and put you in a straightjacket.

The article could perhaps have been framed better as "how to write a framework or framework-like thing which doesn't become a problem". Some thoughts might be:

* Structure it as decoupled components where you can opt in and opt of different elements, including of control flow. E.g. Padrino - a Ruby web framework fits well here. You can pick and choose which ORM to use; you can opt in to a router, controller, admin interface, mailers, logging, caching, and view libraries, or not use them at all. You can start with plain Sinatra and add in bits of Padrino as and when you choose, or supply your own.

* In particular, if possible, externalise the control of flow into replaceable components. Doing this alone can often be enough to get you out of the straight-jacket of "frameworks as defined by the article"

* Allow users to override/replace all components rather by defining clear interfaces and not assuming you can call hard-code calls between the different components. Padrino again fits well there. So did e.g. Qmail treated as a "framework for building a mail server" ("nobody" used pure Qmail, but Qmail defined the interfaces between each individual program which made up the full system, so you could replace every single bit step by step). In particular there should be no "magic" glue which there isn't a well defined way of tearing out.

Re: Using a framework will harm the maintenance of your software

#243
It seems that there are mostly 2 types of devs: - those that use tools, learn them and master in them, - those that always want to create their own tools, and will usually oppose adopting and learning existing ones.

I belong to the first type. I love frameworks because they give publicly available documentation that plenty of people contribute to - so my project will have access to all of it even if I'm gone. Another reason is that frameworks have opportunity to be battle tested in terms of robustness and in terms of use cases. My stance here is that I love to use wheels instead of creating my own ones. I'm a project developer and not an academia developer.

The second type of devs are what I would avoid hiring to my projects if they wouldn't be an academia projects. I need to deliver business goals in a most efficient way. That efficiency has to be on multiple levels. One these levels is to that the code won't be depending on one or two my best developers, because there is a high chance they will go at some point. My project would then rely only on what they created and documented, hoping that documentation cover everything. But my project would also slowly deteriorate technically, because most devoted contributors would be gone. Frameworks usually take much longer to become abandoned.

I believe first type should work for businesses. The second type - should aim academia.

Re: Using a framework will harm the maintenance of your software

#244

Earlier quoted context omitted.

> perhaps all of them (every single one) have not actually experienced writing an application without a framework I actually have written software without a framework, so by this standard I feel qualified to comment. Not all software has an implied framework within it. Most Unix command-line utilities do not, for example, with only a few exceptions, and discounting the C standard library as something worthy of the la…

> Not all software has an implied framework within it. Most Unix command-line utilities do not, for example, with only a few exceptions, and discounting the C standard library as something worthy of the label “framework”. The C standard library is exactly that though, a framework for writing UNIX command line tools :) (for anything else it's much less useful)

A library is not a framework. You can write framework-free apps while using libraries (in fact, most do - not wanting to be burdened with a framework doesn't mean you have to write all functionality yourself).

A framework is either about inversion of control (it calls your code, e.g. you write web request controller logic, and it sets up the infrastructure for calling your controllers), and/or a set of ways to structure your code, like classes to extend, folder structure, a set of patterns you must follow to work with it, like a specific MVC-like organization of code, and so on.

Re: Using a framework will harm the maintenance of your software

#245
post #92

Earlier quoted context omitted.

Every single codebase doing anything nontrivial is mess. Show me a code base that you can marvel at it's beauty, elegance, and how neat and tidy everything is organized and one of two things will be true about it. 1. It has never touched the real world, real hardware, or real users. 2. All the mess is hidden in some dependencies that handle the integration points with the outside world. You cannot escape the fact tha…

I first thought to post some links to code bases that, in my eyes, aptly counter argue your claim. Then I realised that you have already solidly placed yourself in a corner and are bound to defend that corner no matter what I am going to post. Since there's no objective measure of what constitutes as a mess (in contrast to what is simply not perfect) it's also easy to convince yourself that the statement always remai…

"I really have proof for my argument, I swear, I'm just too petty to provide it, trust me bro". Are you serious?

Re: Using a framework will harm the maintenance of your software

#246
1. "If you don't use a framework, you will end up creating one" -- And that's exactly how successful frameworks were born. If everyone uses an existing framework, who is to create better frameworks for the future?

2. Framework vs. Library -- Framework calls your code; Library is called by your code. There is clear inversion of control. The article touched on this, but I think it's a very important distinction to call out.

3. Framework makes me think inheritance. Library makes me think composition.

4. Framework is like CPUs. A more powerful CPU is a more powerful CPU, no doubt; but you need more power to bring out the performance. If your company don't have the resource to deal with the maintenance, Framework becomes a liability rather than asset. But if you can sustain it, it should still be a net positive.

5. In addition to the mixing of domain and non-domain concerns, poor Framework bring incomplete abstraction that expands the surface area for reasoning/debugging/maintaining. A good framework should provide the perfect abstraction that frees the developer from having to descend the stacks. I consider programming languages as good "frameworks". So are the layered networking architecture.

6. Watch out for self-fulfilling prophecies. e.g. in the web frontend framework space, a framework might claim it helps solve problem X, but it might also be very cause problem X. Accessibility, Routing, State Management... a lot of these can be solved by using the platform. Before you reach out for a framework, be sure to assess platform capabilities and single purpose libraries first.

7. Reliance on framework can be caused by lack of knowledge. If you are a manager, give your team the time, money, and endorsement they need to learn things, attend conferences, and provide ample budget for training and technical book purchase. They might pay more dividends than a framework does.

Re: Using a framework will harm the maintenance of your software

#247
post #17

1. Every sufficiently complex framework-free application contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of a framework. 2. If you have a talented team, that half of a framework can be much better than using a one-size-fits-all framework that is popular because it used to be lean and mean with a small surface area, but has grown over time to do everything for everyone, becoming a com…

bug ridden mess maybe, but probably not slow. with 0 overhead, things to be fast by default. frameworks add weight.

> frameworks add weight.

Not really true. Sure they add some, but the alternative (libraries) also add weight. So the question should be: do FWs add more weight than using libs directly.

There are some FWs in Rust where the weight is very minimal. That said the FWs are also very minimal.

Re: Using a framework will harm the maintenance of your software

#248

> Many people will argue that not using a framework means write everything yourself. This is a false dichotomy. We can use libraries and frameworks just fine. ... > But we should give them a clear, and well-isolated place in our project. ... There's an excellent, if older, presentation called "Architecture, the Lost Years" that addresses exactly this problem and gives very specific, actionable guidance on how to solv…

“When designing a system, the goal should be to defer major decisions for a long as possible.”

I noticed that I tend to do this, but never knew it was a legit strategy.

Re: Using a framework will harm the maintenance of your software

#249

I'm experiencing this with Laravel. I'm stuck on 5.2 while they're on v9 now because the author thought it would be a good idea to arbitrarily change some method signatures because he regretted his decisions earlier, while not providing any additional value and I don't have the time to hunt all these down and refactor everything, and I feel unmotivated when he's made it clear he's a bad steward. He refused semver for…

I don't have the time to hunt all these down and refactor everything

Yes you do. You're just choosing to spend that time on other things rather than pay off some of the technical debt (that the framework introduced rather than you). Your decision to just live with the old version will prove to be a bad one in the long term: you'll find it frustrating, your skills will stagnate, new hires will find it frustrating (and will quit), eventually 5.2 will stop receiving patches so your security will be compromised, and you'll miss out on some of the shiny new features in the latest versions. This will get harder the longer you leave it.

It's worth investing the time to move with the framework even if the framework is a pain at times.

Re: Using a framework will harm the maintenance of your software

#250

Earlier quoted context omitted.

The author uses Django as an example of a framework... but Django doesn't really fit the definition used. Django does not dictate the flow of your code. It provides some libraries and there are common patterns, but Django is more or less just a set of Python modules you can import and use as you want (A bit of configuration is done for you if you follow common layouts, but you don't have to and can manually do the co…

Django is definitely a framework. Its not just Django that locks you in, it's all the third party apps people end up adding. All these integrate tightly with Django. They often block upgrades as they have different python and Django version requirements.

But that is also (or can be) an anti-pattern. Don't just blindly add dependencies - there are so many risks involved with that. Of course that is not unique to just frameworks like Django and Rails, but any piece of growing software.
Post reply on HN