3 ms·
I haven't seen evidence of reduced getters & setters in my day to day yet - they still seem pretty prevalent when OOP comes into the picture. I'd even say they
by munk-a 6y ago
I haven't seen evidence of reduced getters & setters in my day to day yet - they still seem pretty prevalent when OOP comes into the picture. I'd even say they got a bit worse because now it's excessive getters and setters with gigantic JavaDoc style comments all around them. If I see "@returns id integer The ID" one more time I'll be tempted to throw my monitor out the window.
- csirob 6y ago> If I see "@returns id integer The ID" one more time I'll be tempted to throw my monitor out the window. I honestly believe we're in a dire need for a more up-to-date metaphor that lets us better express our anger at a computer, due to monitors becoming paper thin and lightweight in the past decade or so.
- webmaven 6y ago> > If I see "@returns id integer The ID" one more time I'll be tempted to throw my monitor out the window. > I honestly believe we're in a dire need for a more up-to-date metaphor that lets us express our anger at a computer, due to monitors becoming paper thin and lightweight in the past decade or so. My experience may not be representative, but I believe I have encountered variants of "hurl the keyboard at the monitor" more often than "monitor out the window". OTOH, that phrase doesn't account for laptops.
- csirob 6y ago> OTOH, that phrase doesn't account for laptops. It is also not anger-ready for people working on tablets with rubber keyboards attached.
- panzerklein 6y agoPutting fist through the monitor?
- HelloNurse 6y agoHitting the desk with a fist of moderate force is harmless and rattles lightweight modern computer equipment very satisfactorily.
- mattmanser 6y agoWhat are you talking about? Get setters used to be 10 lines long like: int id; public int Id { get { return id; } set(val) { id = val; } } They're now one liners, and obviously necessary public int Id { get; set; } I don't keep up with Java any more, but C# has super short shortcuts for assignment like: public int Id { get; set; } => generateId(); If you, or your company, are misusing a completely optional documentation feature, which you definitely should not be using to annote obvious stuff like IDs, that's your problem, not OOPs. Switching to a functional language won't save your monitor, you'll still be forced to write bad code if doing stupid things like that are in your style guide.
- Sharlin 6y agoYour comment is entirely specific to C#. Java has no such shortcuts, its setters and getters look identical to how they looked in 1994: private int id; public void setId(int id) { this.id = id; } public int getId() { return id; }