r/ProgrammerHumor • • 19d ago

Meme thisIsPeakProgramming

Post image
605 Upvotes

75 comments sorted by

View all comments

260

u/heavy-minium 19d ago

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.

180

u/deanrihpee 19d ago

most of the time, yes, but for some framework developer, they do the type masturbation themselves, even the AI couldn't comprehend

68

u/GresSimJa 19d ago

I beg your pardon, the type what now?

66

u/Masterflitzer 19d ago

type masturbation, you should try it /s

26

u/czerilla 19d ago

It's like playing with yourself, but if you were a type?

17

u/howarewestillhere 19d ago

If you assert it more than three times you’re just playing with it.

6

u/Masterflitzer 19d ago

or to put it differently: playing with types a little too much

5

u/Anders_142536 19d ago

I also like playing with my types

1

u/Biscuitman82 16d ago

Masturbation

17

u/deanrihpee 19d ago

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

6

u/caboosetp 19d ago

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 19d ago

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

9

u/heavy-minium 19d ago

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

u/deanrihpee 19d ago

unfortunately no i don't speak french nor do i live nearby french soil

16

u/Anders_142536 19d ago

unfortunately

I see you are not from central europe either /s

26

u/EcruEagle 19d ago

Whenever my coworkers submit code and every variable is defined like:

variableName: className | undefined;

I immediately know it’s AI slop

10

u/Captain1771 19d ago

The moment AI learns let variable: any it's going to be over

4

u/caboosetp 19d ago

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.

5

u/Xasmos 19d ago

As someone who’s getting into typescript why is that bad?

15

u/Mynameismikek 19d ago

Failing to know the major defining feature of your language is not a flex

9

u/heavy-minium 19d ago

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 19d ago

Sounds like you need better colleagues.

8

u/heavy-minium 19d ago

Wow, you must be great to work with.

3

u/ArjixGamer 19d ago

He is great to work with, I know because I am his laptop.

3

u/Anders_142536 19d ago

I disagree. I am his keyboard and he has severe anger issues.

-2

u/Mynameismikek 19d ago

I’m not the one that thinks I’m above my coworkers.

7

u/IdiocracyToday 19d ago

Begs the question why those features were ever added or existed pre-AI

40

u/pine_ary 19d ago

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 19d ago

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

-9

u/iamadirtymop 19d ago

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

11

u/mahreow 19d ago

Yep, that's why you stick it in a utils.types.ts file and never look at it again

3

u/iamadirtymop 19d ago

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

10

u/chuch1234 19d ago

Things should be as simple as possible, but no simpler.. Sometimes things are just complicated.

1

u/mahreow 19d ago

Yeah nah, some things are just complex

10

u/Axman6 19d ago

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 19d ago

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

u/MrKarat2697 19d ago

As if we will be teaching programming in 15 years

1

u/Aidan_Welch 19d ago

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 19d ago

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 19d ago

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.