Click here to Skip to main content
15,886,055 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Code Reviews Pin
iskSYS12-Aug-20 21:17
professionaliskSYS12-Aug-20 21:17 
GeneralRe: Code Reviews Pin
5teveH12-Aug-20 21:40
5teveH12-Aug-20 21:40 
GeneralRe: Code Reviews Pin
iskSYS13-Aug-20 21:18
professionaliskSYS13-Aug-20 21:18 
GeneralRe: Code Reviews Pin
Steve Owen12-Aug-20 21:30
Steve Owen12-Aug-20 21:30 
GeneralRe: Code Reviews Pin
Sander Rossel12-Aug-20 21:47
professionalSander Rossel12-Aug-20 21:47 
GeneralRe: Code Reviews Pin
RooN3y12-Aug-20 22:23
RooN3y12-Aug-20 22:23 
GeneralRe: Code Reviews Pin
Martin ISDN12-Aug-20 23:40
Martin ISDN12-Aug-20 23:40 
GeneralRe: Code Reviews Pin
Davyd McColl13-Aug-20 0:31
Davyd McColl13-Aug-20 0:31 
I think that the three-line version is easier to grok as a reader of the code, especially if you weren't the original author. In a lot of languages, the single-line version is a good starter for a bug:
JavaScript
if (condition) doThing();

becomes
JavaScript
if (condition)
  doThing();

and then someone adds one line, forgetting about the lack of braces
JavaScript
if (condition)
  doThing();
  doTheOtherThing();

and then doTheOtherThing(); is always invoked, which is precisely why most linters will recommend that you rather did:
JavaScript
if (condition) {
  doThing();
}

the first time.

I understand your frustration, but remember that code reviews shouldn't be a place for "standing ground" or duking stuff out. They should be collaborative. So I'd recommend the following:
  1. Ask for the "why" of the comment. If the "why" has value, even if it's not immediately apparent to you, but it's important enough to a team-member, and it doesn't break stuff, then try to accommodate
  2. Update the coding standards doc (whichever way the team agrees is the accepted way) -- it sounds like it's still in the same place, so this sounds like a typical lawyer's argument where one has to refer to precedents rather than simply the letter of the law. It makes it harder for your next new team-member to collaborate
  3. Prefer uniform rules, but even if you all decide that the three-line version has merit, you don't have to go back and fix the entire code-base. As people move through files to update for whatever reason, then they can fix style issues.
This is how we've addressed a number of style issues in our code-bases: discuss, agree, document, fix-up when you're in the area. For example, this in C# has been deemed as "noise", so whenever we work in a file which uses this unnecessarily (it may be required for an extension method, for example), then we clean up that file. Rider / R# makes it easy (alt-enter, enter is often enough). Similarly we can fix-up JS stuff via WebStorm intentions.

/2c, ymmv
------------------------------------------------
If you say that getting the money
is the most important thing
You will spend your life
completely wasting your time
You will be doing things
you don't like doing
In order to go on living
That is, to go on doing things
you don't like doing

Which is stupid.

GeneralRe: Code Reviews Pin
Stefan_Lang13-Aug-20 21:23
Stefan_Lang13-Aug-20 21:23 
GeneralRe: Code Reviews Pin
Matt Bond13-Aug-20 1:52
Matt Bond13-Aug-20 1:52 
GeneralRe: Code Reviews Pin
Stuart Dootson13-Aug-20 2:06
professionalStuart Dootson13-Aug-20 2:06 
GeneralRe: Code Reviews Pin
loctrice13-Aug-20 3:32
professionalloctrice13-Aug-20 3:32 
GeneralRe: Code Reviews Pin
hpcoder213-Aug-20 13:43
hpcoder213-Aug-20 13:43 
GeneralGrowth by shrinkage? Pin
Sander Rossel12-Aug-20 0:11
professionalSander Rossel12-Aug-20 0:11 
GeneralRe: Growth by shrinkage? Pin
Sandeep Mewara12-Aug-20 0:37
mveSandeep Mewara12-Aug-20 0:37 
GeneralRe: Growth by shrinkage? Pin
musefan12-Aug-20 0:38
musefan12-Aug-20 0:38 
GeneralRe: Growth by shrinkage? Pin
GenJerDan12-Aug-20 0:44
GenJerDan12-Aug-20 0:44 
GeneralRe: Growth by shrinkage? Pin
W Balboos, GHB12-Aug-20 0:52
W Balboos, GHB12-Aug-20 0:52 
GeneralRe: Growth by shrinkage? Pin
Nelek12-Aug-20 2:57
protectorNelek12-Aug-20 2:57 
GeneralRe: Growth by shrinkage? Pin
kmoorevs12-Aug-20 4:39
kmoorevs12-Aug-20 4:39 
GeneralRe: Growth by shrinkage? Pin
CodeWraith12-Aug-20 0:57
CodeWraith12-Aug-20 0:57 
GeneralRe: Growth by shrinkage? Pin
Jörgen Andersson12-Aug-20 1:27
professionalJörgen Andersson12-Aug-20 1:27 
GeneralRe: Growth by shrinkage? Pin
Sander Rossel12-Aug-20 2:14
professionalSander Rossel12-Aug-20 2:14 
GeneralRe: Growth by shrinkage? Pin
Jörgen Andersson12-Aug-20 2:16
professionalJörgen Andersson12-Aug-20 2:16 
GeneralRe: Growth by shrinkage? PinPopular
theoldfool12-Aug-20 1:58
professionaltheoldfool12-Aug-20 1:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.