Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them. - Laurence J. Peter
Originally posted by Gregg Bolinger:
Is there anytime when 'void' is the only logical return type?
Originally posted by Garrett Rowe:
I have a problem with void methods too but for a different reason. I prefer to write code with as few visible side effects as possible, and a void return type is the antithesis of that goal.
Originally posted by Garrett Rowe:
I do agree that classes like StringBuilder/Buffer and Scanner which return themselves with every method invocation, are nice to code to. I still cringe a little when I use them because they are still at their core heavily dependent on side effect to do their job.
Steve
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them. - Laurence J. Peter
Steve
SCJP, SCWCD.
|Asking Good Questions|
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 Jesper Young:
Your idea is not new, this has been discussed on The Java Posse before. See this for some more info:
RFE: Method chaining for instance methods that return void
Method Chaining (Martin Fowler)
[OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Originally posted by Ilja Preuss:
Garrett, I assume you have experience with functional programming languages?
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them. - Laurence J. Peter
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
Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters? |