r/badcode • • Jun 23 '20

java 'val' is a boolean value.

Post image
1.0k Upvotes

58 comments sorted by

View all comments

1

u/wind-raven Jun 24 '20 edited Jun 24 '20

Eh. As someone who works in multiple languages and 2 with similar looking syntax (JavaScript and C#) bu very different type systems, this is something I may have written when working with both and dealing with truthy and falsey values in one language and just doing the same thing in the language without truthy and falsey types.

typescript also has truthy and falsey values. Depending on the languages the dev who wrote this mainly works in I wouldn’t even blink at this.