Reputation
1,091
Top tag
Next privilege 2,000 Rep.
Edit questions and answers
Badges
9 11
Newest
 Guru
Impact
~32k people reached

  • 0 posts edited
  • 0 helpful flags
  • 15 votes cast
Jun
29
awarded  Guru
Oct
4
awarded  Yearling
Sep
24
awarded  Autobiographer
Oct
4
awarded  Yearling
Jan
10
awarded  Good Answer
Oct
4
awarded  Yearling
Aug
5
comment Why was the percent sign (%) chosen as the format specifier for the printf family of functions?
I am curious. Certainly, it would be possible to use {u} instead of %u but would it have any significant advantage? It seems like a largely arbitrary choice.
Jun
8
awarded  Caucus
Mar
1
awarded  Mortarboard
Feb
20
awarded  Enlightened
Feb
4
awarded  Nice Answer
Feb
4
answered std::shared_ptr as a last resort?
Oct
8
awarded  Yearling
Aug
20
comment How do you track your progress in a project?
+1: Your observations on "Percent Complete" are >90% correct.
Aug
20
answered How do you manage cross-class dependencies on destruction/design (more of a C++ question)
Aug
1
comment If a variable has getter and setter, should it be public?
@GlennNelson: What was your getter called? getFrame? getDialog? That mismatch between name and type matters a lot more - being part of the interface - than the actual name of the private variable. The fact that you were able to change the type of the object without affecting the public interface implies that the type change was minor enough not to affect clients, but doesn't that imply that even if it was a public variable that the corresponding type change also wouldn't have affected clients? I don't see how your argument shows concrete benefits to getters and setters.
Aug
1
comment If a variable has getter and setter, should it be public?
Personally, I think this is a bit of a bogus argument. If you change the meaning of a variable but the variable has a getter and setter, then it doesn't matter what it is called. It's not a visible part of the interface. You are much more likely to want to change the name of the getters and setters themselves to indicate to clients the change or clarification of the meaning of the encapsulated variable. In this latter case, you are in no better position that with a public variable. This is quite aside from the argument that a variable with getters and setters is more exposed than encapsulated.
Jul
9
awarded  Enlightened
Jul
9
awarded  Nice Answer
Jul
9
awarded  Good Answer