Please share your tricks for making your Java code concise, still readable.
Coming from Python I'm suffering from "oh, this looks so verbose", it's sometimes hard to fit even in 100-character long lines. I understand Java is a bit more verbose and there's no way around it, but sure there must be small little things that can save some bloat here and there...
Read Bob Martin's Clean Code. It's a book full of tips on exactly this subject: writing well-organised, very readable code, with Java as the example language.
The Ternary Operator (shorthand for if-then-else statement) can be handy.
String value = {condition} ? "Was true" : "Was false";
You can achieve this to some extent on different levels:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With