3 ms·
What are you talking about? Get setters used to be 10 lines long like: int id; public int Id { get { return id; }
by mattmanser 6y ago
What 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; }