The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
It is permitted, but strongly discouraged as a matter of style, to redundantly specify the public modifier for interface methods.
Tony Morris
Java Q&A (FAQ, Trivia)
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Originally posted by Julian Kennedy:
Kinda goes against the YAGNI principle though, doesn't it?
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
My suggestion would be to stick with that unless you feel you have a really good reason to do otherwise. "I don't think it's as clear" is not necessarily a good reason: clear is often simply what you're used to.All interfaces are inherently abstract; do not explicitly include this keyword in the declaration of an interface.
All interface fields are inherently abstract, static, and final; do not explicitly include these keywords in the declaration of an interface field.
All interface methods are inherently abstract; do not explicitly include this keyword in the declaration of an interface method.
Peter den Haan | peterdenhaan.com | quantum computing specialist, Objectivity Ltd
Originally posted by Peter den Haan:
"It is easier to switch to abstract classes" doesn't seem very strong... if you intend to turn a bunch of interfaces into abstract classes, adding a few modifiers is probably going to be the least of your problems.
To me, YAGNI applies to any activity that directly or indirectly adds effort for the sake of imaginary future requirements. Not just functionality.
By the way, not explicitly adding "public", "final" or "abstract" to interface fields and methods is one of the recommendations of the Sun Java(TM) Coding Style Guide
My suggestion would be to stick with that unless you feel you have a really good reason to do otherwise.
"I don't think it's as clear" is not necessarily a good reason: clear is often simply what you're used to.
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Tony Morris
Java Q&A (FAQ, Trivia)
But is it? You know that a software system is going to see maintainance and minor enhancements, with the exception of mothballed projects (and surely the right YAGNI thing is not to write those in the first place ). Put differently, the only thing you really know is going to happen is change, and RefactorMercilessly is part of making change cheap.Originally posted by Ilja Preuss:
Remember that the saying got coined by the same people who coined "Merciless Refactoring", which is undoubtly effort for the sake of the imaginary future.
Peter den Haan | peterdenhaan.com | quantum computing specialist, Objectivity Ltd
Originally posted by Peter den Haan:
You know that a software system is going to see maintainance and minor enhancements
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Exactly, it's "knowing" that YAGNI counters, not knowing. And the only things you know (without quotes) is that change is going to come, and that it's not going to look like you thought it would But your point is well taken.Originally posted by Ilja Preuss:
Yes, but that "knowing" is exactly what YAGNI counters.
Peter den Haan | peterdenhaan.com | quantum computing specialist, Objectivity Ltd
Originally posted by Peter den Haan:
Exactly, it's "knowing" that YAGNI counters, not knowing. And the only things you know (without quotes) is that change is going to come, and that it's not going to look like you thought it would
But your point is well taken.
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Consider Paul's rocket mass heater. |