Reputation
1,108
Top tag
Next privilege 2,000 Rep.
Edit questions and answers
Badges
5 11
Newest
 Yearling
Impact
~15k people reached

  • 0 posts edited
  • 2 helpful flags
  • 115 votes cast
Aug
10
reviewed Reviewed How do I handle setters on immutable fields?
Aug
7
reviewed Reviewed How can I manage trash users?
Aug
7
comment How can I manage trash users?
I think the question needs a little bit of clarification. What exactly is a "trash user"? Do you mean an inactive account or what? Are you sure this question is really about software development?
Aug
5
comment Where to store average value in db?
@BinaryWorrier Yes, rounding errors would be significant. I think it would be wiser to store the sum of the scores and use that to calculate the average.
Aug
5
comment Where to store average value in db?
It is not necessary to fetch previous scores to calculate the new average when a review is added. If the number of old reviews is n and the old average is a, and the added score is s, then the new average will be (a * n + s) / (n + 1).
Jun
24
comment Nested POJOs, exposing collections, detecting changes
I think you should give more information about the data you're modelling. Now it's hard to see why the Command is modelled like a container for Messages for instance. If some objects only "represent data read from a file", then there's no need to modify them, is there?
May
29
revised What's the proper way to model this real-world activity that seems to need circular references in OOP?
added 8 characters in body
May
29
answered What's the proper way to model this real-world activity that seems to need circular references in OOP?
Mar
30
comment As a lone developer, how can I be sure I am learning and doing decent work?
If the systems you're developing are vital or will become vital for the company, then please make sure it's understood that having only one developer responsible for the code is risky. Risks could be even higher if the developer is very talented and productive.
Mar
26
comment Why did programming languages start using = for assignment?
@supercat You said it yourself: "Unless the meaning is made clear in context..." Read what Doval wrote and what Wirth wrote. They've got it right.
Mar
25
comment Why did programming languages start using = for assignment?
@supercat: What "Let yz = x" means depends on the context. It could be just nonsense or it could mean "let y, z ∈ ℝ such that yz = x", x being previously introduced. Doval explained this already: what you seem to think is an introduction of a variable ("let x = 4") is actually a shorthand that omits the introduction. Shorthands are used because introducing every variable rigorously is sometimes too cumbersome. See this question for an example of another (potentially confusing) shorthand notation.
Mar
18
comment Why did programming languages start using = for assignment?
@delnan The point is that the meaning of the symbol = does not change when there's a keyword "let" around. It still denotes an equation. Doval explained that quite perfectly.
Mar
17
comment Why did programming languages start using = for assignment?
@delnan: True, "Let 4 = x" is unnatural and confusing (just like inverted jumps) but it's really equivalent to "Let x = 4". Doval has it right. A proper introduction of a variable requires more than just an equation.
Mar
17
comment Why did programming languages start using = for assignment?
@amon: I disagree about the dual meaning in mathematics. "Let 4 = x" is just as valid as "Let x = 4".
Mar
10
comment Is public final completely (not) ok in constant enum fields?
@TomášZato: Think about it. Is the name of a setting really needed by any other class than the "more sophisticated class" (SettingsManager or such) you're planning to write? How many times you actually need to refer to the name attribute? (No need to answer to me. It's your design. I think I would probably end up with only a couple of references and thus "saving keystrokes" would be totally unnecessary here.)
Mar
9
comment Is public final completely (not) ok in constant enum fields?
Why would encapsulation lead to lots of () in this case? Do you need to refer to names and default values of Settings all over your application?
Mar
6
comment OOP Practice: how to best handle dependent dependencies
Ok. I think you should follow Doval's and Doc Brown's advice and separate the task of rendering TextBlocks and Pages to other classes.
Mar
3
comment OOP Practice: how to best handle dependent dependencies
What's the purpose of these classes? Are they needed to hold and handle contents of documents or to render documents or both?
Dec
19
comment How to define “or” logically
I think this is the "purest" approach in certain mathematical sense. The OR-operator is a function after all, and the truth table is really the essence of that function as a relation and a set. Of course this could be written in an amusing OO manner too: BinaryOperator or = new TruthTableBasedBinaryOperator(new TruthTable(false, true, true, true));
Dec
10
comment Why isn't software abstract on a grander scale?
I think your question is somewhat hard to grasp. You believe that software "should be more abstract". Which software? How abstract that software is now and how abstract it should be? Why exactly it should be more abstract? I think finding a working level of abstraction is always a balancing act, and not only in software design. Now your question seems a little bit too abstract and vague. It should probably be less abstract and more precise. Just like some code I've seen and written too.