📺 Develpreneur YouTube Episode

Video + transcript

Code Reviews - Part 4

2022-01-06 •Youtube

Detailed Notes

Code reviews are starting to become more common in enterprise development. Dev Ops and related automation have helped shine the light on improving quality and reliability in our processes. This presentation looks at how we can set our teams up for success in code reviews through better and consistent processes. This episode goes over the questions and answers session from the presentation.

Code Reviews In Detail There is a time and place for code reviews. Likewise, there are ways to approach these complex tasks that can make the most of both our time and resources. Nevertheless, this process does not come without cost. Therefore, we need to be intentional in our approach and requirements to craft better code and provide a path for building better developers.

The Mentor-Mastermind Group This series comes from our mentoring/mastermind classes. These classes are virtual meetings that focus on how to improve our technical skills and build our businesses. The goals of each member vary. However, this diversity makes for great discussions and a ton of educational value every time we meet. We hope you enjoy viewing this series as much as we enjoy creating it. As always, this may not be all new to you, but we hope it helps you be a better developer. Drop us a line to find out when the next one is so you can join our group.

Transcript Text
[Music]
and now
i'd like to open up questions comments
hey there rob i wanted to ask uh two
questions that may seem
uh diametrically opposed
um
the first is
you know you've just got a simple code
snippets code smail uh rule just in your
head
there's an exception
that doesn't have a log statement i'm
gonna instantly raise a flag and that's
simple example but you know there are
different uh kind of hard rules that you
may go by as you review code um
when to when the question is when do we
uphold those types of rules
versus uh the second question
um when do we promote uh some hacky type
stuff if i were to
give an example of that you know we may
prime a dependency inside of a static
initializer so that it is ready when the
class is being called in
in in run time so that makes sense uh
that dependency prime may always throw
an exception
and maybe there's a thorough commentary
on why it's there but that said
you know it's a hack all the same or you
may have some other hacks that the
developer may have some other hack that
they use
when are we going hard and fast you know
there's there's no more there's there's
no situation in which a lot an exception
doesn't have a log statement versus when
are we saying hey do something outside
the norm here and that's okay
that's
um that's an excellent question and that
is
a part of what
the code review conversation piece of it
is
uh and where even if you have automated
tools there still needs to be some human
uh potential intervention or interaction
within it
um because within those things like
within those coding tools and some of
the the automated rules you can put
together are things like
um
if we've got a code review tool
that's a developer code review tool like
fisheye and crucible or an example
when you combine that i guess it's
crucible is really the the code review
tool
you can set it up and say hey is any
commit
is going to be held um and you can't do
a you can't complete a pull request
until there are x number of code reviews
that are done on the code and i've
worked in environments that have exactly
that
and
those are the cases where you may look
at it and say okay we've got to do a
code review
but
the person can a person can pass a code
review and say yes it passes
even though the code maybe is is not up
to snuff
and so we we want to be able to wow for
that
but also i think there's a lot of time
well there's there's two cases one
sometimes it's a hack and we know it and
we're going to accept it anyways and
it's the it's the 80 20 rule and that's
where we
as part of that process
is just
note that this is a hack and we put a
little to do in there or or
put some sort of a
a technical debt uh task in the backlog
to say hey we did this
it's what we need right now but at some
point we want to revisit it
and there may be somewhere that's just
part of the code review is that we come
back and we put a comment on that and
say yes this is a hack
but
it makes sense and it's not worth for us
to try to
pick up make up a word de-hackify it
because the
because of the cost or because of
scalability or performance or
the rare cases where this actually
matters
um
so it becomes a this is definitely where
there's a
there has to be human intervention there
is there is human decision that goes
into it
and
i think it's part of your that's part of
your environment is how much do we
accept
hacks and workarounds
and how much do we want to
make sure that we we either don't accept
them or that we
highlight those as things that we do
need to come back and clean up and then
it goes to you know the old
the age-old thing of when do we actually
go back and fix it you know are we an
organization that says we'll fix it
later and then never does or are we an
organization that says we can fix it
later and there's a certain uh
pressure point where we say we've got a
lot of stuff we need to fix so we're
going to do a fix release or a technical
debt release or something along those
lines does that answer your your
question
yes sir yes sir so it's just kind of
finding that balance with the human port
of it all i like that
yes and it's something that's it may be
something that you review on a regular
basis you know maybe when you first
turn on code reviews
you have a
a lower barrier
and then as you get better
you raise that barrier it's just and
particularly this is this is really good
in like the agile sprint world is that
maybe early on you have something that's
got very
uh like for example everything's a
warning
but then as you go further into your
sprints at some point you start turning
stuff on and say oh if this occurs now
it's an error
the eclipse itself has got
really good settings built in for it
where you can you can change that with a
lot of compiler settings and things like
that where you can say oh this is like
deprecated it's a great example i can in
a lot of environments say if something's
deprecated
then i just want to be warned about it
but there's other places you know
there's also an option where i can say
if it's a deprecation it's an error i
want to i need to fix that as opposed to
just say oh yeah that's something i want
to look at later so it's a it can be a
sliding scale essentially or at least a
maybe not but
a changing scale
over time
excellent question good deal
and i just wanted to oh go ahead um
i just wanted to reiterate that um
uh
cross training i mean too many people
shy away from a code review for how they
um may uh
you know be i don't want to say it's not
exposure but you know they may not be as
confident in their skill set or whatever
but that's how you get better
getting other developers to so just
different ways
and learning from others
that's that
i will piggyback on that is that um
sometimes one of the things i did not
bring up in the presentation but it's a
good point is that sometimes code
reviews are limited to people in the
same uh silo so for example if you've
got a team where you've got some let's
say you've got some front-end people
some middle tier people and some
database developers
sometimes it's that the code review has
it's just you know database developers
do database code reviews middle tier do
middle tier reviews front end do
front-end reviews
i think part of the value of
cross-training is to have the other
types of developers
be part of the code review
it may be initially it probably will
slow things down a little bit because
they're having to understand
maybe some differences in that other
uh that other tier or that other
functional area area but over time
it's going to help them at least they've
been exposed to those other areas they
have some knowledge about it and they're
even going to be able to pick up some of
the things to look for in those other
coding areas so it is a way to get
people
out of their coding comfort zone a
little bit and cross train them even
beyond
just
other areas that you know like other
code within their team or their silo and
also you know so they're actually now
seeing the whole
development group and how they are
developing and getting exposed to that
so yeah that's
it's great to point that out
other questions and comments
going once going twice
i don't hear any so
uh that wraps this up a little bit so
not a little bit but completely so as
always uh i appreciate the time and uh
sitting down and
going through this uh not only
for us you know from the developer point
of view but also
uh for us the greater community of
developers is that when we
get together when we spend some time
making ourselves better it's it helps
not only us
but the next guy or gal that comes
behind us
and has to look at our code or look at
the code of other people that we've
influenced so you know we
it's like a you know pebble in a in a
pond kind of thing is that as we get
better
our codes a little better other people
are exposed to our code they get a
little bit better and it just builds and
builds and builds so this is something
that
definitely helps all of us it's not just
a
selfish pursuit
but as always if you have any other
questions if something comes up if if
you want to know more about this if you
want other links or anything like that
or just in general learn more about us
or what we can do or what you can do
you can shoot email at info
developernewer.com you go out to the
developer.com site we have a contact us
form
we have our rbc posts is where we do is
our twitter sometimes to do that i will
we had a developer number one we'll
probably surface a we'll probably go
back and turn back on uh developer door
just because of the
uh the topics rbc post is much more
overall software development we may get
a little more deeper we may split up and
add another twitter at some point so
just sort of keep an eye on that that'll
probably be out on the
developer nerd site or in some sort of a
newsletter
if we do that we have a youtube channel
i just go out to youtube and search for
developer newer and you will find that
there's not too much on that
uh also i've got a link here if you want
to check that out uh vimeo you can go to
vimeo.com developmentor you can see some
of the videos youtubers order form those
tend to be typically the goal is 15 to
20 minutes and
Transcript Segments
1.35

[Music]

27.279

and now

28.4

i'd like to open up questions comments

35.6

hey there rob i wanted to ask uh two

38

questions that may seem

39.76

uh diametrically opposed

41.92

um

42.96

the first is

45.12

you know you've just got a simple code

46.879

snippets code smail uh rule just in your

49.68

head

50.8

there's an exception

52.32

that doesn't have a log statement i'm

54.239

gonna instantly raise a flag and that's

56.399

simple example but you know there are

58.64

different uh kind of hard rules that you

60.879

may go by as you review code um

64.799

when to when the question is when do we

67.28

uphold those types of rules

69.52

versus uh the second question

72.56

um when do we promote uh some hacky type

76.479

stuff if i were to

78.72

give an example of that you know we may

80.4

prime a dependency inside of a static

83.04

initializer so that it is ready when the

85.52

class is being called in

88.24

in in run time so that makes sense uh

91.52

that dependency prime may always throw

94.4

an exception

96.24

and maybe there's a thorough commentary

98.88

on why it's there but that said

102.72

you know it's a hack all the same or you

105.119

may have some other hacks that the

107.2

developer may have some other hack that

108.799

they use

110.479

when are we going hard and fast you know

113.84

there's there's no more there's there's

116.24

no situation in which a lot an exception

118.96

doesn't have a log statement versus when

121.439

are we saying hey do something outside

123.04

the norm here and that's okay

125.52

that's

126.479

um that's an excellent question and that

128.8

is

129.759

a part of what

132.48

the code review conversation piece of it

134.8

is

135.52

uh and where even if you have automated

137.44

tools there still needs to be some human

139.92

uh potential intervention or interaction

142.319

within it

143.599

um because within those things like

145.76

within those coding tools and some of

147.599

the the automated rules you can put

149.36

together are things like

151.12

um

152.48

if we've got a code review tool

155.04

that's a developer code review tool like

158.319

fisheye and crucible or an example

161.519

when you combine that i guess it's

162.56

crucible is really the the code review

164.16

tool

164.959

you can set it up and say hey is any

167.28

commit

168.48

is going to be held um and you can't do

171.44

a you can't complete a pull request

173.84

until there are x number of code reviews

176.08

that are done on the code and i've

178.4

worked in environments that have exactly

180.08

that

181.28

and

182.4

those are the cases where you may look

183.92

at it and say okay we've got to do a

185.2

code review

186.48

but

187.68

the person can a person can pass a code

190.319

review and say yes it passes

192.239

even though the code maybe is is not up

195.12

to snuff

196.879

and so we we want to be able to wow for

199.2

that

200.4

but also i think there's a lot of time

202.56

well there's there's two cases one

205.2

sometimes it's a hack and we know it and

208.159

we're going to accept it anyways and

210.159

it's the it's the 80 20 rule and that's

212.239

where we

213.44

as part of that process

215.92

is just

216.959

note that this is a hack and we put a

219.76

little to do in there or or

222.08

put some sort of a

224

a technical debt uh task in the backlog

227.36

to say hey we did this

229.76

it's what we need right now but at some

232

point we want to revisit it

234.159

and there may be somewhere that's just

236.48

part of the code review is that we come

237.84

back and we put a comment on that and

239.28

say yes this is a hack

241.2

but

242

it makes sense and it's not worth for us

244.08

to try to

245.84

pick up make up a word de-hackify it

249.12

because the

250.72

because of the cost or because of

252.08

scalability or performance or

254.799

the rare cases where this actually

256.799

matters

258.16

um

259.6

so it becomes a this is definitely where

261.68

there's a

262.8

there has to be human intervention there

265.04

is there is human decision that goes

267.28

into it

268.72

and

269.919

i think it's part of your that's part of

271.28

your environment is how much do we

273.199

accept

275.199

hacks and workarounds

277.28

and how much do we want to

279.759

make sure that we we either don't accept

281.919

them or that we

283.84

highlight those as things that we do

285.6

need to come back and clean up and then

287.759

it goes to you know the old

289.52

the age-old thing of when do we actually

292.16

go back and fix it you know are we an

294

organization that says we'll fix it

295.28

later and then never does or are we an

297.52

organization that says we can fix it

298.8

later and there's a certain uh

301.759

pressure point where we say we've got a

303.199

lot of stuff we need to fix so we're

304.4

going to do a fix release or a technical

306.96

debt release or something along those

308.56

lines does that answer your your

310.32

question

313.039

yes sir yes sir so it's just kind of

315.039

finding that balance with the human port

317.12

of it all i like that

318.56

yes and it's something that's it may be

320.56

something that you review on a regular

322

basis you know maybe when you first

324.639

turn on code reviews

326.479

you have a

328.32

a lower barrier

330.479

and then as you get better

332.4

you raise that barrier it's just and

334.479

particularly this is this is really good

336.56

in like the agile sprint world is that

339.759

maybe early on you have something that's

341.919

got very

343.28

uh like for example everything's a

345.199

warning

346.32

but then as you go further into your

348.16

sprints at some point you start turning

349.84

stuff on and say oh if this occurs now

351.52

it's an error

353.44

the eclipse itself has got

355.919

really good settings built in for it

358.4

where you can you can change that with a

360.4

lot of compiler settings and things like

361.919

that where you can say oh this is like

363.68

deprecated it's a great example i can in

366.72

a lot of environments say if something's

368.88

deprecated

370.08

then i just want to be warned about it

371.919

but there's other places you know

373.36

there's also an option where i can say

374.88

if it's a deprecation it's an error i

377.039

want to i need to fix that as opposed to

381.199

just say oh yeah that's something i want

382.88

to look at later so it's a it can be a

385.199

sliding scale essentially or at least a

387.68

maybe not but

389.28

a changing scale

391.28

over time

394.56

excellent question good deal

396.72

and i just wanted to oh go ahead um

399.6

i just wanted to reiterate that um

402.479

uh

403.28

cross training i mean too many people

405.12

shy away from a code review for how they

407.44

um may uh

409.12

you know be i don't want to say it's not

410.8

exposure but you know they may not be as

413.28

confident in their skill set or whatever

415.599

but that's how you get better

417.36

getting other developers to so just

419.919

different ways

421.52

and learning from others

423.759

that's that

425.039

i will piggyback on that is that um

428.319

sometimes one of the things i did not

429.599

bring up in the presentation but it's a

430.96

good point is that sometimes code

433.12

reviews are limited to people in the

434.96

same uh silo so for example if you've

438.16

got a team where you've got some let's

440.16

say you've got some front-end people

441.36

some middle tier people and some

442.88

database developers

444.479

sometimes it's that the code review has

446.639

it's just you know database developers

448.88

do database code reviews middle tier do

451.199

middle tier reviews front end do

453.039

front-end reviews

454.479

i think part of the value of

456.08

cross-training is to have the other

458.4

types of developers

460.56

be part of the code review

462.319

it may be initially it probably will

464.8

slow things down a little bit because

466.639

they're having to understand

469.12

maybe some differences in that other

471.52

uh that other tier or that other

473.28

functional area area but over time

476.479

it's going to help them at least they've

478

been exposed to those other areas they

479.759

have some knowledge about it and they're

481.599

even going to be able to pick up some of

483.759

the things to look for in those other

487.12

coding areas so it is a way to get

489.599

people

490.8

out of their coding comfort zone a

492.24

little bit and cross train them even

494.16

beyond

495.28

just

496.08

other areas that you know like other

498.879

code within their team or their silo and

502

also you know so they're actually now

503.599

seeing the whole

505.44

development group and how they are

507.28

developing and getting exposed to that

509.199

so yeah that's

510.479

it's great to point that out

513.519

other questions and comments

521.599

going once going twice

523.839

i don't hear any so

526.8

uh that wraps this up a little bit so

529.12

not a little bit but completely so as

530.8

always uh i appreciate the time and uh

534.32

sitting down and

535.519

going through this uh not only

538.56

for us you know from the developer point

540.959

of view but also

542.8

uh for us the greater community of

544.72

developers is that when we

546.88

get together when we spend some time

548.56

making ourselves better it's it helps

551.12

not only us

552.399

but the next guy or gal that comes

554

behind us

555.279

and has to look at our code or look at

557.44

the code of other people that we've

558.88

influenced so you know we

561.6

it's like a you know pebble in a in a

563.76

pond kind of thing is that as we get

565.279

better

566.24

our codes a little better other people

567.6

are exposed to our code they get a

568.959

little bit better and it just builds and

570.48

builds and builds so this is something

572.32

that

573.68

definitely helps all of us it's not just

576.24

a

577.04

selfish pursuit

578.72

but as always if you have any other

580.32

questions if something comes up if if

582.56

you want to know more about this if you

584.16

want other links or anything like that

586.48

or just in general learn more about us

589.04

or what we can do or what you can do

592.16

you can shoot email at info

594

developernewer.com you go out to the

596.08

developer.com site we have a contact us

598.88

form

600

we have our rbc posts is where we do is

603.12

our twitter sometimes to do that i will

606.72

we had a developer number one we'll

608.32

probably surface a we'll probably go

609.76

back and turn back on uh developer door

611.92

just because of the

613.92

uh the topics rbc post is much more

616.56

overall software development we may get

618.8

a little more deeper we may split up and

620.72

add another twitter at some point so

622.56

just sort of keep an eye on that that'll

623.92

probably be out on the

625.2

developer nerd site or in some sort of a

627.279

newsletter

628.64

if we do that we have a youtube channel

630.8

i just go out to youtube and search for

632.48

developer newer and you will find that

634.64

there's not too much on that

636.399

uh also i've got a link here if you want

638.32

to check that out uh vimeo you can go to

640.72

vimeo.com developmentor you can see some

642.56

of the videos youtubers order form those

644.88

tend to be typically the goal is 15 to

646.8

20 minutes and