Readit News logoReadit News
ervine commented on `satisfies` is my favorite TypeScript keyword (2024)   sjer.red/blog/2024-12-21/... · Posted by u/surprisetalk
amake · a month ago
99% of my use of `satisfies` is to type-check exhaustivity in `switch` statements:

    type Foo = 'foo' | 'bar';
    
    const myFoo: Foo = 'foo';
    switch (myFoo) {
      case 'foo':
        // do stuff
        break;
      default:
        myFoo satisfies never; // Error here because 'bar' not handled
    }

ervine · a month ago
https://typescript-eslint.io/rules/switch-exhaustiveness-che... if that is something you're not aware of!
ervine commented on `satisfies` is my favorite TypeScript keyword (2024)   sjer.red/blog/2024-12-21/... · Posted by u/surprisetalk
ervine · a month ago
You can restructure your JS to avoid some crazy verbose TS though, sometimes. I think that's the point they were making. Why be so hostile?
ervine commented on `satisfies` is my favorite TypeScript keyword (2024)   sjer.red/blog/2024-12-21/... · Posted by u/surprisetalk
lloydatkinson · a month ago
TypeScript codebases I've seen generally seem to have the widest demonstration of skill gap versus other languages I use.

For example, I don't ever see anyone using `dynamic` or `object` in C#, but I will often see less skilled developers using `any` and `// @ts-ignore` in TypeScript at every possible opportunity even if it's making their development experience categorically worse.

For these developers, the `type` keyword is totally unknown. They don't know how to make a type, or what `Omit` is, or how to extend a type. Hell, they usually don't even know what a union is. Or generics.

I sometimes think that in trying to just be a superset of JavaScript, and it being constantly advertised as so, TypeScript does not/did not get taken seriously enough as a standalone language because it's far too simple to just slot sloppy JavaScript into TypeScript. TypeScript seems a lot better now of having a more sane tsconfig.json, but it still isn't strict enough by default.

This is a strong contrast with other languages that compile to JavaScript, like https://rescript-lang.org/ which has an example of pattern matching right there on the home page.

Which brings me onto another aspect I don't really like about TypeScript; it's constantly own-goaling itself because of it's "we don't add anything except syntax and types" philosophy. I don't think TypeScript will ever get pattern matching as a result, which is absurd, because it has unions.

ervine · a month ago
On the other hand, would we even be talking about it if it hadn't stuck to its goals?
ervine commented on At the end you use `git bisect`   kevin3010.github.io/git/2... · Posted by u/_spaceatom
trenchpilgrim · 2 months ago
My team follows good practice but I deal with a vendor who emails us a ZIP file :scream:
ervine · 2 months ago
Honestly it's kind of refreshing to just push files to a server.
ervine commented on At the end you use `git bisect`   kevin3010.github.io/git/2... · Posted by u/_spaceatom
trenchpilgrim · 2 months ago
Including "code is delivered in a way that involves merges"
ervine · 2 months ago
This feels like a "is a hotdog a sandwich?" situation.

"Is sftp-ing to prod a merge?"

ervine commented on At the end you use `git bisect`   kevin3010.github.io/git/2... · Posted by u/_spaceatom
rr808 · 2 months ago
Surely everyone has a CI pipeline that wont allow merges with failing tests?
ervine · 2 months ago
More than one assumption in that sentence, ha!
ervine commented on Just use a button   gomakethings.com/just-use... · Posted by u/moebrowne
giancarlostoro · 2 months ago
Weird, I always use buttons when I can, unless what I need is not actually a button, but something that performs and on-click sort of like a button, like a hyperlink that navigates you through the web app.
ervine · 2 months ago
I guess if it doesn't update the url, it's a button.

If it changes the url, it should be a link. At least that's how I've always done it.

ervine commented on Adding Breadcrumbs to a Rails Application   avohq.io/blog/breadcrumbs... · Posted by u/flow-flow
padjo · 2 months ago
There’s nothing wrong with you, it’s obviously terrible.

Tailwind folks will tell you you’re holding it wrong, but every tailwind codebase I’ve seen winds up like this.

ervine · 2 months ago
I mean the use of tailwind in the article is not good. Shows a lack of CSS understanding. Why are they applying `text-base` instead of just setting that on the root element? Why are they setting text color on the <a> tag and then overriding it on the <span> inside?

This person would write bad CSS, let's not put the blame on tailwind.

Also so much repetition instead of pulling each breadcrumb link out into a shared component. I understand it's just demo code for an article, but if all code bases end up like this that you've seen, the issue isn't tailwind.

ervine commented on Next.js version 15.2.3 has been released to address a security vulnerability   nextjs.org/blog/cve-2025-... · Posted by u/makepanic
IceDane · 9 months ago
I would argue if you're trying to chain middleware or communicate between middleware, you're already holding it wrong. In basically every other framework you would have similar issues, in that there is no good, safe way to achieve what you're describing except persisting some data on an object and then hoping for the best. It's brittle, not type safe and just generally poor design.

With that said, I do agree that nextjs middleware is trash. My main issue with it is that I never use nextjs on vercel, always on node, but I'm still limited in what I can use in middleware because they're supposed to be edge-safe. Eye roll. They are apparently remedying this, but this sort of thing is typical for next.

ervine · 9 months ago
Watch out, Lee is gonna show up and defend this decision and not respond to any valid criticisms.
ervine commented on Tailwind CSS v4.0   tailwindcss.com/blog/tail... · Posted by u/g3eorge
crummy · a year ago
What did you need Tailwind for before that you couldn't do in normal CSS? Doesn't Tailwind map pretty much 1:1 to CSS?
ervine · a year ago
Yes.

u/ervine

KarmaCake day235February 18, 2019View Original