Schwad / PorkCasts-Montana

http://www.porkcast.com/
0 stars 0 forks source link

Flag up copy-code #13

Open Schwad opened 8 years ago

Schwad commented 8 years ago

During a rushed point in the development, I found myself repeating methods throughout the code, where in fact they are only used in one place. The best way to clear this is to have one branch that is just "flagging copy-code" where the developer identifies likely suspects, it is code reviewed, then a separate branch utilized to actually clean it out.

The branch needs to mark the area with a comment that says #KILLING-COPY-CODE-FLAG

I have attached a photo of an example of "copy-code" I tracked today.

screen shot 2015-10-13 at 4 12 50 pm
Schwad commented 8 years ago

I found what looks like copy-code, a potentially rarely or never-used chunk of code in queries#create ; whereas the real path is users#update. I am in another branch but have marked the code with #KILLING-COPY-CODE-FLAG and commented it out.