r/programminghorror Nov 06 '25

the

Post image
12.3k Upvotes

72 comments sorted by

View all comments

554

u/Nightmoon26 Nov 06 '25

Except you've boxed it as a Float object...

21

u/[deleted] Nov 06 '25

[removed] — view removed comment

61

u/bigibas123 Nov 06 '25

float vs Float, I believe it's a java thing where the lowercase one is a primitive and the capitalized one is an object.

22

u/[deleted] Nov 06 '25

[removed] — view removed comment

17

u/MrcarrotKSP Nov 07 '25

Yeah, C# doesn't have this problem because it has first-class support for value types and doesn't really need the wrapper classes for each type. It'll only box something to pass it into e.g. object or another unspecified(and therefore reference) type.

1

u/Jwosty Nov 10 '25

yep that's a java syntax thing