Reputation
Next privilege 200 Rep.
See reduced ads
Badges
1 8
Newest
 Organizer
Impact
~154 people reached

  • 0 posts edited
  • 1 helpful flag
  • 353 votes cast
Jul
23
comment What are the ways to avoid duplication of logic between domain classes and SQL queries?
The trouble with putting (procedural) business logic in SQL is that is extremely painful to refactor. Even if you have top notch SQL refactoring tools, they usually don't interface with code refactoring tools in your IDE (or at least I have not yet seen such a toolset)
May
26
comment How do you avoid getters and setters?
@DanielPryden, true, omitting get prefix is a valid pattern in Java, but if you look at how or when this is used, it usually is reserved for either computed, derived or transformed values, not so much for object attributes/properties of an object. In any case, bringing it back to the original topic, it does not matter if you put a get prefix in front of it or not, if it's only function is to get a value of a private field, it is a getter. Disguising it by omitting the get prefix is only going to confuse people.
May
23
comment How do you avoid getters and setters?
@DanielPryden I am not saying any such thing. What I was trying to say is that labeling certain idiomatic patterns as not useful just because you don't agree with them is pure hubris. Code isn't only meant for machines to execute. It's also useful to remember the people (including you five years from now) who read it later and need to understand it. Human brain is great with recognizing patterns. Naming your getters and setters in idiomatic ways helps people to recognize them for what they are.
May
21
comment How do you avoid getters and setters?
@DanielPryden the conventions that are idiomatic to a language are useful even if you are not doing "enterprise development"...
Apr
9
awarded  Organizer
Apr
9
revised How much work should I place inside a lock statement?
Added tags for locking and concurrency
Apr
9
suggested approved edit on How much work should I place inside a lock statement?
Jan
20
comment Understanding the difference between mutable and immutable classes
As it has been pointed out by multiple people already, hashCode and equals methods have absolutely nothing to do with mutability.
Dec
19
awarded  Critic
Nov
5
awarded  Civic Duty
Oct
23
answered Is staying implementation agnostic really worth it?
Oct
11
comment 3d Packing algorithm for item's shipping
I think the fine sarcasm in this reply got lost in the translation somewhere...
Oct
1
comment How do languages with Maybe types instead of nulls handle edge conditions?
@supercat The question was about equivalence of null versus Maybe<T>. While internals of building arrays and lists is an interesting topic, it does not add any value to the larger discussion. As for the nullability of reference types in C#, I readily admint that my last encounter with C# was brief and it has been more than 3 years since I last programmed in C#, so you may well be right about that. In any case, my point was, that Nullable<T> can be used as poor man's Maybe<T> in C#. For all practical purposes they are the same construct.
Oct
1
comment How do languages with Maybe types instead of nulls handle edge conditions?
@supercat I think you are derailing the discussion here.
Sep
29
comment How do languages with Maybe types instead of nulls handle edge conditions?
@supercat - You are probably having some very specific use case in mind. When creating an array of objects, you usually reserve a sequential block of memory to contain some objects. I do not know enough of C# internals to be 100% certain of what happens under the hood, but whenever you are creating an array, you either know the exact content of an array or you don't. In the latter case, you initialize the array elements to null. Reading the values from array is an entirely separate concern.
Sep
29
comment How do languages with Maybe types instead of nulls handle edge conditions?
@svick: In C# (which was the language in question by the OP), null is not an implicit member of every type. For null to be lebal value, you need to define the type to be nullable explicitly, which makes a T? (syntax sugar for Nullable<T>) essentially equivalent to Maybe<T>.
Sep
24
awarded  Autobiographer
May
29
comment Separate Action from Assertion in Unit Tests
@gnat: I added some explanation to my answer...
May
29
awarded  Editor
May
29
revised Separate Action from Assertion in Unit Tests
Added explanation to why I was suggesting alternative frameworks