News for hackers. Stuff that matters.
Re:Open-sourcing MonkeyType – Let your Python code type-hint... by Barrin92 on Thursday December 21, 2017 @04:20PM (#15982867)
There's still a good deal of people who think of static typing as 'limiting', and dynamic typic as 'human'. Matsumoto said as much during (iirc) last years Ruby conf.

I think the reverse is true. Static typing is liberating for humans because it tames complexity. Because I'm not a machine I cannot possibly keep track of fuzzy programs that arise from dynamic typing.

Re:Open-sourcing MonkeyType – Let your Python code type-hint... by dmitriid on Friday December 22, 2017 @11:23AM (#15988561)
> Static typing is liberating for humans because it tames complexity.

It doesn't, though. Not with the currently existing type systems and implementations.

- Without type inference you end up righting multi-tier type declarations everywhere.

- With overly powerful type systems you need something close to a PhD in math to create proper types and then figure them out half a year later when you've already forgotten most of what you did

- Union and intersection types which are extremely valuable are missing from a lot of statically typed languages

And because I'm not a machine I often cannot figure out what a yet another two-hundred multiline error message wants of me. Often I'm happy to just throw an `if (x && x.field){}` and be done with it.

Re:Open-sourcing MonkeyType – Let your Python code type-hint... by Barrin92 on Friday December 22, 2017 @03:40PM (#15990720)
you'll have to expand on this a little for me. I just recently looked at an older Haskell codebase I was working on two years ago, and simply because of a very few straight forward types, nothing special, I could really wrap my head around the code-base a lot easier. Not just because the code tells me in plain text what types occur where, but also because enforcing a strong type system encouraged compositionality and well-formed behaviour in the first place.

If I look at some of the python code I've written, I'll be perfectly honest I often cannot tell you what to make of it any more.

Re:Open-sourcing MonkeyType – Let your Python code type-hint... by dmitriid on Friday December 22, 2017 @05:56PM (#15991599)
Types being code depend on people writing them (as is the rest of the code :) ). I guess you’re lucky/smart that your code base is just simple types.

Quite often people construct complex type hierarchies just because they can (or don’t know better). And it’s a pain to wade through and coerce to what you want it to do.

I’m very much on the fence between static and dynamic typing, having used (and probably abused) both. I prefer a “pragmatically” typed language, but I haven’t come up with a proper definition for it yet :)

Re:Open-sourcing MonkeyType – Let your Python code type-hint... by jw- on Thursday December 21, 2017 @07:43PM (#15984327)
I also get the impression that some people view using dynamically typed languages as a badge of honor, taking more expertise to harness the greater 'expressive' power, all whilst juggling the types in your head. Bad programmers can't use them properly, but if you're one of the good ones then you're not held back by rigid types.

I'm one of the dumb ones and just let the computer do the checking for me.