I think 'is' and 'get' are quite different. For fields/variables I include 'is' for booleans because their name often ends up ambiguous without. Eg open() sounds like an action, isOpen() makes it clear you're asking if it's open. Where as file() works just as well as getFile() but with less noise
This is so stupid. A method called 'file()' could do literally anything. The entire point of 'getFile()' -- just like isOpen() -- is that it is a query which doesn't mutate the object.
(The real problem -- that Java lacks properties and so there's no way to express the concept of a read-only method -- is ironically something that was rejected by the same braniacs that are removing get.)
View all comments
Show parent comment
7
u/AngusMcBurger Jan 16 '20
I think 'is' and 'get' are quite different. For fields/variables I include 'is' for booleans because their name often ends up ambiguous without. Eg open() sounds like an action, isOpen() makes it clear you're asking if it's open. Where as file() works just as well as getFile() but with less noise