News for hackers. Stuff that matters.
Re:Stripe is building a Ruby typechecker by matchbok on Sunday June 03, 2018 @07:04PM (#17222957)
I've heard the "mentally model" argument a few times, and tbh I don't quite understand it. You have to model the object regardless, either with types or tons of extra checks to make sure that object has what you need. I've seen so much javascript code do exactly that because the methods had no idea what they were going to be given. The contract of static typing eases that load, I think.
Re:Stripe is building a Ruby typechecker by mmartinson on Monday June 04, 2018 @02:00AM (#17225031)
Ya for sure. Without getting a debugger into the application code, it sometimes seems completely impossible to look at a piece of dynamic code you're not already familiar with and decide if it's going to work. I've found this especially tough during code reviews for new stuff that make heavy use of abstractions, even when the abstractions are good.
Re:Stripe is building a Ruby typechecker by mping on Monday June 04, 2018 @08:27AM (#17227066)
Personally I feel that my mind is registering what each type does, kinda like building a mental dictionary. Dynlangs also have types but in terms of reading code it feels you can just skim through and skip the details. I guess there is a difference in the cognitive load of reading code and writing code.