This week's book giveaway is in the Programmer Certification forum.
We're giving away four copies of OCP Oracle Certified Professional Java SE 21 Developer Study Guide: Exam 1Z0-830 and have Jeanne Boyarsky & Scott Selikoff on-line!
See this thread for details.
  • 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Working Agreements for Code Review Participants

 
Sheriff
Posts: 17703
302
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Likes 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 17703
302
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 79969
396
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 17703
302
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Bartender
Posts: 1251
87
Hibernate jQuery Spring MySQL Database Tomcat Server Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Campbell Ritchie
Marshal
Posts: 79969
396
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 
 
Software Bot
Posts: 109345
12
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Last vote in cow poll was on March 1, 2019
 
Don't destroy the earth! That's where I keep all my stuff! Including this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic