??? 12/04/07 16:57 Read: times |
#147858 - I am definitely not arguing against "code reuse" Responding to: ???'s previous message |
Another example, I use my own BOOL type that on an 8051 is a bit var, but on other CPU's is an unsigned char. So for the return val of a function it's handy to just do something like:
BOOL LcdInit(params...); However, I can see no way LcdInit can be 'portable'. BOOL can be individually defined even without #if/#ifdef (I do such by including adef in builda, bdef in build b etc). I am definitely not arguing against "code reuse" and neither am I arguing against a thing like your 'BOOL'. What I am arguang against is these "heroic measures" some insist on taking to make code without modification (save a #define) compile by Keil for a '51, compile by HiTech for a PIG, compile by IAR for an AVR, compile by .... for .... . I am constantly reusing code and some slides in seamlessly some need a bit of attention, but none is written with attention to the explicit purpose of reuse. That it all end up being reusable is just wonderful. Erik |
Topic | Author | Date |
How to write portable code | 01/01/70 00:00 | |
C is a language - not a compiler | 01/01/70 00:00 | |
PL/M | 01/01/70 00:00 | |
Have you considered PLM2C? | 01/01/70 00:00 | |
A good point - often missed | 01/01/70 00:00 | |
So what's the downside? | 01/01/70 00:00 | |
Complex code - Libraries | 01/01/70 00:00 | |
COTS libraries versus inhouse libraries | 01/01/70 00:00 | |
Hence portability is not such a big issue! | 01/01/70 00:00 | |
There are downsides | 01/01/70 00:00 | |
Portability vs. Readability/Maintainability. | 01/01/70 00:00 | |
who gives a hoot about portability | 01/01/70 00:00 | |
Portable by BIOS | 01/01/70 00:00 | |
I give a hoot about portability | 01/01/70 00:00 | |
I am definitely not arguing against "code reuse" | 01/01/70 00:00 | |
HAL | 01/01/70 00:00 | |
Small and easy things that may make Your day | 01/01/70 00:00 | |
The developer is probably the biggest factor | 01/01/70 00:00 | |
I may take issue with this one... | 01/01/70 00:00 | |
general re 'portable code' | 01/01/70 00:00 |