小弟也来分享一个好了, 现在是写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