Earlier quoted context omitted.
It's $current_year and there's still debate whether checking stuff at compilation time is better than at runtime?
People who don't think types are a good thing need to work in a statically typed language for a year or two and then see what a difference it makes in reality. Unproductive Java bureaucracy != static typing. I think the people debating it never tried it seriously.
Tests aren’t enough: Case study after adding type hints to urllib3
31–40 of 205 posts
Re: Tests aren’t enough: Case study after adding type hints to urllib3
#32Earlier quoted context omitted.
I’ve done everything from Haskell to Java and I still strongly prefer Clojure and Common Lisp-style dynamic types.
I have to agree, I've done over 5 years of C# and then went to ruby and never looked back. Static type checking raises the floor on incompetence, but also lowers the ceiling on excellence. I have to admit I don't have experience with the extremes which would be Haskell and Clojure. The amount of cruft I had to type in C# just to get shit done... It's all implicit in ruby thank god for that. I never EVER have to check…
Re: Tests aren’t enough: Case study after adding type hints to urllib3
#33Earlier quoted context omitted.
I've been alive long enough to see that most things are useful, and all things are oversold. More, the nice easy things to build with major restrictions pretty much gets thrown out the window for complicated things that have constraints that most efforts don't have. This isn't just a software thing. Building a little shed outside? Would be silly to use the same rigor that goes into a high rise. Which would be crazy t…
Not that I disagree, but I feel like you are overselling the simplicity of [building a shed]( https://en.wiktionary.org/wiki/bikeshedding ).
And I should have leaned in on how much is still left to implementation in terms of "shed." From weather, to what is being stored. It isn't like there is a universal shed design that will make everyone happy.
Nor is this saying that some things aren't truly valuable. Just recognize that some places they don't help as much as you would like. This isn't saying they are bad or worthless. Just acknowledging that they are oversold.
Re: Tests aren’t enough: Case study after adding type hints to urllib3
#34I love static typing/type hints if for only 1 thing - code maintenance. Even code I wrote six months ago. Not having to dig through 6 functions deep to try to figure out whether "person" is a string, or an object, and if it's an object what attributes it has on it etc. is huge. And not to mention that some clever people decide - hey, if you pass a string I'll look up the person object - so you can pass an object or a…
Doing radical refactoring often involves just making those changes and then fixing all the IDE or compiler errors until it runs again.
Re: Tests aren’t enough: Case study after adding type hints to urllib3
#35Honestly will never go back to languages without type checking, it prevents so many bugs and is a huge help in understanding code you haven’t worked with previously.
Re: Tests aren’t enough: Case study after adding type hints to urllib3
#36Earlier quoted context omitted.
It's $current_year and there's still debate whether checking stuff at compilation time is better than at runtime?
People who don't think types are a good thing need to work in a statically typed language for a year or two and then see what a difference it makes in reality. Unproductive Java bureaucracy != static typing. I think the people debating it never tried it seriously.
I think it ruined a lot of people to static typing and exceptions because Java is/was terrible for both of those things.
Re: Tests aren’t enough: Case study after adding type hints to urllib3
#37I love static typing/type hints if for only 1 thing - code maintenance. Even code I wrote six months ago. Not having to dig through 6 functions deep to try to figure out whether "person" is a string, or an object, and if it's an object what attributes it has on it etc. is huge. And not to mention that some clever people decide - hey, if you pass a string I'll look up the person object - so you can pass an object or a…
I never understood this argument. In what kind of shop are you working that passing a string named person to a method expecting an object is tolerated. Or even passing different types that don't share a common interface. This would never fly in a code review in any of the companies I've worked for.
function find_user(person) {
if user is string {
query_by_name(person)
} else {
query_by_name(person.name)
}
}
and yeah, we all know it's kinda messy, but also that logic has to live somewhere and we need this feature asap so it passes code review. I wrote a test for it, ship it.Re: Tests aren’t enough: Case study after adding type hints to urllib3
#38(edit: corrected "Linda's" to "Pandas" heh, mobile kbd)
Re: Tests aren’t enough: Case study after adding type hints to urllib3
#39I love static typing/type hints if for only 1 thing - code maintenance. Even code I wrote six months ago. Not having to dig through 6 functions deep to try to figure out whether "person" is a string, or an object, and if it's an object what attributes it has on it etc. is huge. And not to mention that some clever people decide - hey, if you pass a string I'll look up the person object - so you can pass an object or a…
If a codebase doesn't have static types, it damn well better be set up to be highly grep-able. Including dependencies and frameworks.
This is why Rails pisses me off so much. No static types to help you out, and you can't grep (can barely google, even!) methods and properties that aren't defined anywhere until runtime. Is this from core? Is it from some 3rd party gem? Well fuck me, this file doesn't even tell me which gems it's relying on, so it could be literally anything in the entire goddamn dependency tree.
Re: Tests aren’t enough: Case study after adding type hints to urllib3
#40Earlier quoted context omitted.
I’ve done everything from Haskell to Java and I still strongly prefer Clojure and Common Lisp-style dynamic types.
I have to agree, I've done over 5 years of C# and then went to ruby and never looked back. Static type checking raises the floor on incompetence, but also lowers the ceiling on excellence. I have to admit I don't have experience with the extremes which would be Haskell and Clojure. The amount of cruft I had to type in C# just to get shit done... It's all implicit in ruby thank god for that. I never EVER have to check…
> I never EVER have to check the type of a variable at runtime.
> I always know its type just by looking at its name
I guess you've only ever written web backends and menial things like that?