3,313 reputation
21030
bio website
location Chicago, IL
age 26
visits member for 3 years, 7 months
seen 2 days ago

Jan
15
comment Is there a pattern for a more “natural” way of adding items to collections?
@KilianFoth If you're restricting yourself to just one function/method, sure. But if you want to base it off of English or similar languages, a wrapper for the singular item seems closest: put(item).into(items)
Jan
9
comment One-line functions that are called only once
@JamesAnderson Current time shouldn't be treated as a global. Imagine unit testing a leap-year bug where the "current time" has to be set to something specific.
Jan
5
comment What are 4th & 5th programming language generations? Are there more of them?
"There is no universally accepted definition of what exactly defines the “nth generation” for n > 2." - Okay, so, what are 1 and 2?
Jan
5
reviewed Approve What are 4th & 5th programming language generations? Are there more of them?
Dec
23
comment JavaScript strict mode compatibility
@jfriend00 this === window in a regular function call, not undefined (unless there's something changing it higher up the call stack)
Dec
17
comment Are all magic numbers created the same?
@Snowman Fear the Leap Second
Nov
30
comment Why is the concept of lazy evaluation useful?
@stakx Without a better description, they don't seem to be related except by chance. The advantage of laziness in this example is that a lazy generator is capable of generating all possible states of the game, but isn't going waste time/memory doing so because only the ones that happen will be consumed. The generator can be separated from the consumer without being a lazy generator, and it's possible (albeit more difficult) to be lazy without being separated from the consumer.
Nov
20
comment Is using MultiMaps code smell? If so what alternative data structures fit my needs?
@SebastianRedl Looks like a little bit of both; YAML seems to allow deserialization into arbitrary object instances, and requires extra work to prevent code execution in dynamic languages
Nov
20
comment How do I review code changes that are the result of syncing?
What do you use for version control? git, svn, hg, etc..?
Nov
6
comment Why do we use non-descriptive internal codenames?
@back2dos The examples the OP gives seem to be describing the equivalent of print_left_aligned_to_CRT_monitor()
Nov
6
comment Why do we use non-descriptive internal codenames?
This seems to be proposing something along the lines of Systems Hungarian for these codenames; I see this getting out of hand extremely quickly... W8U140432b_Downloader (using only the proposed metadata in the question)
Oct
16
comment Why do so many websites prefer “git rebase” over “git merge”?
@JohnDaniel And D uses it wrong why are you ever making commits you haven't tested? That seems like the source of the confusion in your example...
Oct
16
comment Why do so many websites prefer “git rebase” over “git merge”?
@JohnDaniel Assuming commits B, C, and D were made in order, then B and C do contain an issue - they're no longer compatible with the pushed code. D won't be the source of that problem unless you intentionally changed the order of your 3 commits. And, as I describe at the beginning of my answer, your commit message for B should contain enough information for you to fix it in a new commit (and if necessary, rebase -i and squash it into B so that the commit passes again)
Oct
8
comment Why is reading from memory not a side-effect but reading from a file is?
@orionll Reading from a file can cause a change to its access time, if enabled for that filesystem. That's a (small) side-effect, and as hinted above, it's not something that the compiler is capable of knowing about beforehand
Oct
2
comment What is the benefit of a function without parameters which only calls another function
window.alert is also often used as a placeholder during development until a nice modal/popup can be designed/implemented, so, same as the language issue, it can be switched out much more easily. Or if you already have one, a design update a few years down the line might require similar changes.
Oct
1
comment Is it better to have separate functions or add more arguments to a function?
@immibis That may be so for an electrician, but the programmers working on this might not have that particular detail at the top of their mind, if they even know about it
Sep
30
awarded  Explainer
Sep
27
comment Are long compiles a thing of the past?
The standard for Python compiles to bytecode and runs in a virtual machine; this is conceptually the same as Java. Other Python implementations might do something different, though
Sep
25
comment Why don't developers make installation wizards on linux?
"Take for example, setting up a LAMP stack. Those are all open-source software in the default repositories, but can you set-up everything in one go without a script?" - On Ubuntu specifically (I don't know if it's in other distros' repositories), yes: sudo apt-get install lamp-server^ (the caret is important) (I also don't know if it shows up in the GUI software center)
Sep
19
revised IOC Containers break OOP Principles
Indent "a." and "b." to be children of "4." as the last sentence in "4." seems to indicate