RE: [dcdev] Re: New Encoding Scheme First
Fredrik Tolf
2003-12-01 1:21
Direct Connect developers

Zdenek Stangl writes:
> - semi-binary header != binary protocol. All I would like to have is
> the fourcc AND length at the begining of message. Everything else
> remains text-based. With such scheme the debugging is still simple
> + the parsing mechanism would be more generic and fast.

I would have to say that it's _much_ harder to debug if you have to
know in advance how many characters you will type, especially if you
have to type the length in binary format (which for most terminal
emulators is impossible).

Using a pure text based protocols also makes it simpler to use
standard UNIX tools to parse debug information and so on, so at least
in my mind, using a completely text based protocol has many

Personally, I would be pleased to see escaping with both backslashes
and double quotes, but that might just be me, or does anyone else

In any case, when it comes to CPU usage, I believe there are far worse
CPU hogs in a DC client. Stuff like searching and file hashing, and
possibly even translation back and forth from UTF-8 are likely to take
much more CPU than command parsing no matter how much you optimize them
and no matter how many quoting styles you allow in the command
parser. Since it is that way, I'd say that it's preferable to ease
debugging as much as possible before simplifying the command parser
for speed.

I do certainly agree with fourcc commands, though. If not for any
other reason, it allows for faster typing of a command. Maybe it won't
have to be strictly enforced, on the other hand.

That is my opinion. Please tell me if you think I'm wrong about

Fredrik Tolf

DC Developers mailinglist