r/programming • • May 10 '18

Java: Executing code in comments?!

http://programming.guide/java/executing-code-in-comments.html
260 Upvotes

84 comments sorted by

View all comments

-12

u/dethb0y May 10 '18

Unicode: The Mistake That Keeps On Giving

5

u/slavik262 May 11 '18

What should we use instead?

2

u/Cuddlefluff_Grim May 11 '18

IBM ASCII2, no question.

-2

u/dethb0y May 11 '18

Nothing? why is there a need for there to ever be unicode in source code files, and "so some guy who doesn't want to use ascii can type the weird characters in his native language" doesn't count as a valid reason to introduce this kind of vulnerability.

0

u/[deleted] May 11 '18

[deleted]

-3

u/dethb0y May 11 '18

if some russian API is spewing bad characters, then the solution's not to use the broken API, not to break everything else so it's as broken as the API.

1

u/nathreed May 11 '18

It’s not a vulnerability. This is only a problem in java because java is designed poorly. If the preprocessor/compiler stripped comments out before doing the Unicode to ascii conversion pass, this wouldn’t be an issue. So your “guy” who wants to use the “weird characters in his native language” (when your characters appear just as weird to him) would be able to do that if the idiots at Sun/Oracle had thought this through a bit better.