PortIO - the PC port I/O library for engineering




What to do if you want to help out on this project

If you're familiar with using PC I/O ports, particularly if you know Windows device drivers, please give me a call! I don't know device drivers very well (yet), so it'll take me a while to get the Win2K/XP port done. If anyone wants to do that themselves, go for it!

Linux support is also open for anyone who wants a crack at it. I have no Linux experience at all, so that'll take even longer. Again, if anyone wants to do that, it's free for the taking.

The PortIO code is exclusively C and C++. Some compilers (eg. MS Visual Studio) can handle mixed-language code easily, but others can't. Since this is to be a cross-platform project, I'd like to keep this just C/C++.

Coding guidelines

Follow the Mozilla coding guidelines where possible. This should stop any problems with obscure corners of the language causing problems.

Use the types defines in "types.hpp" instead of built-in C++ "int" types. We can change the typedefs in "types.hpp" to match the integer length for a specific platform, so that we never get caught with bugs like "int" changing from 32 bits to 16 bits and giving resultant overflow errors, or similar silly problems.

Use defensive coding. For example, if a function returns an error status, check it. Even if you've written that function, and you're sure an error can't happen, check it anyway - someone may change the function later, and your higher-level code could then die horribly. Most of the flakiness of Windows programs is caused by people ignoring this kind of thing. My main requirement for a good piece of code is that after it's written, I shouldn't have to look at it ever again for the rest of the project, so I will always favour slow and solid over fast and flaky!

Please, please, comment your code. Don't just say what it's doing, but also why. In general, over-commenting is better than under-commenting.

Lastly, always remember that the best software design tool is a Word document or sheet of paper, a brain and a bit of time to think about things. Personally, I plan a lot of design stuff in the bath. :-) Just don't reach for the text editor straight away, is my point.