Reputation
Top tag
Next privilege 125 Rep.
Vote down
Badges
4
Newest
 Scholar
Impact
~38 people reached

  • 0 posts edited
  • 0 helpful flags
  • 64 votes cast
1d
comment Why is chaining setters unconventional?
@Benedictus I'd say PHP is the bigger abomination. JavaScript is a perfectly fine language and has become quite nice with the inclusion of ES6 features (though I'm sure some people still prefer CoffeeScript or variants; personally, I'm not a fan of how CoffeeScript handles variable scoping as it checks outer scope first rather than treating variables assigned to in local scope as local unless explicitly indicated as nonlocal/global the way Python does it).
1d
comment Why is chaining setters unconventional?
"or if the return object is the value that was just assigned" I hate that, if I want to keep the value I just passed in I'll put it in a variable first. It can be useful to obtain the value that was previously assigned, though (some container interfaces do this, I believe).
Jan
11
comment Why do so many websites prefer “git rebase” over “git merge”?
Now that I think about it, using a workflow involving git rerere still works even when you've already pushed your branch to other repositories, too, unlike rebasing.
Jan
11
comment Why do so many websites prefer “git rebase” over “git merge”?
Personally, I think that having all the different branches intertwining is prettier than just having one branch "out" at any point in time. And even then, doesn't git rerere also serve the purpose of avoiding extraneous merge commits in the final history without having to change one's local history?
Dec
11
comment How to encourage client to do some in house QA testing?
@MetaFight given the description of the client as a small consulting company, I assumed they would be small enough where such a shared document (in the Google Docs sense, not just a sheet of paper or word document that gets passed around/emailed back and forth) would not be unmanageable. Obviously that system would fail completely if the client has a significant number of people with access to it.
Dec
11
comment How to encourage client to do some in house QA testing?
@MetaFight The issue is whether or not the client's calculation of ROI is accurate. The "workarounds without reporting" bit sticks out to me: unless the developer has shown a propensity to delay so long such that submitting a proper bug report is pointless because it will never get resolved, there's no reason they can't just put together a list of things they want fixed the next time they call TOMATO. If the hierarchy is decentralized, maybe have a shared document for all their grievances to make it easy to edit/add to, which could even help with the feature definition bit (or make it worse).
Dec
9
comment Is “string literal” always the same as “hard-coded string”?
Corroborating with Robbie's answer, I wouldn't say that last one is a hardcoded string. The source variables may have hardcoded initializers and the string computation could be optimized at compile time, but the string itself is built from other sources and the computation does not need to be modified to change the string value, only the source constants.
Dec
9
comment Does immutability hurt performance in JavaScript?
"discouraging creating variables" Isn't that only valid for languages where the default behavior is copy on assignment/implicit construction? In JavaScript, a variable is just an identifier; it's not an object in its own right. It still occupies space somewhere, but that is negligible (especially as most implementations of JavaScript, to my knowledge, still use a stack for function calls, meaning unless you have lots of recursion you'll just end up reusing the same stack space for most temporary variables). Immutability has no relation to that aspect.
Dec
9
comment Does immutability hurt performance in JavaScript?
@Katana314 At least it wasn't O(pow(2, n)).
Dec
4
comment How is defining that a method can be overridden a stronger commitment than defining that a method can be called?
A solution to the cleanup issue would be to have a private cleanup that at the end calls a user-specifiable cleanup.
Nov
18
comment Is client-side validation really all that important, always?
@TonyAdams It can sometimes be an issue with the tool; depending on the browser, fields generated by React that can have auto-filled values don't necessarily get auto-filled (this is due to certain browsers not creating expected events on page load, iirc). Or maybe it was a paste issue, now I'm not sure anymore...
Nov
17
comment Should one check for every little error in C?
@Damien_The_Unbeliever What do you do when writing to stderr fails?
Nov
13
comment Bad practice to define constants based on a function call?
@PaĆ­loEbermann Which, by extension, means object creation (other than for Strings) would not be compile-time constant. So just primitives (and Strings) then. (Which I just found is explicitly stated in the section on final: docs.oracle.com/javase/specs/jls/se8/html/jls-4.html#jls-4.12.4)
Nov
13
comment Bad practice to define constants based on a function call?
(Java also has enumerated types, but those are essentially run-time constants as well as they are classes and thus loaded lazily, only when actually needed, meaning you could inject alternate types via a custom class loader.)
Nov
13
comment Bad practice to define constants based on a function call?
Interestingly, Java only supports such run-time constants. final indicates that a variable can only be initialized and not reassigned (but does not restrict modification of non-final member variables). I don't know if the static compiler detects cases where finals are initialized in their declaration and optimizes those out into compile-time constants (though that would only work for primitive values or trivial objects where every recursive member is final and initialized in its declaration) or if it just leaves that up to the JIT compiler, though.
Nov
10
comment Using compound statements (“{” … “}” blocks) to enforce variable locality
"This allocates the space for three integers at the initialization of the function foo" Couldn't a compiler that accounts for variable liveness, observing that qux and baz are never in scope at the same time, just reuse the space? Variable names are just tools to assist the programmer, the compiler doesn't need to preserve them (and in most compiled languages, it doesn't unless you embed symbols for debugging).
Nov
6
comment How is spinlock different from polling?
Don't forget that certain spinlocks also have performance penalties if implemented naively (i.e. TAS vs. TTAS).
Oct
30
comment Why is the minus sign, '-', generally not overloaded in the same way as the plus sign?
@Voo anything makes sense once you grok it. (Of course, grokking it is the hard part.)
Oct
30
comment Why is the minus sign, '-', generally not overloaded in the same way as the plus sign?
@DarrelHoffman Once I realized that operator overloading in C++ is essentially a form of domain specification I became perfectly comfortable with the usage of what are normally bit-shift operators for stream I/O. (Of course, you could also think of it as "shifting" characters into/out of streams, but that's just a mnemonic.)
Oct
7
comment Does C# 6.0's new null-conditional operator go against the Law of Demeter?
(And, of course, that sort of practice makes it easier to implement multidimensional slicing and have some really powerful matrix tools.)