6 ms·
I'm sorry but all those examples and Deno's documentation in general should be in JavaScript. I respect the devs right to choose which ever language they want,
by russellbeattie 5y ago
I'm sorry but all those examples and Deno's documentation in general should be in JavaScript. I respect the devs right to choose which ever language they want, but Deno seems to want to be the standard bearer for the power of scripting and web standards [1]. If that's the case, then they are causing more harm than good by focusing exclusively on TypeScript, which isn't a language as much as a set of macros on top of JS. TS should remain a niche for those projects that can benefit from type safety, not promoted as some sort of better alternative to JavaScript, because it's really not.
1. https://deno.com/blog/v1 https://deno.com/blog/v1
- gmac 5y agoIt’s essentially a subjective question, but FWIW I disagree. I’ve written quite a bit of JS and quite a bit of TS, and I find TS so much better. I’m more productive, generate fewer bugs, and have more fun when writing it.
- crate_barre 5y agoSome part of me wonders if they wrote some clear optimizations for defined types that translate easily to Rust. I could give two shits about types honestly, but I’m also one of those weirdos that keeps function arity low, and object definitions concise. How did people write semi elegant Ruby or python all these years, why wasn’t there such a massive push for types in those languages? Most likely because backend people chose the backend language of their choice, but on the frontend they detested JavaScript (you have no choice, you must JavaScript you anti authoritarian shit heads) so much they had to drown it with some kind of ketchup to make it edible (Typescript).
- triyambakam 5y agoAfter using typed backend languages like Rust and even Go (which is painful in its own right, in my perspective) I would hate to work again on a big Ruby or Python codebase. They feel just as disgusting, to use your metaphor, as using plain Javascript instead of Typescript. > why wasn’t there such a massive push for types in those languages Are you just choosing to ignore all of the history of type checking Python and Ruby?
- crate_barre 5y agoLook, this is going to back and forth. Take a time machine to pre Web 2.0 and explain to everyone why OOP programming sucks. I’d dare you to take it off your resume. But we’re here now right? It’s not hard for me to imagine the reversal of this trend inevitably where everyone goes ‘the fuck are we writing all these verbose types for this dumb web app for?’.
- triyambakam 5y agoI really don't see what the back and forth is. Types are not inherently a fad - but there can be people who promote them with fanaticism as a cure-all or for problems they can't solve. There were people skeptical and critical of OOP when it was popular. I don't believe that OOP is inherently a fad either - it has its place. Different paradigms just get caught in the windstorm of fad interest. > [why] are we writing all these verbose types for this dumb web app for? You can take anything to the extreme, but types are a zero risk, low effort investment that has a quick return. If someone over-types something it's hardly a problem compared to an over engineered OOP codebase.
- crate_barre 5y agoI guess thats my main deal breaker. It’s simply another foot gun to allow people to over abstract. I have no issues with modest typing, it’s nice, it’s clear. I have issues with what entropy inevitably does.
- triyambakam 5y agoSo why are we in disagreement then? I am not advocating fanaticism, you simply seem to have implied and inferred that.
- crate_barre 5y agoSometimes it takes a discussion, I’m not in the business of upvoting or downvoting :p
- triyambakam 5y ago> not promoted as some sort of better alternative to JavaScript, because it's really not. This leaves me skeptical if you have extensive experience with Typescript. It's way more than "oh this is a number not a string." It's "you forgot this property on an object's return type that you built from a response value" or "your Redux reducer doesn't handle all of the possible action types so it will crash at run time"
- crate_barre 5y ago"your Redux reducer doesn't handle all of the possible action types so it will crash at run time" And what are all these dr. Strange multiverse possibilities you speak of? Any semi seasoned JS dev has spidey sense for watching out for null and undefined, and generally you should know the type of what you are returning. Is there that much variability in what you are dealing with? If it’s an array of objects, that’s not hard to hold in your brain, just watch out for empty arrays or null/undefined items.
- triyambakam 5y ago> Is there that much variability in what you are dealing with? Yes. I don't mean any disrespect but again it sounds like you really haven't tried Typescript. Spidey sense can, often and will fail.
- _carbyau_ 5y agoI am not a web dev at all but having something for automatic verification (even if limited) sounds more reliable than the variability of any given dev's "spidey sense".
- deleted 5y ago[deleted]
- spartanatreyu 5y ago> Any semi seasoned JS dev has spidey sense for watching out for null and undefined That comment reeks of the same biases that C/C++ developers make when they admit that a majority of C/C++ bugs are related to hard-to-detect pointer/memory safety issues, but claim that they're a good C/C++ developer because their own code doesn't have such bugs, despite the bugs by their very nature being hard-to-detect.
- jokethrowaway 5y agoThe idea of TS is not bad, but they had to forbid any and other ways to escape the type system. I get tons of runtime errors on my TS projects as well because someone down the chain decided they couldn't be bothered with types. Also, having to do type definitions for modules which don't have types is a massive pain. Overall, I appreciate the type safety, but I don't think TS delivers on that promise and I'd rather use a real typed language.
- deleted 5y ago[deleted]
- nllsh 5y agoDeno can handle plain JavaScript just fine. In what way is targeting TypeScript harmful? How do you differentiate between a project that can benefit from type safety and one that cannot? Why should Deno's documentation be in JavaScript? What does is mean to "respect the devs right to choose which ever language they want"?
- miffy900 5y agoThis reads like you’ve never written a serious app in either JavaScript or Typescript. Willingly using JavaScript over Typescript in 2022 is insanity. There’s a reason Typescript won out over Dart and Flow - and why Javascript preprocessor languages and type checkers like Typescript even exist. It all boils down to one incontrovertible truth: JavaScript really really sucks.