3,577 reputation
21030
bio website
location
age
visits member for 2 years, 7 months
seen Jan 23 at 23:21

Viewing this information about users with over 50,000 reputation requires a Stack Overflow Gold Account. Please log in to your gold account or join us.


Jan
23
comment Throw exception or let code fail
@Philipp if we think about it LoadMaterial has the following constraints: "After calling it the material is always loaded and the number of materials loaded did not decrease". Throwing an exception for a third constraint "The material cannot be added twice" seems silly and counterintuitive to me. Making the function idempotent reduces the code's reliance on execution order and application state. It seems like a double win for me.
Jan
17
comment How should nodes in a chain be connected?
It's worth mentioning that the events approach is similar. Just like the imperative equivalent of a Task is a callback - an event emitter that shoots a single event multiple times is the imperative equivalent of an Observable. Just like Tasks are stronger than callbacks and people prefer them so are Observables stronger than events in this case.
Jan
17
revised How should nodes in a chain be connected?
deleted 26 characters in body
Jan
17
answered How should nodes in a chain be connected?
Jan
11
comment Does using == in JavaScript ever make sense?
It would be great if your answer wasn't about how you "feel" about the subject but actually backed up with facts or other data.
Jan
8
comment If MVC is “Separation of Concerns” then why was Razor Syntax introduced?
@Alex my point was you're calling "Separation of concerns between the presentation layer and the business logic layer" which is indeed a general pattern MVC which is the name of a specific pattern. Imagine if I called "A class with a reference to an instance of its own supertype" a decorator class, all decorators hold a reference they delegate to but then again linked list nodes typically also hold a reference to the next node but they're in no way decorators. This is like MVC here - MVC is a specific partitioning which ASP.NET MVC does not do. They named it MVC for marketing reasons.
Jan
8
comment JavaScript program design: to what degree should I separate logic and display?
JavaScript is not special here, you would perform as much separation between presentation and business logic as you would in any other programming language. Nothing is more tightly coupled in JS than it is in other languages...
Jan
7
comment Does using == in JavaScript ever make sense?
@JoshuaTaylor because EqualityExpression (what the left hand side and right hand side are both called) is a term everyone in the world knows and loves :)
Jan
7
awarded  Great Answer
Jan
7
comment Does using == in JavaScript ever make sense?
@prpl.mnky.dshwshr I completely agree with that. This post represents an opinion I do not hold but definitely exists and I believe deserves to be heard here. The argument people who like this sort of weak typing make is that it's obvious that "5" should act like the number 5 (what other number would the average person expect it to act like?).
Jan
7
awarded  Guru
Jan
6
comment Does using == in JavaScript ever make sense?
To be fair >= is not really transitive. It's quite possible in JS that neither a > b nor a < b nor b == a (for example: NaN).
Jan
6
comment Does using == in JavaScript ever make sense?
@Timmmm note I am playing devil's advocate here. I don't use == in my own code, I find it an anti-pattern and I completely agree the abstract equality algorithm is hard to remember. What I'm doing here is making the argument people make for it.
Jan
6
awarded  Good Answer
Jan
6
comment Does using == in JavaScript ever make sense?
@Hey to be fair Zepto is hardly a model codebase either - it's infamous for using __proto__ and in turn forcing it almost single handedly into the language specification to avoid breaking mobile websites.
Jan
6
awarded  Nice Answer
Jan
6
comment Does using == in JavaScript ever make sense?
To be fair jQuery is hardly a model codebase. Having read the jQuery source several times it's one of my least favorite codebases with a lot of nested ternaries, unclear bits, nesting and things I would otherwise avoid in real code. Don't take my word for it though - read it github.com/jquery/jquery/tree/master/src and then compare it with Zepto which is a jQuery clone: github.com/madrobby/zepto/tree/master/src
Jan
6
revised Does using == in JavaScript ever make sense?
edited body
Jan
6
revised Does using == in JavaScript ever make sense?
added 51 characters in body
Jan
6
answered Does using == in JavaScript ever make sense?