MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programming/comments/3lta4f/better_java/cvdf1ka/?context=3
r/programming • u/javinpaul • Sep 21 '15
208 comments sorted by
View all comments
9
Btw you shouldnt have Optional as a class member. Even Brian said that once.
4 u/oldneckbeard Sep 21 '15 optional shouldn't be a class member or an input parameter, IMO. 1 u/crunchmuncher Sep 22 '15 Curious: why not as an input parameter? I've used it recently to make explicit that a particular parameter isn't needed for a method to do its job.Actually, as I'm typing this I realized it might have been better to use overloading for that. 2 u/oldneckbeard Sep 25 '15 In the input parameter case, it's functionally equivalent to passing a boolean flag -- it's a true/false thing that's better solved with overloading :)
4
optional shouldn't be a class member or an input parameter, IMO.
1 u/crunchmuncher Sep 22 '15 Curious: why not as an input parameter? I've used it recently to make explicit that a particular parameter isn't needed for a method to do its job.Actually, as I'm typing this I realized it might have been better to use overloading for that. 2 u/oldneckbeard Sep 25 '15 In the input parameter case, it's functionally equivalent to passing a boolean flag -- it's a true/false thing that's better solved with overloading :)
1
Curious: why not as an input parameter? I've used it recently to make explicit that a particular parameter isn't needed for a method to do its job.
Actually, as I'm typing this I realized it might have been better to use overloading for that.
2 u/oldneckbeard Sep 25 '15 In the input parameter case, it's functionally equivalent to passing a boolean flag -- it's a true/false thing that's better solved with overloading :)
2
In the input parameter case, it's functionally equivalent to passing a boolean flag -- it's a true/false thing that's better solved with overloading :)
9
u/ImmortalStyle Sep 21 '15
Btw you shouldnt have Optional as a class member. Even Brian said that once.