Nah it is what it is. I'm making crud apps for cheap organisations not saving lives.
Every project ever: 'We'll start with TypeScript for structure!' ...three deadlines later: 'Just slap some JavaScript in there, we gotta ship!😂🎉
tbh i wouldn't even care about that if there were tests. write tests. tests will save you. tests are great. you cannot have a serious modern tech stack without tests. I think after the 2018-2019 great hiring, this needs re-iterated. Write tests.
Or at least if you're building a restful api, add in a library that will automatically check the requests and your responses against the openapi specification and throw errors for requests and warnings logged on your end for responses.
I use FastAPI/Pydantic for this - I honestly couldn't imagine writing an API any other way.
It seems a lot of people like to just automatically generate an API spec from their code and annotations so that the spec is just "whatever the code does". I'm sure their users are very happy with them when they keep accidentally deploying non passive changes.
I'm still relatively new to web dev so I can remember a day where I was frustrated that my pydantic schema was throwing an exception because I was missing a value in the response.
Then I started in on Fullstack and holy shit, my pydantic schema throws an exception long before I have to troubleshoot the missing value from the frontend! It's glorious.
I dont like types while writing code but i like types while debugging someone else's code. Am i the problem?
Yes
Only time I would actually use static types is if I CARED.
Honestly, fair enough :D
My first commit at my current job 1.5 years ago was to turn off type checking.
I have committed only JS to the TS repo so far.
I have never been happier and my team has no complaints.
TS makes things so much easier though once you’re used to it
JS skill issue
C-x M-c M-butterfly
Object.is(NaN, NaN); // -> true
NaN === NaN; // -> false
that's a floating-point issue, this one isn't even javascript's fault.
Types are just chains we voluntarily put on ourselves. Cast off your chains brothers! Cast them off I say.
Can we cast these chains this into an integer? Yes or NaN?
[] or ""?
`isPersonAboveMesCakeDay` or `1 // 1`?
That's why I don't like the boastful ideals of typescript, it doesn't actually type anything post-processing but it sure as hell constrains you to write more boilerplate or even perform circus tricks to please the transpiler.
P.s. like there was this one Peacock guy where he spent an entire video on doing no useful work and just fiddling with type descriptions for deeply freezing objects or something. And in the end there wasn't even an indication that he can freeze more than 2 layers of objects.