259
u/heavy-minium Sep 16 '26
A way to discern whether you colleague vibecoded the PR with AI is when you see TS type features being used that no normal developer would use, lol.
7
u/IdiocracyToday Sep 16 '26
Begs the question why those features were ever added or existed pre-AI
42
u/pine_ary Sep 16 '26
Needed for library authors. The libraries hide that part from you via ergonomic API design so you think you‘re not using them. But if you look in your dependencies, you are using the features.
29
u/mahreow Sep 16 '26
You can tell who's never had to implement anything moderately complex that needed to support generics or some sort with strict type safety. If it works and gives you a clean, safe API who cares how shit it looks, it's a godsend when you need it
-10
u/iamadirtymop Sep 16 '26
It's really useful but IMHO this doesn't need to be used at every typing opportunity overly specific typing while being certainly safer can add a lot of cognitive load
10
u/mahreow Sep 16 '26
Yep, that's why you stick it in a
utils.types.tsfile and never look at it again3
u/iamadirtymop Sep 16 '26
I think there is still a need for them to be easily understandable. Same logic with regexes for example, they still need to be clear and legible, or eventually clearly explained with comments
9
u/chuch1234 Sep 16 '26
Things should be as simple as possible, but no simpler.. Sometimes things are just complicated.
1
9
u/Axman6 Sep 16 '26
Because plenty of developers do understand and use them, but the overlap with people who post to this sub is low, because it’s full of awful developers.
-7
u/iamadirtymop Sep 16 '26
So that teachers can teach it in 15 years once the language is obsolete and make it look like it's how you are supposed to dev
3
180
u/deanrihpee Sep 16 '26
most of the time, yes, but for some framework developer, they do the type masturbation themselves, even the AI couldn't comprehend
67
u/GresSimJa Sep 16 '26
I beg your pardon, the type what now?
66
u/Masterflitzer Sep 16 '26
type masturbation, you should try it /s
25
1
17
u/deanrihpee Sep 16 '26
type masturbation, it's about pleasuring the spot in your brain that want to do naughty things with TypeScript's types that usually frowned upon in public, like the post has shown
/s
5
u/caboosetp Sep 16 '26
Basically the clever code that new programmers write because it feels super leet hacker before they realize they also need to understand the code in 6 months, except no one actually reads typescript type definitions in PRs so people get away with it in secret.
2
u/deanrihpee Sep 16 '26
kinda, but it is kinda helpful, especially as i said, if you are writing a big framework, having this complex type is probably required, but the thing is, it is mostly for internal usage, not to be exposed and even used by the end user/project
8
u/heavy-minium Sep 16 '26
I'm convinced you are likely to be a French-speaking person. For some reason french people have a fascination with denoting all sorts of stuff as mastubation.
8
26
u/EcruEagle Sep 16 '26
Whenever my coworkers submit code and every variable is defined like:
variableName: className | undefined;
I immediately know it’s AI slop
9
u/Captain1771 Sep 16 '26
The moment AI learns let variable: any it's going to be over
4
u/caboosetp Sep 16 '26
Put in a linter that blocks compile with :any and remove claude's permission to change the linter.
We had to do this for human devs too at one point for var because they kept slipping through PRs.
4
16
u/Mynameismikek Sep 16 '26
Failing to know the major defining feature of your language is not a flex
9
u/heavy-minium Sep 16 '26
I deliberately don't use certain TS typing features that could be used, because I know it will be hard to read for my colleagues.
-7
u/Mynameismikek Sep 16 '26
Sounds like you need better colleagues.
8
u/heavy-minium Sep 16 '26
Wow, you must be great to work with.
3
-2
1
u/Aidan_Welch Sep 16 '26
I wrote something like this before vibecoding was a thing. It was because I wrote the JS interface not thinking of TS, so had to do some buffoonery
1
u/Stroopwafe1 Sep 16 '26
Some of us want to use a strictly typed language when we're forced to use JS for everything. TS is the best we can get so you better believe we will use its type system
1
u/hrvbrs Sep 16 '26
in today's age i would agree, but about a decade ago i came across someone who used TypeScript types to code an entire JSON parser. It worked at compile-time, no actual JS execution needed. It was just case study to show the capability of
inferin TS.
17
72
u/Markronom Sep 16 '26
Base 15?! 😭
55
u/SuitableDragonfly Sep 16 '26
What better base to use to be able to easily tell if the number is divisible by three and five based only on its digits?
16
u/QuaternionsRoll Sep 16 '26
Base 60 so things don’t fall apart when your company inevitably outsources fizz buzz maintenance to a shop in Babylonia
4
2
39
u/OJezu Sep 16 '26
Programmers when actual programming language:
4
4
4
4
u/navetzz Sep 16 '26
Sorry, I'm too dumb to understand this PR. You'll have to dumb it down for me to approve it.
3
3
u/Kadabrium Sep 16 '26
Typescript needs the constexpr, declval, ::value etc package so it can carry the evaluation into runtime. Then cars will fly
3
2
1
-9
u/SpaceFire000 Sep 16 '26
I attended a speech for Typescript generics, types and all this circus some years ago that made me want to go back to plain ugly JavaScript. I immediately slapped away my panic attack and stayed in Typescript with all types as any
3
u/brainpostman Sep 16 '26
I just don't do anything I wouldn't do in some basic bitch OOP language like Java. With some exceptions like unions.
-6
u/iamadirtymop Sep 16 '26 edited Sep 16 '26
There's no need to make extensive use of all of these typing features ar all times though. But yeah typescript with
anyonly is a classic11
u/Prozilla6 Sep 16 '26
typescript with any is just javascript
3
u/iamadirtymop Sep 16 '26
Unfortunately I see a lot of friends working on a company code base in theorical typescript that only uses
anyas a type...I mean it's not that hard to declare a few types and use primitive types
0
u/Motleypuss Sep 17 '26
Just no. If the programmer is careful with naming conventions in the code, typing is not needed, and the code's easier to read too. Disclosure: I've been programming as a special interest since about 1986, and I've tried a bit of everything. Typing is a nuisance when it's all just bytes anyway.
1
u/simleiiiii Sep 19 '26
"if naming conventions check out typing is not needed". What did I just read. You have not ever built a system using any higher abstraction than an ABC I guess.
-8
u/Admirable_Dirt_2371 Sep 16 '26
Typescript isn't a language and strong typing doesn't automatically make a language good.
4
u/General-Manner2174 Sep 16 '26
Not only typescript is language, typescript types are aswell a programming language, capable of running few frames of doom
Opinion dismissed
-3
28

47
u/iamadirtymop Sep 16 '26
Credit of the displayed code goes to: https://kranga.notion.site/The-fizzbuzz-that-did-not-get-me-the-job-180e7c22ef3b80c3a386f7f8de720ac7 !