Reputation
2,963
Top tag
Next privilege 3,000 Rep.
Cast close & reopen votes
Badges
15 30
Newest
 Good Answer
Impact
~149k people reached

Jul
2
comment Does learning a functional language make a better OOP programmer?
@user61852 Most OO design patterns don't model anything about "real life" objects, but actually highly abstract concepts.
Jul
1
comment Why is an operating System denoted as 32 bit or 64 bit
@RobertHarvey I don't think it's too broad. It is answerable, on topic, and not particularly subjective (though 32 vs 64 has some room for debate, as I'm sure you already know). I agree the OP might not understand the answer, but that's not grounds for closing, is it? If Programmers.SE cannot explain why an OS is labeled 32 or 64 bits, then... shame on us ;)
Jun
27
comment How do functional languages handle random numbers?
After your clarifications, I understand and love your answer. Great derivation!
Jun
27
comment Named output parameters vs return values
@Abyx I disagree about GHC. But if you prefer, here's Scala's map signature: def map[B](f: (A) ⇒ B): TraversableOnce[B] from Iterable. Notice the f in there? It means "any function with the right signature" ;)
Jun
27
comment Named output parameters vs return values
If you can't edit the source code, then you can't do anything about preexisting functions, neither adding an output variable nor renaming the function, so the point is moot. If you can edit the source code, then the right course of action is renaming the function and having it return the proper value.
Jun
27
comment Named output parameters vs return values
@Abyx Haskell is used in real-world software, unlike brainfuck. Are you trolling? Your post was initially language agnostic; if you only care about C++ and C#, mark it as such.
Jun
27
revised Named output parameters vs return values
another example illustrating function composition
Jun
27
comment Named output parameters vs return values
@Abyx In any case, I assume you are used to naming conventions from C++ or C#. In other languages, function and variable names like f and x are encouraged in the right context.
Jun
27
comment Named output parameters vs return values
@Abyx I thought it was clear f and g are placeholder names, and not actual function names. Same with variable names. You are arguing minutiae instead of the actual point. Was the downvote yours?
Jun
27
answered Named output parameters vs return values
Jun
27
comment Named output parameters vs return values
@Abyx In C++, void functions aren't functions. They are procedures by another name. C++ does have procedures, like you pointed out; it just doesn't single them out by name. So your question remains: "when should we prefer functions to procedures, and why?".
Jun
27
comment Named output parameters vs return values
@Abyx Easy: a function that does not return a value is a contradiction. ALL functions should return a value; otherwise they aren't functions. What you really want to ask is "why not use procedures, then?".
Jun
27
revised Named output parameters vs return values
Removed strike tags. Please do not include them; they do not add anything useful to the question.
Jun
27
comment How do functional languages handle random numbers?
@Brian Agreed, but the wording ("hook it up to something genuinely random") suggests the random source is external to the system. Therefore, the system itself remains purely functional; it's the input source that isn't.
Jun
27
revised Named output parameters vs return values
Removed irrelevant tag. Removed rant about functional programming which is unrelated to actual question
Jun
27
comment How do functional languages handle random numbers?
Nice answer, but it goes a bit too fast with some steps. For example, why would bad :: Random a -> a introduce inconsistencies? What is bad about it? Please go slowly in the explanation, especially for the first steps :) If you could explain why the "useful" functions are useful, this could be a 1000-point answer! :)
Jun
27
comment How do functional languages handle random numbers?
Why would an external & truly random source compromise the functional nature of the system? It's still "same input -> same output". Unless you consider the external source as part of the system, but then it wouldn't be "external", would it?
Jun
27
comment Do teams get more productive by adding more developers?
There is canonical, well-known literature answering specifically this question. This has been known for years. A simple google search with the exact title of your question will come up with the answer ("The Mythical Man Month") in the top 5 results. Did you try looking before asking?
Jun
26
comment Why do programmers use or recommend Mac OS X?
@AndrewDunn Isn't the OS X filesystem layout pretty nonstandard? You probably mean the kernel is Unix compliant, but that's not the full system and its tools.
Jun
24
comment GPL code allowing non-GPL local copies of nondistributed code
-1 for calling that a "loophole". Ok, just kidding. But I should, since you essentially did the same in another answer.