Search code examples
javacoding-stylereadability

Tips on writing concise and elegant Java


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...


Solution

  • 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.