Click here to Skip to main content
15,908,111 members
Home / Discussions / Design and Architecture
   

Design and Architecture

 
QuestionMini-Game Design Pin
Ri Qen-Sin15-Jun-07 16:26
Ri Qen-Sin15-Jun-07 16:26 
AnswerRe: Mini-Game Design Pin
Paul Conrad4-Nov-07 7:09
professionalPaul Conrad4-Nov-07 7:09 
QuestionTo MACRO or not to MACRO Pin
BadKarma14-Jun-07 22:33
BadKarma14-Jun-07 22:33 
AnswerRe: To MACRO or not to MACRO Pin
Rob Graham15-Jun-07 2:19
Rob Graham15-Jun-07 2:19 
GeneralRe: To MACRO or not to MACRO Pin
Pete O'Hanlon15-Jun-07 8:42
mvePete O'Hanlon15-Jun-07 8:42 
GeneralRe: To MACRO or not to MACRO Pin
CPallini15-Jun-07 11:48
mveCPallini15-Jun-07 11:48 
GeneralRe: To MACRO or not to MACRO Pin
alex.barylski22-Jun-07 20:01
alex.barylski22-Jun-07 20:01 
AnswerRe: To MACRO or not to MACRO Pin
Ed.Poore18-Jun-07 1:16
Ed.Poore18-Jun-07 1:16 
The only time I would see as an advantage of using macros is when programming in C (I haven't used C++), an instance of this was some code I wrote for a company who shall remain anonymous where the biggest emphasis was on speed because it was performing rainflow analysis of vast quantities of data, all on a micro.  God forbid but most functions were eliminated in favour of copy and paste and gotos were used because the original idea was then to use an FPGA to do the analysis, i.e. perform it in hardware so because they don't have a concept of functions etc these were copied in and gotos were used because they're nice and fast, especially in hardware.

In the end the other company decided to use a micro and refactored back my optimisations, then hit a problem, it was taking 4 times too long.  I was called in and noticed they were doing stupid things like calling these tiny little functions, if it the micro had been able to manage it it would have had to call this routine 1,000 / second (note this was only a tiny part of the entire, complex algorithm) so I changed the function into a macro so it "looked" like a function to them but actually wasn't.

Of course I guess this is exactly what inline functions are for in C++ but most if not all C compilers don't support them.  So no I can't think of any good reason Roll eyes | :rolleyes:



AnswerRe: To MACRO or not to MACRO Pin
Stephen Hewitt20-Jun-07 22:30
Stephen Hewitt20-Jun-07 22:30 
AnswerRe: To MACRO or not to MACRO Pin
alex.barylski22-Jun-07 19:59
alex.barylski22-Jun-07 19:59 
AnswerRe: To MACRO or not to MACRO Pin
sonofdelphi25-Jun-07 22:46
sonofdelphi25-Jun-07 22:46 
AnswerRe: To MACRO or not to MACRO Pin
me_stargazer6-Jul-07 1:58
me_stargazer6-Jul-07 1:58 
QuestionAnalyst Qyery Pin
monas_2914-Jun-07 3:59
monas_2914-Jun-07 3:59 
AnswerRe: Analyst Qyery Pin
Paul Conrad4-Nov-07 7:10
professionalPaul Conrad4-Nov-07 7:10 
QuestionClass Design Pin
Akbar Ali Hussain13-Jun-07 1:21
Akbar Ali Hussain13-Jun-07 1:21 
AnswerRe: Class Design Pin
Dave Kreskowiak13-Jun-07 4:32
mveDave Kreskowiak13-Jun-07 4:32 
GeneralRe: Class Design Pin
Akbar Ali Hussain18-Jun-07 0:42
Akbar Ali Hussain18-Jun-07 0:42 
GeneralRe: Class Design Pin
Dave Kreskowiak18-Jun-07 2:27
mveDave Kreskowiak18-Jun-07 2:27 
QuestionHelp required in polymorphism Pin
rohan198111-Jun-07 18:16
rohan198111-Jun-07 18:16 
AnswerRe: Help required in polymorphism Pin
led mike12-Jun-07 4:47
led mike12-Jun-07 4:47 
GeneralRe: Help required in polymorphism Pin
Fatbuddha 112-Jun-07 23:55
Fatbuddha 112-Jun-07 23:55 
AnswerRe: Help required in polymorphism Pin
Dave Kreskowiak13-Jun-07 4:26
mveDave Kreskowiak13-Jun-07 4:26 
GeneralRe: Help required in polymorphism Pin
rohan198113-Jun-07 18:06
rohan198113-Jun-07 18:06 
GeneralRe: Help required in polymorphism Pin
rohan198113-Jun-07 18:10
rohan198113-Jun-07 18:10 
GeneralRe: Help required in polymorphism Pin
Dave Kreskowiak14-Jun-07 2:27
mveDave Kreskowiak14-Jun-07 2:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.