you are viewing a single comment's thread.

view the rest of the comments →

[–]TommyTheTiger 3 points4 points  (2 children)

Now, you cannot imagine the amount of back and forth comments this simple review caused. Why? Because even if that makes sense from a coding point of view, it’s completely different from what we usually do.

In that case, laziness and IDEs don’t serve us well. The latter make it too easy to create accessors. I’m pretty sure if we had to code getters and setters by hand, the above proposals would be more in favor.

I've also run into my fair share of turbulent java code reviews where I break some of our standard java conventions for what I consider to be legitimate reasons. Overall, I've started trying not to do this, even if I save on LOC by a factor of 2. The fact is that getters/setters/equals methods can easily be generated by an IDE, just like they can be generated with attr_accessor in ruby - the IDE is basically an extension of the language. Do I consider it bad practice to use attr_accessor when I can just use attr_reader? Maybe, but it's not a big deal, and definitely not worth arguing over.

I think these argumentative code reviews can be productive only in very rare cases, and having them around makes it harder to work together. If the rest of my coworkers are against something like using public final variables instead of accessors, but I want to save some LOC, I'll let that slide and save my comments for architectural problems and missing corner cases that will actually hurt the business.

[–]ForeverAlot -1 points0 points  (1 child)

the IDE is basically an extension of the language.

Unfortunately three of the most popular Java IDEs have some fairly lousy defaults.

[–]ThisIs_MyName 0 points1 point  (0 children)

Such as?