This week's book giveaway is in the Spring forum.
We're giving away four copies of Spring in Action (5th edition) and have Craig Walls on-line!
See this thread for details.
Win a copy of Spring in Action (5th edition) this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

Working Agreements for Code Review Participants  RSS feed

 
Sheriff
Posts: 12747
210
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Code reviews are an essential part of the development process. They help us improve the quality of our code and catch mistakes that we may have missed somehow, even from just having looked at the code for so long.

Personalities and in particular, ego, can be a hindrance to getting the most out of a code review. It's natural for programmers to become attached to their code. To a certain extent, some attachment to your work is fine. In fact, it's necessary. The pride we have in our work is a big part of how we make it better. However, we can't let our pride get in the way of making improvements. When we get attached to the code we write, we can become very protective of it. This can cause us to overlook some of the code's flaws, much like a mother whose baby only she can love. It can also make us very defensive and closed-minded, taking any criticism of flaws as personal attacks and insults, even when that was not the intent behind the critical comment.

Since I love babies in general, I'd like to stay away from that analogy. I'd rather use "much like a pig farmer, whose pigs only he or she can love" instead. This also leads to one of my favorite things to say to programmers about code smells: "Don't be like a pig farmer who loves his/her pigs no matter how much they stink."

I have practiced egoless programming for a while now and I think this has helped me tremendously in getting over my attachment to code that I write. I can be critical of my code's flaws without any qualms but more importantly, I am able to freely accept reasonable criticism of my code's flaws. I accept the fact that I can make mistakes, that I can come up with dumb designs and less-than-stellar implementations. Much like how warriors can go bravely into battle after having accepted that they are already dead, this kind of mindset frees me to refactor my code ruthlessly and relentlessly. I don't care that others might think I'm dumb; I know I'm not. I just care that the code gets better. The code is not me and its flaws don't define me or my competence as a programmer.

As such, I'd like to propose a standard working agreement between everyone who participates in this Code Review forum. I would like for anyone who wishes to participate to agree to be guided by the precepts of Egoless Programming in pursuit of the ideals of Software Craftsmanship. If the latter is a bit much for you, then at least the former.

Can we all agree to this?

If you would, please respond to the following poll:
 
Junilu Lacar
Sheriff
Posts: 12747
210
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think one tricky part to the egoless programming thing, if you read through Jeff Atwood's list of 10 commandments for it, he writes in commandment #10: "... As much as possible, make all of your comments positive and oriented to improving the code."

Now, the "oriented to improving the code" I can certainly do. However, it's tough to spin a code smell in a positive way. The only thought I have around this is to start comments with something positive about the code before going into details of the smell. Oh well, he does say "As much as possible" so I guess that's my escape clause for talking about code smells.
 
Marshal
Posts: 61715
193
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Junilu Lacar wrote:. . . positive and oriented to improving the code." . . .

“It would be a lot better if you refactored the arrowhead code in lines 7465834‑8745786.”
 
Junilu Lacar
Sheriff
Posts: 12747
210
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Campbell Ritchie wrote:

Junilu Lacar wrote:. . . positive and oriented to improving the code." . . .

“It would be a lot better if you refactored the arrowhead code in lines 7465834‑8745786.”



I know you probably meant that with tongue firmly planted in cheek but it does set a good example. I'm the one who always talks about the sensei who tells students "Yes, that's good! That's good! But this is how you can do it better" even when they are struggling with a technique. I should remember my own stories.

I would still struggle with saying "That's good, that's good!" even when it isn't but I can still say "I think we can improve this code/design by addressing the (optional code smell name) issue I'm sensing from it." It's not really positive but then again, it doesn't start with something that people may find a bit jarring like, "That code smells. We should probably refactor that." It takes a certain level of trust and familiarity with each other to be able to be as upfront and direct as that.
 
Saloon Keeper
Posts: 1174
73
Eclipse IDE Hibernate jQuery MySQL Database Spring Tomcat Server
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Ten Commandments of Egoless Programming will not only be beneficial to programmers but also to the people who work in other fields which are not related to software programming. It has really great advices essential in human life.
 
Software Bot
Posts: 19725
10
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Last vote in cow poll was on November 20, 2018
 
Campbell Ritchie
Marshal
Posts: 61715
193
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Junilu Lacar wrote:. . . tongue firmly planted in cheek . . .

Do you think so?

"Yes, that's good! That's good! But this is how you can do it better" . . .

I have the same difficulty.

I would still struggle with saying "That's good, that's good!" even when it isn't . . . .

Surely there is something good about every post, even if it is only, “You have come to the right place for help 
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
Download Free Java APIs to Work with Office Files and PDF
htttp://www.e-iceblue.com/free-apis.html
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!