3 ms·
Yeah, my personal experience is that easily 95% of devs I work with/have met in person, if not closer to 99%, prefer statically typed languages. Maybe that’s a
by yashap 2y ago
Yeah, my personal experience is that easily 95% of devs I work with/have met in person, if not closer to 99%, prefer statically typed languages. Maybe that’s a biased sample, but I do think the overall preference among devs is very strong. I also see JS slowly, more-or-less becoming TypeScript over time.
- tstrimple 2y agoMy days of being a real software developer are long behind me. So I'm totally willing to accept that I'm wrong here. But when I build a POC in particular, there's a LOT of power and flexibility granted by not giving a fuck about types. Suddenly I can accept non well defined data types (depending on my implementation) and can persist data that otherwise would have taken code changes and approval processes to accept. I do believe there is a place for types, but to type all the things is folly. There are capabilities within JavaScript to handle both.
- iamsaitam 2y agoThe malicious beauty of typescript is that at any point you can just declare something "any" and voilá, the guard rails are off.
- leshenka 2y agoIt’s fine to have an escape hatch when you can’t figure/don't care about types (yes sometimes you should use unknown but that’s another topic) But at least TS forces (if enabled by strict flag) you to explicitly mark all those places. You can always revisit them later. Case in point: I’ve written A LOT of redux-saga code and figuring out types for that was exceptionally difficult for me. Sprinkled all that with a ton of anys. Had a few bugs but not anything serious. Finally rewriting all that slop with async-await and am really happy about it
- miunau 2y agoJust use `any` or `unknown` when prototyping, then apply types once your happy paths start working for the first time to start catching the unhappy ones.
- djeastm 2y ago>then apply types once your happy paths start working for the first time to start catching the unhappy ones. I.e. the "I'll go back and add safety later" strategy. Somehow I never seem to get around to doing it.
- miunau 2y agoLike documentation, you should do this while it's fresh in your head, but I get it.
- iainmerrick 2y agowhen I build a POC in particular, there's a LOT of power and flexibility granted by not giving a fuck about types I find the same thing, but only for very small throwaway scripts and the like. For anything beyond like 20 lines of code, I rapidly hit confusing cases like “is this parameter just a map, or a map or maps?” Then I add types and it makes sense again.
- yashap 2y agoFor sure, if I’m writing a short script, no more than ~200 LOC, Python (without type hints) is my favourite language. But for a sizeable codebase, worked on by multiple devs or even just me over time, I’ve got an extremely strong preference for static types. Also, FWIW, TypeScript is the most “lightweight” statically typed language I’ve ever used, in terms of extra ceremony/lines of code over a dynamic language. Once you get used to its type system, and embrace the structural typing ideas, I feel the overhead is super minimal. It might slow me down by ~5% on a short script over JavaScript, while dramatically improving maintainability as a codebase grows.
- spaceheater 2y agoLet's make it 94 then. I think typescript is an abomination forced by java developers that don't want to learn javascript.
- wiseowise 2y agoGuard rails on a bridge are an abomination forced onto us by government because people don’t want to learn how to fly.