3 ms·
Any studies exploring that? Many claims like this are highly prone to confirmation bias. Specifically, you will notice the times it favorably changes your ten
by taeric 9y ago
Any studies exploring that? Many claims like this are highly prone to confirmation bias. Specifically, you will notice the times it favorably changes your tendencies. Ignoring all of the times it was irrelevant or cumbersome.
Note that I am specifically not arguing against immutability. I have, however, seen bugs caused both ways. When I was a TA, Java students were notorious for not understanding why calling "trim" on their string left the whitespace. To often disastrous consequences. I would be delighted to see empirical studies to weigh against all of the anecdotes in my head. :)
- hood_syntax 9y agoI didn't necessarily mean the effects would be positive, just that there would be effects. I would also like to see studies done regarding decisions such as the one we're discussing
- arwhatever 9y agoIt's a kind of trivial side-note, but F# would provide a compiler warning (configurable to be a compilation error, if you like), if you were to call myString.Trim() without binding the result to a value, unless you explicitly pipe the result to "|> ignore". This language in particular has oodles of great default behaviors, most of which can be overridden, but you must do so explicitly. Unfortunately, I have no more data on the real-world results than anyone else. :-)
- icek 9y agoCan I butt in with an aside about how nice F#'s physical unit type handling is? Seriously, that's some nice design right there.
- alcidesfonseca 9y agoI remember this study about the use of final and const keywords in Java/C. http://dl.acm.org/citation.cfm?id=2884798&CFID=985095807&CFTOKEN=21584072 http://dl.acm.org/citation.cfm?id=2884798&CFID=985095807&CFT... It's a small example, maybe it's a start.
- taeric 9y agoFun read, thanks for sharing! It is just a start, so I am hesitant to pick at it. I am excited to see this getting explored, I was hoping for a dive into bug reports against software, though. That is, I share the same bias most of software developers share that mutable code is ultimately dangerous and should be avoided. The flipside, only when working with established codebases does this really bother me. Greenfield projects that are not close to shipping are usually quite clean and not a concern. Battle worn codebases, though... To that end, the CWE attempt (https://cwe.mitre.org/ https://cwe.mitre.org/) was an interesting start. Especially if it was backed by numbers in the CVE database. So my question is, how many of the CVE reports could have fully been laid to this class of bugs? (I'll see if I can put together a notebook going over this idea. Still hoping someone else has already given this a better treatment than I am likely to.)