1. 程式人生 > >構建之法2,3,4,11章

構建之法2,3,4,11章

<span style="font-family: Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255);">每個工程師在軟體生命週期中所做的工作應該有一個流程。單元測試結果應該是一成不變。單元測試必須由熟悉程式碼的人寫。在軟體開發過程中,個人也有獨立的流程。個人要在團隊內容中成長並及時反省。程式碼是給人看的,所以個人程式碼要有一定的規範。要有搭檔在旁邊複審,避免自己找不到自己的錯誤。而兩人合作必定要有一定的磨合適應階段,才能更好的默契合作。</span>
<div class="line number1 index0 alt2" style="line-height: 15.3999996185303px; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; font-size: 14px; margin: 0px !important; padding: 0px 1em !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border-bottom-right-radius: 0px !important; border-bottom-left-radius: 0px !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; min-height: inherit !important; white-space: pre !important; background-image: none !important; background-attachment: initial !important; background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background-position: initial !important; background-repeat: initial !important;"><p><!-- 廣告元件 -->
    <activity android:name="net.youmi.android.AdBrowser" 
        android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
        android:theme="@android:style/Theme.Light.NoTitleBar" >
    </activity>
    <service 
        android:name="net.youmi.android.AdService"  
        android:exported="false" >
    <rvice>
    <receiver android:name="net.youmi.android.AdReceiver" >
        <intent-filter>
            <action android:name="android.intent.action.PACKAGE_ADDED" />
            <data android:scheme="package" />
        </intent-filter>
    </receiver>



    //廣告
    private void loadYMAds() {
        // 例項化 LayoutParams(重要)
        FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams( 
            FrameLayout.LayoutParams.FILL_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT);

        // 設定廣告條的懸浮位置
        layoutParams.gravity = Gravity.BOTTOM | Gravity.RIGHT; // 這裡示例為右下角
        // 例項化廣告條
        AdView adView = new AdView(this, AdSize.FIT_SCREEN);
        adView.setAdListener(new YMAdsListener());
        // 呼叫 Activity 的 addContentView 函式
        this.addContentView(adView, layoutParams);
    }</p>
</div><div class="line number1 index0 alt2" style="line-height: 15.3999996185303px; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; font-size: 14px; margin: 0px !important; padding: 0px 1em !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border-bottom-right-radius: 0px !important; border-bottom-left-radius: 0px !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; min-height: inherit !important; white-space: pre !important; background-image: none !important; background-attachment: initial !important; background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background-position: initial !important; background-repeat: initial !important;">整整一天,我們倆椅子靠椅子的坐在電腦前,一邊討論一般敲程式碼,那次才真正的體會到結對真的能夠帶來效率。一整天的寫程式碼是容易走神的事,還好有同學在旁邊指導,總是不斷在我敲某某變數之前提前告訴我成員變數的名字,資料修改時幫忙檢查是否有漏掉的,變數和函式定義的時候一起為其取名字,感覺有點眼花了,就換了個角色,我也開始對他“指指點點”了,一個人<span style="font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; font-size: 14px; line-height: 15.3999996185303px; white-space: pre; background-color: rgb(240, 240, 240);">敲程式碼</span>,一個人檢查,確實能減少一些不必要的錯誤,減少一些漏洞,演算法實現後一起做些簡單的測試,看到漏洞了再一起分析,我能明顯的感覺到與以前的個人程式設計不一樣,我們能比較快的找到bug初始點,並能提出比較的修改方法。特別是當看到功能進一步實現時,心裡確實挺高興的,更重要的這份感受有同伴與你一起分享。
</div>