Reputation
860
Top tag
Next privilege 1,000 Rep.
See votes, expandable usercard
Badges
7 9
Newest
 Civic Duty
Impact
~21k people reached

  • 0 posts edited
  • 1 helpful flag
  • 307 votes cast
Jan
25
awarded  Civic Duty
Jan
1
comment How can we be certain that the lower components of computer programming like compilers, assemblers, machine instructions, etc. are flawless?
@BlacklightShining: Rust, Haskell, O'Caml, perhaps Idris... but even F# or Scala would make control easier, or, heck, Java.
Dec
31
comment How can we be certain that the lower components of computer programming like compilers, assemblers, machine instructions, etc. are flawless?
@MatthieuM.: well, Heartbleed was eventually discovered. Had it been ClosedSSL, who knows whether it would have ever been properly fixed at all, or just surpressed (perhaps even left as a convenient backdoor </conspiracytheory>)? Granted, it is embarrassing that the bug could go unnoticed for so long (indeed, that the commit which introduced it was ever accepted in the first place), but that has a lot to do with the general bloatedness of OpenSSL. Arguably, disasters like this would also be much less likely if more concise and type-safe languages were used, rather than C.
Nov
23
comment Is there anything that can be done with recursion that can't be done with loops?
@200_success That is indeed arguable, but I don't see how it's relevant anyway. It's a bit like saying a rat knows electronics because its brain and nerves work with electricity. That doesn't mean you need to translate the instructions to a circuit schematic if you want to train a rat to pull a lever.
Nov
23
comment Is there anything that can be done with recursion that can't be done with loops?
@200_success “CPU knows nothing about recursion” – nor does it know about loops. The compiler doesn't translate recursion to loops, rather it translates either to conditional jumps. Yup, good old GOTO is still closest to “the real thing”... (Unless you're programming in Java; I understand it that the JVM knows loops. But that just means there's one more intermediate translation.)
Nov
10
awarded  Good Answer
Oct
30
awarded  Yearling
Oct
24
comment Is a function immediately impure if it takes a function as a parameter?
@Bergi: that's actually not part of Haskell, but of its foreign function interface: to allow asserting that a function defined in some other language is pure, which the Haskell compiler obviously can't infer from the type signature because other languages generally have no such thing as IO. Incidentally, it can also be used to cause mayhem by hiding side-effects in a “pure” function, but that's really unsafe in Haskell because there's not really a reliable way to specify the evaluation order of pure functions.
Oct
23
answered Is a function immediately impure if it takes a function as a parameter?
Jul
19
comment When speaking, how can I say that the time complexity order of an algorithm is O(N log N)?
“can't expect there to be a single word to describe every complexity class” – certainly not. But 𝓞 (n ⋅ log n) is such an important class that it does deserve a name of its own, IMO; and as said by Steve Jessop, linearithmic is pretty common already.
Jun
29
comment How do I design a subclass whose method contradicts its superclass?
I second Steve Jackson. Don't use OO where it's not necessary. Just because Java enforces this style doesn't mean it's a good idea to make everything a class.
May
19
comment How do you avoid getters and setters?
FTR, I think more “experts” still teach to meaninglessly create getters/setters for everything, than to never create any at all. IMO, the latter is less misguiding advice.
Apr
15
comment performance versus reusability
Modularity and optimisation are not necessarily at odds. Modern compilers can inline pretty much anything anywhere, so no matter how modular you write, as long as the compiler can stitch it together to a “non-modular executable”, there's no reason it couldn't be as fast as code that was written non-modular in the first place. Of course, not all compilers can do this very well, but...
Apr
2
comment Does path coverage guarantee finding all bugs?
@MatthewRead: if you apply this consequently, then the “error space” is a proper subspace of the space of all states. Of course it's hypothetical because even the “correct” states make up a far too large space to allow any exhaustive tests.
Apr
2
answered Does path coverage guarantee finding all bugs?
Mar
25
awarded  Nice Answer
Mar
24
answered Is there a reason to have a bottom type in a programming language?
Mar
10
comment Why aren't `void *`'s implicitly cast in C++?
Well, templates aren't really needed for such a complete safe type system: Hindley-Milner based languages get along without them quite well, without implicit conversions at all and no need to write out types explictly either. (Of course, these languages rely on type erasure / garbage collection / higher-kinded polymorphism, things which C++ rather avoids.)
Jan
22
awarded  Yearling
Jan
22
revised class in OOP language and type
added 89 characters in body