▲ 243 ▼ new Date("wtf") (jsdate.wtf) submitted 1 year ago by Sheldan@programming.dev to c/programming@programming.dev 51 comments fedilink hide all child comments
[–] FooBarrington@lemmy.world -2 points 1 year ago (2 children) Why? Why not improve JS (e.g. with Temporal), especially given how excellent Typescript is? permalink fedilink source parent hideshow 4 child comments replies: [–] tatterdemalion@programming.dev 10 points 1 year ago (1 child) JS is a lost cause. permalink fedilink source parent hideshow 2 child comments replies: [–] FooBarrington@lemmy.world -2 points 1 year ago (1 child) How? It's easy not to run into the common issues by using TS. What's so bad about it that we should throw away the existing ecosystem? Please give arguments instead of platitudes. permalink fedilink source parent hideshow 2 child comments replies: [–] bleistift2@sopuli.xyz 2 points 1 year ago (1 child) You don’t need to use TS to avoid common issues. If you add an empty object to an empty array and expect a meaningful result, the problem sits in front of the keyboard. permalink fedilink source parent hideshow 2 child comments replies: [–] FooBarrington@lemmy.world 5 points 1 year ago Sure, discipline can prevent some errors. But it's always possible to run into wrong type assumptions, and I'd say type coercion and null/undefined access make up a fairly large percentage of non-logic errors. You can entirely prevent those using Typescript, which is why it's so useful. Static type analysis is always a good idea if you're writing more than a couple lines. IMO Python is the worst offender with its kwargs etc. - discoverability and testability is just so bad if you're following common Python idioms. permalink fedilink source parent [–] Sheldan@programming.dev [S] 5 points 1 year ago (1 child) I wouldn't call typescript excellent, if I did it would be on a very low standard. permalink fedilink source parent hideshow 2 child comments replies: [–] FooBarrington@lemmy.world 0 points 1 year ago (1 child) It unquestionably is excellent. Can you name another language in common use with a type system that's close to the expressiveness of Typescript? permalink fedilink source parent hideshow 2 child comments replies: [–] expr@programming.dev 3 points 1 year ago Let's not get ahead of ourselves. Typescript has a decent type system, but it's hardly state of the art. It's impressive how they've managed to mostly corral JavaScript into something much more sane, but at the end of the day it still suffers greatly from the limitations of JavaScript. They've essentially retrofitted some type theory onto JavaScript to make it possible to express JavaScript nonsense in the type system, but there's plenty of things that would have been designed differently had they been making something from scratch. Not to mention that the type system is unsound by design, which by itself puts it behind languages designed from the ground up to have sound type systems. There's many, many things missing from the type system, like higher-kinded types, type-driven deriving/codegen, generalized algebraic data types (aka GADTs), type families (and relatedly, associated types), existentially-quantified types, and much more. permalink fedilink source parent
[–] tatterdemalion@programming.dev 10 points 1 year ago (1 child) JS is a lost cause. permalink fedilink source parent hideshow 2 child comments replies: [–] FooBarrington@lemmy.world -2 points 1 year ago (1 child) How? It's easy not to run into the common issues by using TS. What's so bad about it that we should throw away the existing ecosystem? Please give arguments instead of platitudes. permalink fedilink source parent hideshow 2 child comments replies: [–] bleistift2@sopuli.xyz 2 points 1 year ago (1 child) You don’t need to use TS to avoid common issues. If you add an empty object to an empty array and expect a meaningful result, the problem sits in front of the keyboard. permalink fedilink source parent hideshow 2 child comments replies: [–] FooBarrington@lemmy.world 5 points 1 year ago Sure, discipline can prevent some errors. But it's always possible to run into wrong type assumptions, and I'd say type coercion and null/undefined access make up a fairly large percentage of non-logic errors. You can entirely prevent those using Typescript, which is why it's so useful. Static type analysis is always a good idea if you're writing more than a couple lines. IMO Python is the worst offender with its kwargs etc. - discoverability and testability is just so bad if you're following common Python idioms. permalink fedilink source parent
[–] FooBarrington@lemmy.world -2 points 1 year ago (1 child) How? It's easy not to run into the common issues by using TS. What's so bad about it that we should throw away the existing ecosystem? Please give arguments instead of platitudes. permalink fedilink source parent hideshow 2 child comments replies: [–] bleistift2@sopuli.xyz 2 points 1 year ago (1 child) You don’t need to use TS to avoid common issues. If you add an empty object to an empty array and expect a meaningful result, the problem sits in front of the keyboard. permalink fedilink source parent hideshow 2 child comments replies: [–] FooBarrington@lemmy.world 5 points 1 year ago Sure, discipline can prevent some errors. But it's always possible to run into wrong type assumptions, and I'd say type coercion and null/undefined access make up a fairly large percentage of non-logic errors. You can entirely prevent those using Typescript, which is why it's so useful. Static type analysis is always a good idea if you're writing more than a couple lines. IMO Python is the worst offender with its kwargs etc. - discoverability and testability is just so bad if you're following common Python idioms. permalink fedilink source parent
[–] bleistift2@sopuli.xyz 2 points 1 year ago (1 child) You don’t need to use TS to avoid common issues. If you add an empty object to an empty array and expect a meaningful result, the problem sits in front of the keyboard. permalink fedilink source parent hideshow 2 child comments replies: [–] FooBarrington@lemmy.world 5 points 1 year ago Sure, discipline can prevent some errors. But it's always possible to run into wrong type assumptions, and I'd say type coercion and null/undefined access make up a fairly large percentage of non-logic errors. You can entirely prevent those using Typescript, which is why it's so useful. Static type analysis is always a good idea if you're writing more than a couple lines. IMO Python is the worst offender with its kwargs etc. - discoverability and testability is just so bad if you're following common Python idioms. permalink fedilink source parent
[–] FooBarrington@lemmy.world 5 points 1 year ago Sure, discipline can prevent some errors. But it's always possible to run into wrong type assumptions, and I'd say type coercion and null/undefined access make up a fairly large percentage of non-logic errors. You can entirely prevent those using Typescript, which is why it's so useful. Static type analysis is always a good idea if you're writing more than a couple lines. IMO Python is the worst offender with its kwargs etc. - discoverability and testability is just so bad if you're following common Python idioms. permalink fedilink source parent
[–] Sheldan@programming.dev [S] 5 points 1 year ago (1 child) I wouldn't call typescript excellent, if I did it would be on a very low standard. permalink fedilink source parent hideshow 2 child comments replies: [–] FooBarrington@lemmy.world 0 points 1 year ago (1 child) It unquestionably is excellent. Can you name another language in common use with a type system that's close to the expressiveness of Typescript? permalink fedilink source parent hideshow 2 child comments replies: [–] expr@programming.dev 3 points 1 year ago Let's not get ahead of ourselves. Typescript has a decent type system, but it's hardly state of the art. It's impressive how they've managed to mostly corral JavaScript into something much more sane, but at the end of the day it still suffers greatly from the limitations of JavaScript. They've essentially retrofitted some type theory onto JavaScript to make it possible to express JavaScript nonsense in the type system, but there's plenty of things that would have been designed differently had they been making something from scratch. Not to mention that the type system is unsound by design, which by itself puts it behind languages designed from the ground up to have sound type systems. There's many, many things missing from the type system, like higher-kinded types, type-driven deriving/codegen, generalized algebraic data types (aka GADTs), type families (and relatedly, associated types), existentially-quantified types, and much more. permalink fedilink source parent
[–] FooBarrington@lemmy.world 0 points 1 year ago (1 child) It unquestionably is excellent. Can you name another language in common use with a type system that's close to the expressiveness of Typescript? permalink fedilink source parent hideshow 2 child comments replies: [–] expr@programming.dev 3 points 1 year ago Let's not get ahead of ourselves. Typescript has a decent type system, but it's hardly state of the art. It's impressive how they've managed to mostly corral JavaScript into something much more sane, but at the end of the day it still suffers greatly from the limitations of JavaScript. They've essentially retrofitted some type theory onto JavaScript to make it possible to express JavaScript nonsense in the type system, but there's plenty of things that would have been designed differently had they been making something from scratch. Not to mention that the type system is unsound by design, which by itself puts it behind languages designed from the ground up to have sound type systems. There's many, many things missing from the type system, like higher-kinded types, type-driven deriving/codegen, generalized algebraic data types (aka GADTs), type families (and relatedly, associated types), existentially-quantified types, and much more. permalink fedilink source parent
[–] expr@programming.dev 3 points 1 year ago Let's not get ahead of ourselves. Typescript has a decent type system, but it's hardly state of the art. It's impressive how they've managed to mostly corral JavaScript into something much more sane, but at the end of the day it still suffers greatly from the limitations of JavaScript. They've essentially retrofitted some type theory onto JavaScript to make it possible to express JavaScript nonsense in the type system, but there's plenty of things that would have been designed differently had they been making something from scratch. Not to mention that the type system is unsound by design, which by itself puts it behind languages designed from the ground up to have sound type systems. There's many, many things missing from the type system, like higher-kinded types, type-driven deriving/codegen, generalized algebraic data types (aka GADTs), type families (and relatedly, associated types), existentially-quantified types, and much more. permalink fedilink source parent