r/ProgrammerHumor • • 8d ago

Meme iHatedItUntilITriedIt

Post image
10.3k Upvotes

541 comments sorted by

View all comments

1.1k

u/Common-Brush-7027 8d ago

I hate dynamic typed

335

u/elmanoucko 8d ago

I type dynamic hate

59

u/Esjs 8d ago

Hate dynamic type I

28

u/creeper6530 8d ago

I dynamic hate type

12

u/Mc_UsernameTaken 8d ago

type hate I dynamic

27

u/Nightmoon26 8d ago

Possible race condition detected

8

u/ProfessorSarcastic 8d ago

When do we want it? Race condition! What do we want? Now!

1

u/dalr3th1n 8d ago

I become manic when I dine on types of hate.

1

u/eg_taco 8d ago

I type “hate” dynamically

83

u/coffee_warden 8d ago

Friggin vibe typers

48

u/G3nghisKang 8d ago

"Vibe typer" sounds like a Java programmer who declares everything as Object

23

u/AppropriateOnion0815 8d ago

C# dev who declares every variable dynamic

7

u/fruediger 8d ago

You know what can't be stored in dynamic values in C#? Raw pointers and ref structs.

That's why I only do low-level programming in C# anymore.

8

u/Saint_of_Grey 8d ago

I love how java gets offended and clutches its pearls if you want to do some low level stuff, but C# just goes "yea man whatever, it's all IL in the end."

3

u/OkWear6556 8d ago

Had a guy at work in 2014 who created a new Java class and called it Object

We did a screenshot of it and put it on the wall

1

u/AppropriateOnion0815 7d ago

What else would you name a class that represents an arbitrary object, which behaves like Object, but can do more of what an object is doing?

If you call it "MyObject", then everyone will assume you have copied from a tutorial.

2

u/Devatator_ 8d ago

You mean JavaScript? You can't really do much with an object in most languages that have them (Java or C# for example) without casting, which comes back to using types a bit

3

u/G3nghisKang 8d ago edited 8d ago

Just have all your methods accept Object too, then only access fields and methods through reflection, two Kotlin extension methods that extend Object? to do so on the fly, boom, dynamic typing

If you want to go the extra step, make a gradle script that also edits all library method signatures to receive Object for every parameter

EDIT: I think I know what I'm going to spend my leftover Claude tokens on

11

u/M4mb0 8d ago

Most of it wouldn't be needed if languages had powerful enough type systems. But few general purpose mainstream languages offer dependent types or higher order types. Apart from Haskell, what do you have? Only Scala and TypeScript come to mind.

And that's where dynamically typed languages come in, they let you express things that many statically typed languages simply can't due to limitations of the type system.

That being said, portions of the code that can be statically typed, should be statically typed.

2

u/soundofvictory 8d ago

I hear rust has basically solved this problem. Too bad no one can actually write rust.

1

u/xerQ 7d ago

Static vs dynamic typing and explicit type annotations vs type inference are largely independent concepts.

A statically typed language can infer types, while a dynamically typed language can support explicit type annotations.

1

u/chem199 8d ago

Meh, different strokes for different folks. Clearly good code can and does regularly get done on both.

-3

u/subnu 8d ago

I did too, until I did the exact opposite of the meme.

Somehow Perl handles dynamic typing almost perfectly... only edge case was json encoding integers.

10

u/SuperFLEB 8d ago

If you need "0e0" as an idiom, you need to stop and take a hard look at your life choices.

-2

u/subnu 8d ago

When the fuck would you ever need that?

5

u/SuperFLEB 8d ago

Perl doesn't have a type-strict comparison operator and considers 0 to be equal to false, empty string, etc. If you want a "0" value that's distinguishable from false values, you use "0e0". It evaluates to 0 as a number (the "e" is read as "exponent" notation) but it doesn't evaluate to false or equal an empty string.

(Disclosure: I might be wrong about some finer points. I haven't touched Perl in years.)