Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Hide won't
Message
De
13/03/2014 08:25:16
 
 
Information générale
Forum:
Javascript
Catégorie:
JQueryUI
Titre:
Divers
Thread ID:
01596038
Message ID:
01596436
Vues:
47
>Would you do the same thing I would?
>
>1. Reformat to get rid of the junk blank lines.

If I have to work with that code not just once, yes

>
>2. Move the code block into a new method. That keeps the mainline code concise.

Refactoring for itself borders on wasteful. Refactoring to get DRY code: certainly. Refactoring en passant while implementing change requests: certainly. Refactoring untouched methods if a large change refactored most of the rest: possibly...

>
>
>>That's a code smell and needs to be refactored.
>>
>>>Yes!
>>>
>>>Especially when you've had a prior programmer who did things like
>>>
>>>if (some condition)
>>>
>>>                          stmt1
>>>
>>>                          stmt2
>>>
>>>                          stmt3
>>>
>>>                          stmt4
>>>
>>>                          stmt5
>>>
>>>                          stmt6
>>>
>>>
>>>                          do case
>>>
>>>                                         case first
>>>
>>>                                         case second
>>>
>>>                          end case
>>>
>>>
>>>
>>>And this goes on for about 200 lines of code = 500 lines in the program.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform