Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

wxScintilla deprecated warnings

<< < (3/3)

Biplab:
I don't see any reason why macros are that bad. I've C background and I prefer it. :)

I don't see any way to compile the code with wxWidgets 2.6.x without using macro.

--- Code: ---    #if wxCHECK_VERSION(2, 8, 0)
    m_pToolbar->SetInitialSize();
    #else
    m_pToolbar->SetBestFittingSize();
    #endif
--- End code ---

Rather this is good to maintain. Next time if we want to drop support of wxWidgets-2.6.x, we just need to remove the appropriate portion of code.

killerbot:
no no no no no : macros are evil.

Such an ifdef for wx, could be a bit acceptable.
But in regular code, hell no.

Read a book from Sutter or Meyer and you will find some good examples on how bad they are.

The only purpose they are in C++ is because C++ had to support also C code.

MortenMacFly:

--- Quote from: Biplab on June 03, 2007, 04:50:30 am ---I don't see any reason why macros are that bad.

--- End quote ---
There are really good reasons. I'll give you two examples why we would like to use templates instead: If we want tot change the functionality of any macro (imagine e.g. for compatibility flags) we need to change *one* place instead of a hundred across the code. Besides flexibility another reason is that the code is just much more easier to read if you use templates. So I can only really vote for templates.
With regards, Morten.

Biplab:
I agree with you, Martin. I rarely use macro in C::B since prep.h has been introduced. ;)

Navigation

[0] Message Index

[*] Previous page

Go to full version