I think it's actually an awesome solution. I'm not sure what you could do to improve it, given the source code length limitations. Obviously base 15 is not the most readable, but it has a very logical reason to be used that is clearly documented.
absolutely! i haven’t really thought about how i’d solve it myself, but this seems pretty reasonable. the fact that his solution held up to half of all the new rules without him ever knowing about them is proof enough that it’s a good approach lol
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.
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
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
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
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.
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
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.
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
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.
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
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 infer in TS.
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
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.
"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.
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 !
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.
17
u/rinn7e Sep 16 '26
That’s bad formatting not bad language
72
u/Markronom Sep 16 '26
Base 15?! 😭
28
u/deanrihpee Sep 16 '26
Performance? debatable, but this is what peak type masturbation looks like
39
u/OJezu Sep 16 '26
Programmers when actual programming language:
4
u/siliconsoul_ Sep 16 '26
Cronk.
4
u/Forward_Republic_610 Sep 16 '26
Someone devolved typescript to trashscript
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
u/thygrrr Sep 16 '26
Am I a pervert if I say I almost like this?
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
u/SaveMyBags Sep 17 '26
C++ developers: first time?
<Insert meme here>
2
u/OkBeautiful4392 Sep 16 '26
It might not be pretty but it is type safe!
1
u/afdbcreid Sep 25 '26
It sure is peak performance because it is all executed at compile-time.
-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
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.
-8
u/[deleted] Sep 16 '26
Typescript isn't a language and strong typing doesn't automatically make a language good.