??? 03/16/05 22:22 Read: times |
#89816 - Software Engineering Responding to: ???'s previous message |
Sasha Jevtic said:
But tightly coupled code on an 8051 is no less of a nightmare than tightly coupled code on a PC. Once I have written an embedded DS12887 driver, for example, I want to be able to easily use it in multiple projects. If I used too many globals, this might not be an easy task. It is important to balance the need for performance on and embedded platform with generally accepted software engineering practices. Hmmm... I would agree the need to balance performance with a whole range of other parameters, some of which some people might call 'accepted software engineering practice' but not solely because they are accepted practice. I am keen to adopt relevant aspects of good practice from a variety of other disciplines but doing it 'wholesale' is not, in my view, the right thing to do. Hmm. If by "in assembler none of this is a problem" you mean that everything is fundamentally globally visible and there is no question about what is and is not on the stack, then I agree. As Craig suggested earlier, even though this is generally considered acceptable in assembly language, that does not necessarily make it good software engineering practice. Assembly language does not promote writing loosely coupled, reusable code that exhibits good modularity, data abstraction, information hiding, and other software engineering principles. It does not preclude it, but it is a lot easier to do this in C or another higher level language. Agreed, with my caveat about wholoesale adoption of 'good practice'. I think re-use is much more difficult to achieve in embedded systems because of procesor and hardware specifics. Ian |