| ??? 01/02/04 19:47 Read: times |
#61779 - RE: Whats wrong with good ol pointer/global? Responding to: ???'s previous message |
I have no problem writing a protocol parser, they are not at all tricky for a well documented protocol. With any complex protocol like modbus or DF1 the data could be small, just 1 register, but the syntax checker will still be a big block of code. In fact it will be almost independent of the data size. So when I am tearing apart the data as I receive it, I will be calling different parts of the code. In such cases functions are created more for keeping the code readable(complexity hiding) and not reusable. For example the reply checking routine for DF1. Though the data is negligible in size, "by reference" would help in writing of code because variables would effectively inherited.
|



