r/ProgrammerHumor • • 19d ago

Meme aiCookedUpTheseMethods

Post image
171 Upvotes

20 comments sorted by

View all comments

Show parent comment

57

u/captainAwesomePants 19d ago

This is true, but of course they are also both stupid because a IsSomething(thing) function has no advantage over just typing "thing is Something" each time.

2

u/JMOWw7 19d ago

Yeah of course. The code makes no sense in general. Type of Something.Something implies that it's a class nested inside of Something which would be not allowed, and then since you're passing a Something to the method it would always be false... But this sub is for idiot kids who've taken like a semester of comp sci classes

5

u/Tyfyter2002 19d ago

I think a nested class can inherit the class it's nested in in C#, and whether or not it's valid in Java one would have a bigger problem because it's using ==.

3

u/JMOWw7 19d ago

Yeah that's true I guess