class testme
{
public:
testme();
// testme(int a);
// do this way (this is not connected to current problem but will help you avoid other one)
explicit testme(int a);
void incr();
};
class testme
{
public:
testme();
// testme(int a);
// do this way (this is not connected to current problem but will help you avoid other one)
explicit testme(int a);
void incr();
};
I worked in a small company as a tech lead and a c++ developer but due to troubles with paing salary in time. I've said them goodbuy and found new job as a C# senior developer... hmm after two weeks of inactivity (no projects) I was assigned to VB.NET project (dammmnnn... - it's first WTF)... by the way... I have to deal with the following code:
<FONT color=#0000ff size=2>Protected</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>Overridable</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>Function</FONT><FONT size=2> releaseObjects() </FONT><FONT color=#0000ff size=2>As</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>Integer
</FONT><FONT size=2></FONT><FONT color=#0000ff size=2>Try
</FONT><FONT size=2>l_MyParent = </FONT><FONT color=#0000ff size=2>Nothing
</FONT><FONT size=2>oPrimaryKeys = </FONT><FONT color=#0000ff size=2>Nothing
</FONT><FONT size=2>oAdditionalInfo = </FONT><FONT color=#0000ff size=2>Nothing
</FONT><FONT size=2>l_strAction = </FONT><FONT color=#0000ff size=2>Nothing
</FONT><FONT size=2>TbrToolBar = </FONT><FONT color=#0000ff size=2>Nothing
</FONT><FONT size=2>MnuToolBar = </FONT><FONT color=#0000ff size=2>Nothing
</FONT><FONT size=2>btCut = </FONT><FONT color=#0000ff size=2>Nothing
</FONT><FONT size=2>btCopy = </FONT><FONT color=#0000ff size=2>Nothing
</FONT><FONT size=2>btPaste = </FONT><FONT color=#0000ff size=2>Nothing
</FONT><FONT size=2></FONT><FONT color=#008000 size=2>'btSpellCheck = Nothing
</FONT><FONT size=2>btSave = </FONT><FONT color=#0000ff size=2>Nothing
</FONT><FONT size=2>btRefresh = </FONT><FONT color=#0000ff size=2>Nothing
</FONT><FONT size=2>btClose = </FONT><FONT color=#0000ff size=2>Nothing
</FONT><FONT size=2>btPrint = </FONT><FONT color=#0000ff size=2>Nothing
</FONT><FONT size=2>btExcel = </FONT><FONT color=#0000ff size=2>Nothing
</FONT><FONT size=2>btExit = </FONT><FONT color=#0000ff size=2>Nothing
</FONT><FONT size=2>btHelp = </FONT><FONT color=#0000ff size=2>Nothing
</FONT><FONT size=2></FONT><FONT color=#0000ff size=2>Catch</FONT><FONT size=2> oException </FONT><FONT color=#0000ff size=2>As</FONT><FONT size=2> Exception
</FONT><FONT color=#008000 size=2>'Error
</FONT><FONT size=2>generalErrorHandler(oException, </FONT><FONT color=#0000ff size=2>Me</FONT><FONT size=2>.Text, </FONT><FONT color=#800000 size=2>"Error while releasing objects instances."</FONT><FONT size=2>)
</FONT><FONT color=#0000ff size=2>Return</FONT><FONT size=2> GeneralConstants.APP_ERROR
</FONT><FONT color=#0000ff size=2>Finally
</FONT><FONT size=2></FONT><FONT color=#008000 size=2>'Free mem
</FONT><FONT size=2></FONT><FONT color=#0000ff size=2>End</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>Try
</FONT><FONT size=2></FONT><FONT color=#008000 size=2>'Return OK
</FONT><FONT size=2></FONT><FONT color=#0000ff size=2>Return</FONT><FONT size=2> GeneralConstants.SUCCESS
</FONT><FONT color=#0000ff size=2>End</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>Function
</FONT><FONT size=2></FONT><FONT color=#0000ff size=2></FONT>
<FONT color=#0000ff size=2></FONT>
<FONT color=#0000ff size=2>Protected</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>Overrides</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>Function</FONT><FONT size=2> releaseObjects() </FONT><FONT color=#0000ff size=2>As</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>Integer
</FONT><FONT size=2></FONT><FONT color=#0000ff size=2>Try
</FONT><FONT size=2></FONT><FONT color=#0000ff size=2>MyBase</FONT><FONT size=2>.releaseObjects()
</FONT><FONT color=#0000ff size=2>If</FONT><FONT size=2> (</FONT><FONT color=#0000ff size=2>Not</FONT><FONT size=2> oSQLData </FONT><FONT color=#0000ff size=2>Is</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>Nothing</FONT><FONT size=2>) </FONT><FONT color=#0000ff size=2>Then</FONT><FONT size=2> oSQLData.Close()
oSQLData = </FONT><FONT color=#0000ff size=2>Nothing
</FONT><FONT size=2>myWindowToCreate = </FONT><FONT color=#0000ff size=2>Nothing
</FONT><FONT size=2>dtCombo = </FONT><FONT color=#0000ff size=2>Nothing
</FONT><FONT size=2></FONT><FONT color=#0000ff size=2>Catch</FONT><FONT size=2> oException </FONT><FONT color=#0000ff size=2>As</FONT><FONT size=2> Exception
generalErrorHandler(oException, </FONT><FONT color=#0000ff size=2>Me</FONT><FONT size=2>.Text, </FONT><FONT color=#800000 size=2>"Error while releasing objects instances."</FONT><FONT size=2>)
</FONT><FONT color=#0000ff size=2>Return</FONT><FONT size=2> GeneralConstants.APP_ERROR
</FONT><FONT color=#0000ff size=2>End</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>Try
</FONT><FONT size=2></FONT><FONT color=#0000ff size=2>Return</FONT><FONT size=2> GeneralConstants.SUCCESS
</FONT><FONT color=#0000ff size=2>End</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>Function</FONT>
<FONT color=#0000ff size=2></FONT>
<FONT color=#0000ff size=2>Guess how many times did I asked myself WTF?
</FONT>