Live data from Hacker News

The cost YAGNI was never about

newsletter.kentbeck.com

111–120 of 151 posts

Re: The cost YAGNI was never about

#111
post #102

The cost of restructuring has also gone down. The cost of shoring up behavior with tests ahead of a restructure has gone down because of AI. The cost of implementing a zero downtime migration has gone down because of AI. A big part of the rust hype has been the low cost of restructuring within an application, even before AI. And now even more so. The opportunity cost of not being able to safely restructure has gone u…

> The cost of implementing a zero downtime migration has gone down because of AI. You either don't know what that technical term means or you're just wrong. AI does not meaningfully move the needle on that. It only makes backwards compatible deployments easier insofar you're able to do the overhead for splitting the change with less effort then before.

I've always known how to do zero downtime migrations. The question has always been "Is the engineering cost worth it?"

> It only makes backwards compatible deployments easier insofar you're able to do the overhead for splitting the change with less effort then before.

Yes. That reduces the cost of implementing them.

To be clear, I'm not talking about "Split my db migration and my code that depends on the new table". I'm talking about things like "Set up dual writes between an old database schema and a new database schema with a thorough test suite and do shadow reads against both datasets in prod to do differential testing". That's nontrivial engineering effort that would definitely warrant a discussion in the past. Today we just do it. It's fast and lowers risk.

Re: The cost YAGNI was never about

#112
I recently had to functionally migrate away from a codebase that had a ton of YAGNI. _Even with_ an agent it was a herculean task: how do you know if something is really used in a distributed system. I missed things, the agent missed things, it all took way longer than it should have.

(FWIW, I wasn't simply doing a 1:1 port, I took the opportunity to simplify - which meant completely understanding how the old system worked, including things that were _never_ used if I failed to identify them as such)

Re: The cost YAGNI was never about

#113
post #109

Earlier quoted context omitted.

> This is a clear example of YAGNI being used when the dev, actively, does not care if the other person has any argument to defend it will be needed The first paragraph set the context I could do this simplistic thing now but in 3 weeks that will be insufficient so since we’re going to need this more complicated thing I want to do it now. You can solve today’s problem and do some groundwork to extend later. What you…

> The first paragraph set the context The first paragraph is exactly what I've observed that make me think YAGNI is a bad practice. 3 weeks is very short, it's basically next Sprint. This stupid developer is, without flinching, saying, "we may (or may not) already know that what we are building during this sprint will not be suitable to next sprint, but let's build it anyway because YAGNI". How is that not stupid? Ju…

You are constantly ignoring the main point: There’s a simple solution for today’s requirement, and there’s a complicated solution that will also solve a future, not existing yet, requirement. Chet want to write the later, not the former.

The complicated solution is trying to solve two problems at once, and one of them does not exist yet. It’s speculative.

> The fact that the author just chooses to not even try to check if Chet is correct or not should be a red flag.

Chet himself says that the thing will be necessary 3 weeks from now, implying that it’s not necessary today.

You can anticipate changes and plan for it. You can brainstorm it. You can even question the current requirements. What you don’t do is solving something that does not exist.

When we say YAGNI, that means the problem you’re stating, even when reasonable by itself, does not apply to the current context. It’s easier to revise a simple design later when needed, than refactoring a complex one that have a flawed assumption.

Re: The cost YAGNI was never about

#114
post #109

Earlier quoted context omitted.

> The first paragraph set the context The first paragraph is exactly what I've observed that make me think YAGNI is a bad practice. 3 weeks is very short, it's basically next Sprint. This stupid developer is, without flinching, saying, "we may (or may not) already know that what we are building during this sprint will not be suitable to next sprint, but let's build it anyway because YAGNI". How is that not stupid? Ju…

You are constantly ignoring the main point: There’s a simple solution for today’s requirement, and there’s a complicated solution that will also solve a future, not existing yet, requirement. Chet want to write the later, not the former. The complicated solution is trying to solve two problems at once, and one of them does not exist yet. It’s speculative. > The fact that the author just chooses to not even try to che…

I think you're missing the point of the poster you are replying to. You make it sound like 3 weeks is 3 years. It ain't.

Very little, or possible nothing at all, is going to change in 3 weeks. If you are that myopic - as the XP people were - then constant failure is not going to be surprising. It will be expected.

Re: The cost YAGNI was never about

#115

Earlier quoted context omitted.

You are constantly ignoring the main point: There’s a simple solution for today’s requirement, and there’s a complicated solution that will also solve a future, not existing yet, requirement. Chet want to write the later, not the former. The complicated solution is trying to solve two problems at once, and one of them does not exist yet. It’s speculative. > The fact that the author just chooses to not even try to che…

I think you're missing the point of the poster you are replying to. You make it sound like 3 weeks is 3 years. It ain't. Very little, or possible nothing at all, is going to change in 3 weeks. If you are that myopic - as the XP people were - then constant failure is not going to be surprising. It will be expected.

It’s not about the specific timeframe. It’s about something that has no value for today’s context superseding something that do. It’s ok to anticipate changes, it’s not ok to act as if they’re already here when it’s clear that they’re not.

And the other axis is the lean towards complexity.

Let’s say you need to add logging for a web app to be able to quickly troubleshoot it. The design was to create a simple module that printf to stderr. But then the dev comes to you with a new complicated design involving elastic search and what not, saying that we will need it in 3 weeks to dissect the logs, etc. It may have been a good idea, but it’s not valuable. The correct idea is to put that on the backlog, not to start writing code for it.

Implementing complicated idea takes more time than implementing simple idea, while the value is the same.

When there’s a need for having something elastic search for the logs, it will be easy to refactor the simple code that we have than fixing the possibly flawed implementation that would have resulted if we went with the complex design.

Re: The cost YAGNI was never about

#116
post #63

Earlier quoted context omitted.

Just to point, but shifting left isn't agile at all. In fact, it's slightly against development agility. It's just a good engineering practice, that is more than useful enough to compensate for any loss of agility it may cause.

On the one hand, I agree. On the other hand, like a lot of other good ideas, the agile community has claimed this. A quick google will show that many claim it is a "core agile idea."

It’s absolutely an agile idea. The core of agile development is the ability to iterate quickly. Shift left for certain things enables the cycle to shorten and accelerate iteration.

Re: The cost YAGNI was never about

#117
post #109

Earlier quoted context omitted.

> The first paragraph set the context The first paragraph is exactly what I've observed that make me think YAGNI is a bad practice. 3 weeks is very short, it's basically next Sprint. This stupid developer is, without flinching, saying, "we may (or may not) already know that what we are building during this sprint will not be suitable to next sprint, but let's build it anyway because YAGNI". How is that not stupid? Ju…

You are constantly ignoring the main point: There’s a simple solution for today’s requirement, and there’s a complicated solution that will also solve a future, not existing yet, requirement. Chet want to write the later, not the former. The complicated solution is trying to solve two problems at once, and one of them does not exist yet. It’s speculative. > The fact that the author just chooses to not even try to che…

> There’s a simple solution for today’s requirement, and there’s a complicated solution that will also solve a future, not existing yet, requirement.

There are tons of examples that show that your reasoning is incorrect.

Let's invent one: you need to build a car. Day 1: put the front left wheel on the frame structure. Day 2: put the front right wheel on the frame structure, Day 3: put the back left wheel on the frame structure, Day 4: put the back right wheel on the frame structure, Day 5: attach that particular motor on the frame.

Now, you are on Day 1, and Chet arrive and say "this wheel will not do, it will never support the motor that we need to install on day 5".

You are telling me that what Chet said is to be ignored because "it is a requirement for day 5". But it is not. What Chet has done is not bringing a requirement of day 5 into day 1, what Chet has done is that it has noticed an incorrect interpretation in Day 1 requirement. The requirement for Day 1 should have been read as "put the front left wheel on the frame structure, but of course, it goes without saying, use a wheel that is compatible with the car we want to build".

You saying that because Chet is using Day 5 information, the point he is making is not about Day 1 requirement is incorrect.

The thing is: Day 1 requirement and Day 5 requirement don't live on their own. Hell, your job is not to "just do Day 1 requirement" and it has never been. No one, absolutely no one, want a frame structure with just one wheel and no motor.

In the article, Chet does that: he tries to send the message "this is the point of the work, we will need it, it is what we plan to build, so you need to take that into account in today's requirement interpretation. If you don't account for it, you better not even do today's requirement".

And, and let me be clear on that, maybe the element that Chet brings will end up being not relevant or not needed. But the problem is that neither you or the author know that yet, and you reject the discussion before you can even discover if it's the case or not. The problem is that author and you just saw "Day 5" or "in 3 weeks" and, because YAGNI is a terrible advance, jumped on the conclusion "it is in the future, so it has nothing today with today's requirements".

(oh, and in practice, the people who says "YAGNI" will then say "well, the problem is Day 1 requirement, each requirement should go into excruciating details to re-explain the whole point of the work, should think of all the possible interpretation and should be written by someone who know better than me how to build the implementation to each line of code, but somehow should waste their time explaining the project to someone less competent".

Again, the problem with this argument is that the solution of "use your brain, build things carefully" creates a way easier and elegant solution than YAGNI+ridiculously unrealistic requirements.)

Re: The cost YAGNI was never about

#118

Earlier quoted context omitted.

I think you're missing the point of the poster you are replying to. You make it sound like 3 weeks is 3 years. It ain't. Very little, or possible nothing at all, is going to change in 3 weeks. If you are that myopic - as the XP people were - then constant failure is not going to be surprising. It will be expected.

It’s not about the specific timeframe. It’s about something that has no value for today’s context superseding something that do. It’s ok to anticipate changes, it’s not ok to act as if they’re already here when it’s clear that they’re not. And the other axis is the lean towards complexity. Let’s say you need to add logging for a web app to be able to quickly troubleshoot it. The design was to create a simple module t…

> It’s about something that has no value for today’s context superseding something that do.

But this is incorrect. Chet is saying "if we interpret today's requirement this way, what we do today has no value, if we interpret today's requirement this other way, what we do today has value". (and if he is in fact not saying that, the problem is that you and the author have no idea if he was saying that or not, you just saw "3 weeks" and concluded, incorrectly, that it is not about today's requirement)

Please check my other comment for an illustrative example.

> Implementing complicated idea takes more time than implementing simple idea, while the value is the same.

That is factually not true. Take my illustrative example of my other comment: Day 1 requirement has ABSOLUTELY NOT VALUE if the devs that implement it don't listen to someone who said "in Day 5, we will be in this situation, so Day 1 requirement has only values if done this way and not that way".

> Let’s say you need to add logging for a web app to be able to quickly troubleshoot it. ...

Your example does not prove anything. We here all agree that over-engineering is a bad idea, and we can all come up with example where it is done.

What you need to do, is to demonstrate that ignoring what we already know for sure will happen in 3 weeks will never be less efficient than taking 5 minutes to pick the correct solution between two simple solutions, one compatible with in 3 weeks and one not.

This is how you demonstrate. If you say "f(x) is always positive", the demonstration is not to present some x values that are positive, the demonstration is to find a way to show that there is no x values for which f(x) is negative. If you restrict yourself to "let's assume that Chet solution to be compatible with the situation in 3 weeks is complex and will not be needed", of course you will conclude what you conclude. What you need to do is to convince us that it is impossible to have a situation where the information of what will be in 3 weeks will never be useful.

Because this is the point: in the situation in the article, the author has not enough information to know if Chet solution is complicated or not something needed. In fact, according to Chet, it is something needed, and the simple solution has therefore __zero value__.

Re: The cost YAGNI was never about

#119
post #117

Earlier quoted context omitted.

You are constantly ignoring the main point: There’s a simple solution for today’s requirement, and there’s a complicated solution that will also solve a future, not existing yet, requirement. Chet want to write the later, not the former. The complicated solution is trying to solve two problems at once, and one of them does not exist yet. It’s speculative. > The fact that the author just chooses to not even try to che…

> There’s a simple solution for today’s requirement, and there’s a complicated solution that will also solve a future, not existing yet, requirement. There are tons of examples that show that your reasoning is incorrect. Let's invent one: you need to build a car. Day 1: put the front left wheel on the frame structure. Day 2: put the front right wheel on the frame structure, Day 3: put the back left wheel on the frame…

This is where the disagreement comesfrom. You have a different interpretation of requirements. A requirement is not a list of tasks. It’s a set of needs and constraints that drive a design.

In your example, the general goal could be to do a small sedan car, but then Chet come in and say that we need a more powerful engine as the user may like to go offroad with a trailer. And he’s ready to cancel the order for the standard engine and ready to adjust the chassis, the frame,… for the new engine.

But the thing is that there is no such requirement in the design, no hard data that says that user would like such data. It’s just anticipating needs without proper market research.

And as I’ve said previously, it’s okay to explore design for a more complete solution. It’s not okay to commit to them with just an emphasis on the benefits, nit the cost of maintenance while there’s no value to the business.

Re: The cost YAGNI was never about

#120
post #118

Earlier quoted context omitted.

It’s not about the specific timeframe. It’s about something that has no value for today’s context superseding something that do. It’s ok to anticipate changes, it’s not ok to act as if they’re already here when it’s clear that they’re not. And the other axis is the lean towards complexity. Let’s say you need to add logging for a web app to be able to quickly troubleshoot it. The design was to create a simple module t…

> It’s about something that has no value for today’s context superseding something that do. But this is incorrect. Chet is saying "if we interpret today's requirement this way, what we do today has no value, if we interpret today's requirement this other way, what we do today has value". (and if he is in fact not saying that, the problem is that you and the author have no idea if he was saying that or not, you just s…

> Chet is saying "if we interpret today's requirement this way, what we do today has no value, if we interpret today's requirement this other way, what we do today has value".

He is certainly not saying that. The premise is that the simple thing has value for today, the complicated thing has value for today and in 3 weeks time.

> than taking 5 minutes to pick the correct solution between two simple solutions, one compatible with in 3 weeks and one not.

The choice is between a simple solution that will solve today’s issue and a complicated solution (which will take more time) that will also solve an hypothetical situation in 3 weeks.

> in the situation in the article, the author has not enough information to know if Chet solution is complicated or not something needed.

The premise of the article is that the solution is indeed complicated and not something needed today. You may have also been in similar situation. You don’t invalidate an argument by pointing that the premise isn’t true when there’s no argument made that it will always hold true.

Saying that P imply Q, does not mean P is always true.

Post reply on HN