Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Dealing With Duplicated Code

Dealing With Duplicated Code

Slides for my presentation at Bulgaria Web Summit 2015 about Code Duplication, what it is, problems, how to find and how to deal with it.

Evaldo Junior

April 18, 2015
Tweet

More Decks by Evaldo Junior

Other Decks in Programming

Transcript

  1. DéjàVu i. jBBZ2i .kBB: ,BBBBBBUi iFBBBBB BBZMMBBBBBZMBBBB88EBP ,BGNE0GZMMBBMG8EZqZBr ;B00NEqE0ZNGNEN0q0N8MZ7. BMZNEqENENEqEqZNZNEEOBBBBME0ZMMEGF5U15J7L7L7vLS25Uq0ZMBMBMBMBBBBBBBBBBBBBMBZPuLi,

    iB80ZNEN0qEqENEN0qZNENZE8OBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBMBBBMMMMOMOM8M8MMBMBBBBBBBBBEU;. iBZZqENENEqEqZNZN0NEqENENE0ZNZ0G0GEG0Z0GEZEGEZ0ZEG0G0ZNZ0Z0Z0Z0ZNE0EqENENZ0ZNZEZEOGMMBBBBBGU, ;BONEq0N0NZNENENENENEqEN0qZNENEqEqZNEqENENZNEqEqENZqENEqZNEq0NEqZq0NENEq0NENZNENEqZ0Z0GZOOBBBBG7. B8GNEqENENENENENENEqZqZN0qZNENENZNENENEN0NEN0NZNENZNZNZNZqENZqZqZNEqEN0qENENENZNEqZqEqENZ0ZZMBBBM; XBZEN0q0qZqZNZNENEqENEN0NENZNEqENZNENEqEqEqEqZNENENZqEN0NENEqZNENENENENENEqENZNEqZqENENEq0NZNZZMBBB2 BBGZN0NENGEO8G0ZNENEqENENZNEqZqENEq0NZNZqEN0NENEqENEqZNEqZqZN0qZqEqENENENEq0NENZNENZqENENENEN8BBBBBB1 BBM8Z8OBBBBBBM0EqEqEqENZN0NENENENENENEN0NENEqENENEqEqENEN0q0qENENZNEN0NENENEqENZNENEqEqZN0NOMv5BBBBBBL 2BBBBBMU: ;BOEEqEq0q0qEq0NEqENZqENENEqZNEq0qENENENZqENEN0qENZqZN0NENZNZNEq0NZqEN0NEq0qENGM8 .YBBBBO rvi YBO0ENEqENEN0N0N0NZqZNEqEqEqENENEqENZqENEq0qENENENEqENENZqENEqENZqZNEqENEN0N00BU 7BBBB: BBGNENEqZqEN0NENZqEqENZNENEN0NEN0qENEN0NENENENENEqZqENZN0q0NENENENZNEqEqEN0qGB7 XBBBi .BB8NEq0qZNEN0NZNZqEqZNENEqENEqENENEqENENEqENEqZNZqENENEqEN0NEqENENEqZNZN0N00Bi ;BBBY ;BBBEGNEEGNEN0NEN0N0NZNENENENEq0N0NEqENZq0NZNENENZqENENENZN0qENENEqZNZNEqENGBU .BBBj FBBBM88FGNENENZqENENENENENEq0NEqENENENEqENEN0NEqEN0NENENEqEqZqEqZNZNZqEqENBq BBBY rMBBrUGEN0NZNEqEN0NENEN0qENENEqEqENENENEN0qZNEq0NEN0NEq0N0qZNEqENENEN0NZOB BBBY :EYB8NZNENENZNZN0N0NZqENZ0ZNENENENZNEN0NENEqENENZNENEqENEqEN0NEN0NEN0q8B; BBBv BOEq0q0N0NENENENENZ0OOMZ8Z80ZEZ0Z0ENENENENENEqEN0NEqENENENEqZNEqENEEBM .BBBr qBNEqENEqENEqZNENGMBBBBBBBBBBBBBBBBBO8EZ0ZqENZNENEqEqENENEq0qENENENZZBr :BBBi MOZNENENZNE0ENENGBB: ,:7YS52LSqMBBBBBBOG0EqENENENENEqE0ENEN0NENENGMB vBBB: SB8NEq0qGZBMGNEqZMB .:7XBB8NZNEqENENENEN8O80ZqZN0NEqGBB 2BBB: ;BO0ZNENGMBq2BGN00B7 kBM0ZqEN0N0NEN8BMBBG80EN0N008BG XBBB ,BBEEqZEMBB7 BOE0OB 8BMEENENEqENGB7 :MBBBOO0ENE08BBj qBB BBEEqEEBBS NB0EOB FBBZZN0NENEEB .2MBBBBMZG08MBB qB NBZZNEEBBi 7BGNB0 ;BBGZ00NZN8B. :jMBBBBZG8B. S 7BGZNE0BB. .BZZB0 OBGZN0qEEBL :UBBMOBU .BOGNZEMB, BM0Bq 2B8ZNENZMB iBBMB BBG0ZZBBj BMGB8 vBZENE0MB: BBB1 OB8EOMBBi XBEBP YB0E08BB :BMB kBMGBBB7 FBMB: JBZ0OBB, BBBi SBM8BBr :BBBN YBMZBBX BMB2 i:rYBBMMBJ OBBBBBB, MBMMBB, BBBE BBBBBBBBBr 5BBBZj : ,5BBBBBY 7BBBBBL YSNM8BMB5 iBBBBBBBBBB1 1BBBB2 7BBBBBBBO;
  2. Wikipedia Duplicate code is a computer programming term for a

    sequence of source code that occurs more than once, either within a program or across different programs owned or maintained by the same entity.
  3. Problems Fix the same bug more than once - Ok,

    now it works in that page, but not in this one.
  4. Problems Adding not standard new features - Why are the

    dates not formated using my preference?
  5. Thank you! благодаря MEGF5U15J7L7L7vLS25Uq0ZMBMBMBMBBBBBBBBBBBBBMBZPuLi, BBBBBBBBBBBBBBBBBBBBBBBBBBMBBBMMMMOMOM8M8MMBMBBBBBBBBBEU;. G0GEG0Z0GEZEGEZ0ZEG0G0ZNZ0Z0Z0Z0ZNE0EqENENZ0ZNZEZEOGMMBBBBBGU, qEqZNEqENENZNEqEqENZqENEqZNEq0NEqZq0NENEq0NENZNENEqZ0Z0GZOOBBBBG7. ENZNENENEN0NEN0NZNENZNZNZNZqENZqZqZNEqEN0qENENENZNEqZqEqENZ0ZZMBBBM; qENZNENEqEqEqEqZNENENZqEN0NENEqZNENENENENENEqENZNEqZqENENEq0NZNZZMBBB2 ZqENEq0NZNZqEN0NENEqENEqZNEqZqZN0qZqEqENENENEq0NENZNENZqENENENEN8BBBBBB1

    NENENENENEN0NENEqENENEqEqENEN0q0qENENZNEN0NENENEqENZNENEqEqZN0NOMv5BBBBBBL EqENZqENENEqZNEq0qENENENZqENEN0qENZqZN0NENZNZNEq0NZqEN0NEq0qENGM8 .YBBBBO N0NZqZNEqEqEqENENEqENZqENEq0qENENENEqENENZqENEqENZqZNEqENEN0N00BU 7BBBB: ENZqEqENZNENEN0NEN0qENEN0NENENENENEqZqENZN0q0NENENENZNEqEqEN0qGB7 XBBBi NZNZqEqZNENEqENEqENENEqENENEqENEqZNZqENENEqEN0NEqENENEqZNZN0N00Bi ;BBBY 0NEN0N0NZNENENENEq0N0NEqENZq0NZNENENZqENENENZN0qENENEqZNZNEqENGBU .BBBj NENZqENENENENENEq0NEqENENENEqENEN0NEqEN0NENENEqEqZqEqZNZNZqEqENBq BBBY 0NZNEqEN0NENEN0qENENEqEqENENENEN0qZNEq0NEN0NEq0N0qZNEqENENEN0NZOB BBBY NENENZNZN0N0NZqENZ0ZNENENENZNEN0NENEqENENZNENEqENEqEN0NEN0NEN0q8B; BBBv 0q0N0NENENENENZ0OOMZ8Z80ZEZ0Z0ENENENENENEqEN0NEqENENENEqZNEqENEEBM .BBBr qENEqENEqZNENGMBBBBBBBBBBBBBBBBBO8EZ0ZqENZNENEqEqENENEq0qENENENZZBr :BBBi ENENZNE0ENENGBB: ,:7YS52LSqMBBBBBBOG0EqENENENENEqE0ENEN0NENENGMB vBBB: q0qGZBMGNEqZMB .:7XBB8NZNEqENENENEN8O80ZqZN0NEqGBB 2BBB: ENGMBq2BGN00B7 kBM0ZqEN0N0NEN8BMBBG80EN0N008BG XBBBi EMBB7 BOE0OB 8BMEENENEqENGB7 :MBBBOO0ENE08BBj qBBB; BBS NB0EOB FBBZZN0NENEEB .2MBBBBMZG08MBB qBBBv Bi 7BGNB0 ;BBGZ00NZN8B. :jMBBBBZG8B. SBBBq . .BZZB0 OBGZN0qEEBL :UBBMOBU ;BBBB7 BM0Bq 2B8ZNENZMB iBBMB 2BBBB1i BMGB8 vBZENE0MB: BBB1 YBBBBBBq: XBEBP YB0E08BB :BMB :5BBBBB FBMB: JBZ0OBB, BBBi .ru7 :BBBN YBMZBBX BMB2 OBBBBBB, MBMMBB, BBBE @InFog9 evaldojunior.com speakerdeck.com/infog github.com/InFog i. jBBZ2i .kBB: ,BBBBBBUi iFBBBBB BBZMMBBBBBZMBBBB88EBP ,BGNE0GZMMBBMG8EZqZBr ;B00NEqE0ZNGNEN0q0N8MZ7. BMZNEqENENEqEqZNZNEEOBBBBME0ZMMEGF5U15J7L iB80ZNEN0qEqENEN0qZNENZE8OBBBBBBBBBBBBBBBB iBZZqENENEqEqZNZN0NEqENENE0ZNZ0G0GEG0Z0GEZ ;BONEq0N0NZNENENENENEqEN0qZNENEqEqZNEqENEN B8GNEqENENENENENENEqZqZN0qZNENENZNENENEN0 XBZEN0q0qZqZNZNENEqENEN0NENZNEqENZNENEqEq BBGZN0NENGEO8G0ZNENEqENENZNEqZqENEq0NZNZ BBM8Z8OBBBBBBM0EqEqEqENZN0NENENENENENEN 2BBBBBMU: ;BOEEqEq0q0qEq0NEqENZqENENE rvi YBO0ENEqENEN0N0N0NZqZNEqEq BBGNENEqZqEN0NENZqEqENZNE .BB8NEq0qZNEN0NZNZqEqZNEN ;BBBEGNEEGNEN0NEN0N0NZNE FBBBM88FGNENENZqENENEN rMBBrUGEN0NZNEqEN0NE :EYB8NZNENENZNZN0N BOEq0q0N0NENENE qBNEqENEqENEqZN MOZNENENZNE0ENE SB8NEq0qGZBMGNEq ;BO0ZNENGMBq2BGN0 ,BBEEqZEMBB7 BOE0 BBEEqEEBBS NB0E NBZZNEEBBi 7BGN 7BGZNE0BB. .BZZ .BOGNZEMB, BM0 BBG0ZZBBj BMG OB8EOMBBi XBE kBMGBBB7 FBM SBM8BBr :BBB i:rYBBMMBJ OBBBBBB