3,148 reputation
21028
bio website
location Chicago, IL
age 26
visits member for 3 years, 1 month
seen 1 hour ago

Apr
8
comment Why do JavaScript frameworks/libraries have functions which already exist in pure JavaScript?
@josh3736 At least you don't still have to support IE6 ('tho, luckily only in a "make it work, it can look like crap" way)
Apr
5
comment Order of parameters in localization code
Python - also: 'Hello %(name)s' % {'name': 'John'} (not as concise, but gives context in the translation string)
Apr
5
comment Does functional programming add complexity in code?
@Brendan Only within the same paradigm (and even then, sometimes not). For example, Prolog, Java, and APL are so different that I would argue that if you only know one of those (and no other languages), you cannot read the other two, no matter how well you know the first one. (Seriously, in bdesham's example, how the devil are you supposed to interpret "christmas tree" if you don't know any APL?)
Apr
5
comment Correct way to undo the past few git commits including a merge?
@Jsess This command creates a new commit that is the exact reverse of the SHA given to it. If any of the commits that from after the original merge happened to touch the same lines, the conflict is: when revert looks at the code it's trying to revert, the code no longer matches the state the code was in immediately after the original merge.
Apr
2
awarded  Custodian
Apr
1
comment How to distribute, one virtual token to each person in this world, and make sure nobody gets more than one?
@Brendan Oh, if the key to your idea is the birth-assigned token, that already exists in the US, and duplicates do happen..
Mar
30
comment Model-View-Controller: Does the user interact with the View or with the Controller?
@Mahdi Just look at the other most-upvoted answer. They're calling it the GUI, but UI or just "interface" is a better term.
Mar
30
comment Strategies to troubleshoot an error that only happens on a specific device
+1 for "best testing program", I had one for my battery-tracking Android app. When I sent it to a user who was getting bizarre results, and got the debug output, it was an extremely WTF moment: He'd somehow screwed up his phone such that Android itself was reporting 60% battery one minute, 40% the next, 80% the next, and it just kept jumping around. Can't do anything at that point in the app to fix it, they needed to fix their phone.
Mar
30
comment How to distribute, one virtual token to each person in this world, and make sure nobody gets more than one?
@Brendan Tattoos can be removed and modified, so I'd stick with "impossible".
Mar
30
comment How to distribute, one virtual token to each person in this world, and make sure nobody gets more than one?
@david.pfx What about identical twins? How about DNA-theft (such as putting someone else's blood in the scanner)? Or in the future, clones?
Mar
30
comment Question/Answer for multiple Users - How should I design it?
User-Model - are you using an ORM? Which one?
Mar
30
comment How far should we rename code and data when end users nomenclatures change?
The data shouldn't need to be migrated for this, it should be using the ID (or index for enums?) from MySQL, not the text...
Mar
30
comment Model-View-Controller: Does the user interact with the View or with the Controller?
See also, on StackOverflow, Should sorting logic be placed in the model, the view, or the controller?
Mar
30
comment Model-View-Controller: Does the user interact with the View or with the Controller?
-1, the Controller should not be interpreting the data in a GET or POST request. The View is the part of the code that requests are sent to - it handles interpreting that data, then passing along the commands to the Controller. The result is then returned from the Controller to the View, which constructs an appropriate HTTP response.
Mar
29
comment Model-View-Controller: Does the user interact with the View or with the Controller?
@Mahdi When implementing something like a REST API, the part of the code that takes the URL/POST data and calls other functions is the View. The other functions being called should be the Controller (or part of it). Think of it this way: The Controller shouldn't be doing the grunt work of interpreting what the user (which isn't necessarily a human) intends.
Mar
26
comment Why is it bad to write something in language X as if you're writing a program in language Y in terms of using a shared coding paradigm
@Chuu He said he deleted it, but perhaps a sample of that code?
Mar
26
comment Separation of presentation and logic
@Spook Microsoft Word runs on Windows and Mac, which use different APIs for the UI, but the core code (called by the UI) may well be the same. That's part of what separation of concerns is about.
Mar
25
comment When and Where should we use hoisting in Javascript
@RobertHarvey Downvote says right on it, "does not show any research effort". It's not a reason to close, though.
Mar
23
comment Does the Composite design pattern implement recursive behavior?
There's multiple types of recursion. Another that is undoubtedly recursion, but fails the naive "a function calls itself" test, would be mutual recursion
Mar
23
comment Is it a bad practice to cite URLs as references in comments?
If recreating the reference would make it massive: Hell yes.