Name: Anonymous 2014-05-24 0:11
What's your opinion on DI? is it just enterprise overengineering shit or it actually makes your code better and testable?
The OO Nazis may think that they have silenced my heretical viewpoint, but [...]
wrap it inside a macro, which will mock the environment.this is why i actually prefer dynamic binding to lexical binding.
this is why i actually prefer dynamic binding to lexical binding.Who needs dynamic binding when you have monads? You do have monads, don't you?
C might have weak typing but it is kind of necessary when you're dealing with low-level stuff.It's not necessary. C's weak type system more likely has something to do with compiler complexity and the computing power available.
The static typing is also, in some way, a compensation for its loose type system.It helps, but C will coerce at the drop of a hat. I find I can't rely on it. One thing that works fairly well is creating a new type alias simply to tag it in a newtype sort of fashion. It's not foolproof, and super clunky looking in C, but you can use it to make your code clearer. (See: boolean trap.)
type errors halt execution in any language, even in Javashit.You have to be very inventive to produce a type error in Perl, because almost any combination of symbols makes sense with Perl
data Foo = A Int | B Double
data Bar = C Int | D Double | E Text
data Foo = A Int | B Double
data Bar = A Int | B Double | E Text