Reputation
63,966
Next tag badge:
220/100 score
19/20 answers
Badges
20 139 229
Newest
 Populist
Impact
~1.4m people reached

Feb
3
comment Is a 25+ table join a code smell all by itself?
@JacquesB - having worked on the billing system for a large health insurance provider with hundreds of tables, a query with more than 15 or so joins is a smell. Sometimes necessary, always a smell.
Feb
3
answered Is a 25+ table join a code smell all by itself?
Feb
3
comment Why is chaining setters unconventional?
@gusdor - most languages consider setters on objects (as opposed to Plain Old Data) to be a smell, since it is directly manipulating class state, violating encapsulation/invariants. In languages like C#, setters like this are not idiomatic, since they use prop = value sort of syntax, which cannot chain.
Feb
2
comment Why is chaining setters unconventional?
Because Java may be the only language where setters aren't an abomination unto man...
Feb
1
awarded  Populist
Jan
31
awarded  Good Answer
Jan
30
awarded  Nice Answer
Jan
30
answered Help in understanding computer science, programming and abstraction
Jan
30
comment Can “return this” pattern be optimized to no cost performance?
@greenoldman - Look. Go, decompile that Elixir code. I will bet you money that each call to add returns the list, and it is then re-passed into each step in the chain. There is nothing magical happening there but reordering of the arguments.
Jan
30
comment Can “return this” pattern be optimized to no cost performance?
@greenoldman - Not correct. return this is an extra step. after all this argument does not have to be stored at the register at the point of exit - but it does. The Add function can't know how it's being called, so can't assume the return value doesn't matter. Which leads back to my answer.
Jan
29
awarded  Nice Answer
Jan
29
comment Can “return this” pattern be optimized to no cost performance?
@greenoldman - practically, compilers for any (non-continuation passing style) language remove the arguments from their registers at the end of their functions. "Used" or not does not matter. C# or Elixir makes no difference.
Jan
29
comment Can “return this” pattern be optimized to no cost performance?
@greenoldman - "does not rely on callee, only on caller" - what do you mean by this? That it does not care about the return value? list.Add("Hello"); list.Add("World"); is the equivalent C# code in that case. |> doesn't eliminate the need to grab list and pass it into the function call - it's just sugar so you don't have to type that again.
Jan
28
comment Can “return this” pattern be optimized to no cost performance?
@greenoldman - Elixir is just syntax. There is still cost there, just as much as method chains in C#. They both have to compile down to the same thing...
Jan
28
comment How can a object have many types?
@solti - that is the analogy, yes.
Jan
27
comment How can a object have many types?
How can I be a person, and a mammal, and an animal, and a programmer? What my traits are, or what I can do is not the definition of who I am. Likewise, objects and their types.
Jan
27
comment Can “return this” pattern be optimized to no cost performance?
@greenoldman - compared to what? There is always a cost for something, otherwise it wouldn't be a thing.
Jan
27
answered Neat way on passing interface parameter to a constructor
Jan
27
comment Can “return this” pattern be optimized to no cost performance?
@greenoldman - I'm sorry, I do not follow.
Jan
27
answered Can “return this” pattern be optimized to no cost performance?