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

うごいてるコードレビュー

 うごいてるコードレビュー

うごイラ Tech Talks

Kazunori Jo

August 01, 2014
Tweet

More Decks by Kazunori Jo

Other Decks in Programming

Transcript

  1. ྫ֎Λ QSJOU4UBDL5SBDF͠ͳ͍ ✘ Bad ! 1 try { 2 //

    something code 3 } catch (SomethingException e) { 4 e.printStackTrace(); 5 }
  2. ྫ֎Λ QSJOU4UBDL5SBDF͠ͳ͍ ✔ Good ! 1 try { 2 //

    something code... 3 } catch (SomethingException e) { 4 // custom log utils 5 LogUtils.e("PixivAndroidApp", "SomethingException", e); 6 }
  3. *%&͕ੜ੒͢Δ ίϝϯτΛফ͢ ✘ Bad ! 1 package jp.pxv.android; 2 3

    /** 4 * Created by Chobi on 2014/05/26. 5 */ 6 7 public class CreatedByComment { IUUQTUBDLPWFSqPXDPNRVFTUJPOT
  4. *%&͕ੜ੒͢Δ ίϝϯτΛফ͢ ✔ Good ! 1 package jp.pxv.android; 2 3

    public class CreatedByComment { IUUQTUBDLPWFSqPXDPNRVFTUJPOT
  5. ఆ਺͸TUBUJDpOBMͰ 1 public class Constants { 2 // ✘ Bad

    3 private final String BAD_FOO = "foo"; 4 private final String BAD_BAR = "bar"; 5 6 // ✔ Good 7 private static final String GOOD_FOO = "foo"; 8 private static final String GOOD_BAR = "bar"; 9 }
  6. ม਺໊ ✘ Bad 1 @Override 2 public void onProgressChanged(float progressRate)

    { 3 final float _progressRate = progressRate; 4 uiThreadHandler.post(new Runnable() { 5 @Override 6 public void run() { 7 if (_progressRate == 1) { 8 progressBar.setVisibility(View.GONE); 9 } 10 } 11 }); 12 }
  7. ม਺໊ ✔ Good 1 @Override 2 public void onProgressChanged(final float

    progressRate) { 3 uiThreadHandler.post(new Runnable() { 4 @Override 5 public void run() { 6 if (progressRate == 1) { 7 progressBar.setVisibility(View.GONE); 8 } 9 } 10 }); 11 }