3 ms·
I wasn't replying to that article -- at best, I was going off on a tangent prompted by a comment to that article.
by cemerick 17y ago
I wasn't replying to that article -- at best, I was going off on a tangent prompted by a comment to that article.
- nostrademons 17y agoWell, then it's a strawman. ;-) Nobody decent actually writes imperative programs where every function depends upon the global state of the whole program.
- jrockway 17y agoThe problem is that you can't know for sure until you read every line of code in the program, or at least read every function in a given call chain. In languages like Haskell, the type system ensures that there are functions whose effects can be understood by only reading that one function.
- kelnos 17y agoTrue, but you're essentially arguing for a "nanny" language model that doesn't let you do things that someone decided is "unsafe" or "bad design." While I'd agree that writing a program in an imperative language where everything depends on hidden global state is a very poor choice, I'd rather use a language that trusts me to design my application as I see fit.
- jrockway 17y agoNo I'm not. I'm arguing for safety as the default, and un-safety as an option. Haskell gives me this. The usual imperative languages don't even make safety an option. You just have to try hard and hope for the best.
- jimbokun 17y ago'True, but you're essentially arguing for a "nanny" language model that doesn't let you do things that someone decided is "unsafe" or "bad design."' Isn't the same true for, say, garbage collection? Higher level languages are often defined by the things they don't let you do, compared to lower level languages, in order to make your life easier. Of course, if you're a C++ programmer, you probably agree that both mandatory garbage collection and immutable state are equally nanny-language features.
- kelnos 17y ago"Of course, if you're a C++ programmer..." Ugh, no. C programmer. I don't have an intrinsic problem with GC (as it allows me to be lazy), though admittedly there are quite a few bad GC implementations out there that can cause noticeable performance issues. Immutable state has its uses, but, again, it's a question of whether or not it's mandatory.