4 ms·
> There are advantages to not using types, such as a faster development speed In my experience, not even that. Static typing speeds up my day to day programmin
by loup-vaillant 3y ago
> There are advantages to not using types, such as a faster development speed
In my experience, not even that. Static typing speeds up my day to day programming.
You touch this point on later with how IDEs can make your experience nicer with static typing, but I see this even with a REPL: statically detected type errors lead to meaningful error message that are much closer to the actual root cause, and let me fix it quicker than a runtime error would have.
It also liberates my brain from having to think so carefully about types. The compiler is disciplined so I don’t have to be. I can move quicker, with the confidence that a huge class of errors will be caught right away.
Static type systems are in my experience easier to use, speed up development, and increase reliability. The costs? So far I’ve seen only two: they may be harder to learn, and they’re harder to implement.
- jodleif 3y agoSome would argue that exactly that thinking is what makes the software cleaner and better- rather than mush-mash that passes the compiler. I.e what I’m saying is that it might be good to be thinking about exactly what you’re passing in, out and why.
- tines 3y agoIsn't this the same argument that says that we should all write assembly, because you should have to think harder and really know what you're doing?
- Aerbil313 3y agoThe two are not even remotely comparable. Your comment is not thoughtful.
- AnimalMuppet 3y agoOf course it's good to think about what you're passing, and why! Nobody disagrees with that. The issue is, can you think carefully enough, consistently enough, so that you don't need static types? Can your coworkers - all of them? What about future you, and your future coworkers? What about that time that you're in a hurry, or going on vacation the next day, and you're not at the top of your game? If computers have taught us anything, it's that automatic processes are more reliable than manual ones. Personally, I just inherited a code base that is a decade old. I haven't measured, but I'm pretty sure that it's more than 100,000 lines. My current coworkers have two weeks longer on the code base than I do. Static types make this a lot easier. And, if your approach to static typing is "mush-mash that passes the compiler", no, static typing may not save you. But dynamic typing wouldn't, either, with that approach.
- jodleif 3y agoCan’t say I agree. Having spent about 50/50 of my career doing weak/strong typing Im more and more convinced it’s very rarely I miss static type-checks. Though I have been blessed with skilled coworkers and sane languages.
- freilanzer 3y ago"I don't need a compiler because I never make mistakes".
- ddejohn 3y ago>> There are advantages to not using types, such as a faster development speed > In my experience, not even that. Static typing speeds up my day to day programming. Completely agreed. It also completely blows past the whole maintainability argument -- the junior developer you hire in 6 months is going to be much slower getting up to speed on your untyped code (using the "royal you" here). For some, I'm willing to grant that it may be "faster" to write initially, but every developer reading your code written without types thereafter is going to be slower.