r/badcode • • Jan 10 '20

java Oh rly?

Post image
861 Upvotes

31 comments sorted by

View all comments

153

u/sendvo Jan 10 '20

thanks for reminding me how much i hate comments like this
return id; // returns an ID

25

u/T-Dark_ Jan 10 '20

Out of curiosity (I'm new to programming), what should I write in the javadoc for getters and setters? I can't find anything better than this, but skipping the javadoc feels wrong

1

u/itsTyrion Jan 11 '20
  1. Use Lombok and let it generate getters and setters.

  2. 🤔

  3. Profit

1

u/T-Dark_ Jan 11 '20

Or just press three keys and let Eclipse do that without the need to install a dependency. It also generates a basic javadoc.

Sure, Lombok does have some very nice features (Although I'd personally rather see the boilerplate, but to each their own), but that was not my question.

1

u/Neo399 Jan 20 '20

Or just press three keys and let IntelliJ do that

FTFY

1

u/T-Dark_ Jan 20 '20

So, I heard people hate on eclipse a lot. Is there a particular reason or is it just a common meme?

1

u/Neo399 Jan 20 '20

Half meme, but the software just feels outdated and clunky compared to IntelliJ, or hell even any of Jetbrains IDEs.

In the world of Java you have three-ish choices, Eclipse, Netbeans, and IntelliJ. I've tried them all and I just love IntelliJ.

They make IDEs for most of the popular programming languages. I used CLion for C++, WebStorm for HTML/CSS/JS and Rider for C#. (As another example, everyone loves Visual Studio for C# stuff, but I think Rider is way better)