558
everywhere I go (discuss.tchncs.de)

cat looking inside box meme

  • yeah our project uses typescript
  • look inside
  • any
you are viewing a single comment's thread
view the rest of the comments
[-] AlecSadler@sh.itjust.works 115 points 3 months ago

In my defense, the backend contracts change so often in early development the any just made sense at first...

...and then the delivery date was moved up and we all just had to ship it...

...and then half of us got laid off so now there are no resources to go back and fix it...

...rinse, wash, repeat

[-] count_dongulus@lemmy.world 21 points 3 months ago

Use the unknown type so at least someone might have enough brain cells to validate before casting because squiggles

[-] bleistift2@sopuli.xyz 18 points 3 months ago

In my defense, the backend contracts change so often in early development the any just made sense at first…

Refactorings and changes are the prime reason to use TypeScript. You edit your data objects and get squigglies everywhere shit won’t work anymore. A godsend!

[-] AlecSadler@sh.itjust.works 10 points 3 months ago

110% agree. But...

One job I worked at wouldn't let us do this because it created too large of a QA impact (lol). We were only allowed to modify code in the smallest section possible so that testing could be isolated and go faster.

At another job they mandated that TypeScript wasn't allowed because it "slowed down development". It was soooo laughable. The number of bugs introduced that could have been readily caught was absurd, but management never put the two pieces together.

[-] lemmyvore@feddit.nl 8 points 3 months ago

Typescript only prevents typing bugs... why did they have so many typing bugs?

[-] AlecSadler@sh.itjust.works 6 points 3 months ago

Typo'd property names when accessing was the biggest one. Assuming a property was one data type instead of another and not casting or handling it appropriately. Accidentally calling something like it's a method when it isn't.

I ran a bunch of plugins on my end to help with some of that, but many of the older or stubborn devs refused and would refuse anything but, like, vim with no add-ons.

[-] bleistift2@sopuli.xyz 5 points 3 months ago

I believe you don’t have to actually use (meaning “compile from”) typescript to profit from it. If you maul the compiler options hard enough, you might get it to analyze JavaScript and provide type checking.

[-] AlecSadler@sh.itjust.works 6 points 3 months ago

That's what I did locally.

But a lot of this JavaScript wasn't even transpiled/compiled for prod, just uploaded to a bucket and referenced directly. It was painful.

[-] bleistift2@sopuli.xyz 4 points 3 months ago

Elderly team mates with the flexibility of concrete, yay!

[-] lemmyvore@feddit.nl 2 points 3 months ago

Oof. I guess you can use typescript to make up for lack of IDE but it sounds like you had bigger problems anyway.

[-] marcos@lemmy.world 8 points 3 months ago

I'd guess the lack of defined backend contracts is caused by the same issue that made you unable to fix those any later.

Anyway, the frontend / backend split is stupid and ridiculous. It's even worse because both sides usually include tasks that do need to be split up.

[-] steuls@sh.itjust.works 6 points 3 months ago

Its sad how relatable this is

[-] hswolf@lemmy.world 5 points 3 months ago

Record<string, unknown> ftw

Sadly, this is the way.

this post was submitted on 20 Jul 2024
558 points (100.0% liked)

Programmer Humor

19452 readers
10 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS