DEV Community

Discussion on: 5 easy wins to refactor even the ugliest code

Collapse
 
mlevkov profile image
Mikhail Levkovsky

100% agreed about calling track.getGenre() once, should definetely do that.
as for that last example, that's actually the good one, where you return from each case, which IMO helps keep the flow of the code linear and simple