中文国产日韩欧美视频,午夜精品999,色综合天天综合网国产成人网,色综合视频一区二区观看,国产高清在线精品,伊人色播,色综合久久天天综合观看

高級程序員和普通程序員在代碼寫法上的差別 -電腦資料

電腦資料 時間:2019-01-01 我要投稿
【www.szmdbiao.com - 電腦資料】

    普通程序員和高級程序員的區(qū)別是:普通程序員用復(fù)雜的代碼解決簡單的問題;而高級程序員能把復(fù)雜的問題簡單化并用簡潔的代碼去實現(xiàn),

高級程序員和普通程序員在代碼寫法上的差別

    下面就列舉一些普通程序員和高級程序員的一些常見的代碼寫法的區(qū)別:

    1.聲明變量的習(xí)慣用法

    普通程序員:

   

String str = ;String src = ;int count = 0;int total = 0;
高級程序員:

   

String str = org.apache.commons.lang3.StringUtils.EMPTY , src = org.apache.commons.lang3.StringUtils.EMPTY;// 多使用常量int count = 0 ,  total = 0;
2.get/set方法的用法:

    普通程序員:

   

String str = obj.getStr();String src = str + src;String test = test();String result = result(test);
高級程序員:

   

String src = obj.getStr() + src;String result = result(test());
3.if比較的習(xí)慣用法:

    普通程序員:

   

if(i==1)	System.out.println(i);public void test(){	if(5<=j){		System.out.println(j大于等于5);			if(10<=j){			System.out.println(j大于等于10);				...		}			}}
高級程序員:

   

if(i==1)	System.out.println(i);public void test(){	if(j<5)		return;	System.out.println(j大于等于5);		if(j<10)		return;	System.out.println(j大于等于10);			...}
4.try/catch的用法:

    普通程序員:

   

public boolean test(){	try{		String str =  , src = ;		...		return true;	}catch(Exception e){		e.printStackTrace();		return false;	}}
高級程序員:

   

public boolean test(){	String str =  , src = ;	try{		...		return true;	}catch(Exception e){		logger.error(...);	}	return false;}

    5.關(guān)于for循環(huán)創(chuàng)建對象:

普通程序員:for(int i=0;i<li><u>高級程序員:</u>

最新文章