Questions tagged [yagni]

"You Aren't Gonna Need It": An [tag:extreme-programming] principal, which advocates only introducing new features to an application when they are actually needed (as opposed to a need being foreseen).

An principal, which advocates only introducing new features to an application when they are needed.

27 questions
68
votes
10 answers

SOLID vs. YAGNI

One of the most frequent arguments I hear for not adhering to the SOLID principles in object-oriented design is YAGNI (although the arguer often doesn't call it that): "It is OK that I put both feature X and feature Y into the same class. It is so…
bitbonk
  • 48,890
  • 37
  • 186
  • 278
32
votes
14 answers

How far do you go with YAGNI?

I am developing a new revolutionary web application for the enterprise market. Sure, many before me thought that their web app would be revolutionary only to find out it isn't. (Or it is, but the business is not good anyway). So I'm am thinking, in…
flybywire
  • 261,858
  • 191
  • 397
  • 503
16
votes
6 answers

YAGNI - The Agile practice that must not be named?

As I've increasingly absorbed Agile thinking into the way I work, yagni ("you aren't going to need it") seems to become more and more important. It seems to me to be one of the most effective rules for filtering out misguided priorities and deciding…
dkretz
  • 37,399
  • 13
  • 80
  • 138
16
votes
4 answers

What's the difference between principles YAGNI and KISS?

Obviously there are syntactical differences between YAGNI and KISS but I can't see any semantic differences between them. Are they really in essence just the same thing?
Mr Grok
  • 3,876
  • 5
  • 31
  • 40
16
votes
13 answers

Isn't there a point where encapsulation gets ridiculous?

For my software development programming class we were supposed to make a "Feed Manager" type program for RSS feeds. Here is how I handled the implementation of FeedItems. Nice and simple: struct FeedItem { string title; string description; …
y2k
  • 65,388
  • 27
  • 61
  • 86
13
votes
11 answers

Does YAGNI also apply when writing tests?

When I write code I only write the functions I need as I need them. Does this approach also apply to writing tests? Should I write a test in advance for every use-case I can think of just to play it safe or should I only write tests for a use-case…
Sruly
  • 10,200
  • 6
  • 34
  • 39
10
votes
8 answers

When to violate YAGNI?

The YAGNI "principle" states that you shouldn't focus on providing functionality before you needed as "you ain't gonna need it" anyway. I usually tend to use common sense above any rule, no matter what but there are some times when I feel it is…
Jorge Córdoba
  • 51,063
  • 11
  • 80
  • 130
9
votes
5 answers

Write programs that do one thing and do it well

I can grasp the part "do one thing" via encapsulation, Dependency Injection, Principle of Least Knowledge, and You Ain't Gonna Need It; but how do I understand the second part "do it well?" An example given was the notion of completeness, given in…
kirakun
  • 2,770
  • 1
  • 25
  • 41
9
votes
3 answers

Did the authors of The Pragmatic Programmer forget about YAGNI?

The Pragmatic Programmer is highly recommended by many people. I've just finished reading it, and I can see why people recommend it, although I would point out that Code Complete covers almost all of the same material in much more depth. However,…
Dijkstra
  • 2,490
  • 3
  • 21
  • 35
9
votes
10 answers

Is internationalizing later really more expensive?

Most people would agree that internationalizing an existing app is more expensive than developing an internationalized app from scratch. Is that really true? Or when you write an internationalized app from scratch the cost of doing I18N is just…
flybywire
  • 261,858
  • 191
  • 397
  • 503
8
votes
15 answers

Why is it so hard to enforce YAGNI?

I find myself breaking this pattern all the time. YAGNI - You Ain't Gonna Need It I am only a Junior Developer, but I find even Senior level developers doing the same thing. "Well, this system might use it, and this one, so let's design for…
Martin
  • 11,031
  • 8
  • 50
  • 77
7
votes
6 answers

Should you create an interface when there (currently) is only going to be one class that implements it?

Should you always create an interface if there's a possibility that there might be something else that could use it, or wait until there's an actual need for it then refactor to use an interface? Programming to an interface generally seems like…
Davy8
  • 30,868
  • 25
  • 115
  • 173
7
votes
9 answers

Decoupling vs YAGNI

Do they contradict? Decoupling is something great and quite hard to achieve. However in most of the applications we don't really need it, so I can design highly coupled applications and it almost will not change anything other than obvious side…
dr. evil
  • 26,944
  • 33
  • 131
  • 201
5
votes
8 answers

Does YAGNI apply to database design?

In code, it's generally pretty easy to add new classes to provide additional functionality and such. I have a fairly good understanding of refactoring code and what's involved so YAGNI generally makes sense to me. What I'm not as familiar with is…
Davy8
  • 30,868
  • 25
  • 115
  • 173
5
votes
8 answers

Reasons not to overdesign a solution to a current problem

G'day, While having a think about this question here about overdesigning for possible future changes it got me thinking. What reasons against can you provide to people who insist on blowing out designs because "they might want to use it somewhere…
Rob Wells
  • 36,220
  • 13
  • 81
  • 146
1
2