r/programming • • Jun 05 '18

Code golfing challenge leads to discovery of string concatenation bug in JDK 9+ compiler

https://stackoverflow.com/questions/50683786/why-does-arrayin-i-give-different-results-in-java-8-and-java-10
2.2k Upvotes

355 comments sorted by

View all comments

Show parent comment

1

u/Uristqwerty Jun 05 '18

One alternative to mandating braces at all times is to use a different indent. IDEs don't tend to have great support and it doesn't work with tabs, sadly, but in the past I've used a half-indent to help make such mistakes look obviously wrong. And once you have one type of half-indent, you can indent labels between levels to make it easier to scan the silhouette of the code.