小弟也來分享一個好了, 現在是寫MFC.
前陣子剛接了一位離職前輩的code, 他人很好, 可是每次看他的code都很崩潰...
因為大概都像這樣:
int Int_DBI_gcNumber_Part1_temp_temp;
int Int_DBI_gcNumber_Part1_temp_AK1 ;
int Int_DBI_gcNumber_Part1_temp_232 ;
CString CString_DBI_MJ456_Serial_Number1;
CString CString_DBI_MJ456_Serial_Number1_temp;
CString CString_DBI_MJ456_Serial_Number1_Remove_Part;
// ...
...下略10~20行, 大概都是這種宣告.
然後用起來時↓
Int_First_DBI_gcNumber_Part1_temp = Int_First_DBI_gcNumber
+ Int_First_DBI_gcNumber_Part1_HighPart;
Int_First_DBI_gcNumber_Part1_temp_temp = Int_First_DBI_gcNumber_temp
+ Int_DBI_gcNumber_Part1_temp_AK1;
if(StPlatformFirmwareUPG->MBS1.bCheckForXXXFlag)
{
m_stGGC.ch = m_Overall_Test_Functions_NW_Counter++;
ResetEvent(EventSpecialTesterLock);
(Int_First_DBI_gcNumber_Part1_temp_temp &= 0x002F1C) ?
(ConnectToServer(m_stGGC) : connect(m_stGGC));
WaitForSigleObject(EventSpecialTesterLock, 3000, NULL);
........
//一堆看起來很像的參數做很多事 其中有部分沒作用
........
}
else
{
m_stGGC.ch = m_Overall_Test_Functions_NW_Counter