2,823 reputation
1330
bio website
location Argentina
age 38
visits member for 4 years, 1 month
seen 2 hours ago

Software developer and science fiction fan.


Mar
25
comment Is there a reason to have a bottom type in a programming language?
You are mistaken: bottom is used to indicate computations that do not terminate. Here "return" means "terminate". So in this case the function does not return and the program is not able to continue. Like Alexey commented, you're thinking of unit, not bottom.
Mar
25
comment Implementing common logic in base class
@AK_ Pretty sure the Agile school of thought is "the test suite should run constantly and very fast. If your tests run slow, that's a problem."
Mar
13
reviewed Approve Understanding basics of object declaration in Java
Mar
11
comment In a program written in Pascal, what hardware components are used?
+1 For actually answering the question, which like you said is very clear (and an understandable confusion for people new to computers and software).
Mar
11
comment What is the logic behind the use of different arrows (-> <-) in Haskell?
@Doval Excellent comment. You should convert it into a (partial) answer.
Mar
6
comment Should the method describe its side effects?
@kobac An externally visible side effect is not an implementation detail. For example, let's say your function that computes ASomething needs to write to a temporary file. If the disk is write-protected it will fail, even if the caller doesn't care how the function achieves its result. This is because "writing to disk" is an observable side-effect, even though it's not the primary reason why the caller used the function.
Mar
3
comment Differences between Instruction set (architecture) and machine language?
What do you mean "a programming language is a set of some programs"? Do you mean the set of all programs that can be written using that language? Do note that's an infinite set, even if you remove filler sentences.
Feb
26
comment How do line intersection algorithms work?
A semi-constructive comment: you absolutely must get acquainted with Math notation and single-letter variable names. It will help tremendously when you decide to pick a book about 2D/3D graphics (or any Math-related subject, for that matter).
Feb
25
comment Is there any necessity to pass a variable parameter to a method while the variable declared global?
Muztaba, that's not enough. How would someone reading the signature of monteCarlo know that the method modifies a global variable?
Feb
25
comment Is there any necessity to pass a variable parameter to a method while the variable declared global?
Mods: doesn't this kind of question belong in Code Review?
Feb
25
comment Is there any necessity to pass a variable parameter to a method while the variable declared global?
Your monteCarlo method is problematic: it modifies a global variable not passed as an argument, which may be puzzling to readers of your code. Better to assign to matrix outside the method.
Feb
25
revised Is there any necessity to pass a variable parameter to a method while the variable declared global?
fixed code formatting and removed "thanks!"
Feb
24
comment When to use a SortedMap interface?
Your first example is a case of "Use the most general type/interface possible": Map is more general than SortedMap; hence, if you just need a Map, use a Map. No need to invoke the second principle about simplicity :)
Feb
24
comment When to use a SortedMap interface?
@RobertHarvey I don't know about Java, but using the Most General Type is standard practice in functional programming / typed lambda calculus / generic programming. In general, it makes sense even for Java: you should use the constraints you need, and only those you need. There is good reason for this: the fewer assumptions you make about a type, the fewer mistakes you can commit.
Feb
12
comment Does this python program obey functional paradigm?
@overexchange Please, this is not the site for code reviews. You asked a prior conceptual question, and you have some reasonable answers. If you don't understand them/disagree, please follow it up in that question. Do not continue asking with different code snippets in different questions.
Feb
12
comment Does this python program obey functional paradigm?
possible duplicate of How do I enforce 'referential transparency' in this program?
Feb
10
comment How do I enforce 'referential transparency' in this program?
@ziggystar True, but note that the definition (and the question) is about referential transparency for every subexpression. What you describe is referentially transparent from outside, but not from inside (if you use a mutable cache, there are inner subexpressions which you cannot freely replace).
Feb
9
comment What's the point with HATEOAS on the client-side?
Wouldn't this mean that you must build a client as complex (and bug prone) as a browser? Flexibility often comes with complexity as a cost...
Feb
7
awarded  Yearling
Feb
6
comment Relation between object orientation and algorithms
Note that in a possibly imperfect way, declarative languages aim at reducing or eliminating the "how" step. Their goal is for you to simply say "this is what I want" (for example, by writing high level equations). Think of a typical SQL query: very little of it is "algorithmic"; you simply tell the database what you want, and it's up to it how it handles your request (within certain limitations, of course).