Reputation
2,905
Top tag
Next privilege 3,000 Rep.
Cast close & reopen votes
Badges
13 30
Newest
 Yearling
Impact
~137k people reached

Jun
2
comment What stops C from being compiled/interpreted/JIT'ed?
I'm puzzled about this bit: "what stops C from being compiled/[...]". Uh, nothing?
May
27
comment What makes functional programming languages declarative as opposed to Imperative?
@Brendan I don't think functional programming is a subset of imperative programming (nor is immutability a mandatory trait of FP). It can be argued that in the case of pure, statically-typed FP, it's a superset of imperative programming where effects are explicit in the types. You know the tongue-in-cheek assertion that Haskell is "the world's finest imperative language" ;)
May
26
comment What makes functional programming languages declarative as opposed to Imperative?
@ALXGTV You can indeed see functional programming as a superset of imperative programming. Your example with Clojure doesn't show reassignment; instead, it's an example of introducing new bindings with the same name (aka "shadowing"). The difference with imperative reassignment is that this effect is not seen outside the scope of the shadowing, whereas if you truly reassigned x, other parts of your function would see the change.
May
26
comment What makes functional programming languages declarative as opposed to Imperative?
@ALXGTV Your intuition is correct: declarative programming "just" provides a higher level of abstraction over certain imperative details. I'd argue this is a big deal!
May
26
revised Taking strong, static typing to an extreme?
removed irrelevant tag
May
24
comment Would it be good to have a readonly modifier for method level variables?
(Cont'd) It doesn't add much visual clutter and it helps add clarity to the intent of the code. It's very similar to Scala's val, which is mandatory (unless using var, of course).
May
24
comment Would it be good to have a readonly modifier for method level variables?
I use final in Java everywhere I can, and have introduced this style to my team. It greatly helps in understanding code. Often, while introducing final to local variables, I discover unintented/error-prone reassignments of the variable. In turn, correcting this often tends to refactoring the whole mess. I also introduced using final in all method arguments, no exceptions allowed.
May
20
revised Software paradigms: prove that sum and sum1 are equal
added a more appropriate tag; still better would be "induction" or "proof" ("scala" hs nothing to do with this question)
May
19
revised Software paradigms: prove that sum and sum1 are equal
code formatting
May
19
comment Software paradigms: prove that sum and sum1 are equal
An idea: prove by induction that k + sum1(xs, 0) = sum1(xs, k). Then use it in the step you're currently stuck.
May
9
comment JUnit Testing in Multithread Application
Please note that these tests won't prove your concurrency issues don't exist anymore. They simply exercise your threads more, and therefore increase the chance of finding concurrency problems if they are there; but I'm afraid this is still no guarantee. Finding and troubleshooting concurrency problems is unfortunately very hard.
May
9
comment JUnit Testing in Multithread Application
JUnit is not only used for unit testing, but also for integration testing. It's very hard to unit test concurrency problems, and the OP doesn't seem to be asking about unit testing, but about automated (integration) testing.
May
7
comment Why is .compareTo() in an interface while .equals() is in a class in Java?
possible duplicate of Java: why is there a Comparator interface but no Hasher and Equator?
May
7
revised Should we define types for everything?
Removed irrelevant tags; the question isn't about OOP or FP, but just about type systems
May
6
comment Why is Lisp useful?
The article by Paul Graham is interesting because, save for a couple of items, most languages these days seem to have the features he lists. So maybe Lisp was more compelling back in those days; nowadays it's more valuable as the language that introduced those features?
Apr
17
comment What exactly makes the Haskell type system so revered (vs say, Java)?
+1 Great answer! This is very powerful and often underappreciated by newcomers to Haskell. By the way, a simpler "impossible" function would be fubar :: a -> b, wouldn't it? (Yes, I'm aware of unsafeCoerce. I assume we aren't talking about anything with "unsafe" in its name, and neither should newcomers worry about it! :D)
Apr
17
comment What exactly makes the Haskell type system so revered (vs say, Java)?
+1 Though it would help explaining that other languages also have Maybe (e.g. Java's Optional and Scala's Option), but in those languages it's a half-baked solution, since you can always assign null to a variable of that type, and have your program explode at run-time. This cannot happen with Haskell [1], because there is no null value, so you simply cannot cheat. ([1]: actually, you can generate a similar error to a NullPointerException using partial functions such as fromJust when you have a Nothing, but those functions are probably frowned upon).
Apr
17
comment best practices for packaging in Scala projects?
Are you talking about Scala package conventions? If so, have you taken a look at the Style Guide?
Mar
31
comment Does path coverage guarantee finding all bugs?
+1 I like this answer because it's constructive and mentions some of the benefits of coverage.
Mar
31
comment Ethicality of online license checks
Nitpick: Piracy is the wrong term for this. Because these are legitimate users (i.e. paying customers), at worst they are violating the terms of your license, but they are not pirating or using pirated software.