what makes a good computer control interface

C

Thread Starter

cliffordcbk

what makes a good computer control interface?
just if my last one didn't make any sense.

any suggestions on making a program for relay controller that works under any version of O.S. window or mac under the same code if that's possible?

a complete change of command codes so that any OS can operate under any programming program will work with out change in standardization if its possible?
 
M

Michael Griffin

In reply to cliffordcbk - I am not sure if I understand your question fully, but I will try to answer at least part of if.

For making a program that runs under any operating system, you need to take several factors into account. To begin with, most non-trivial programs (i.e. something more than just "hello world") cannot be made to run under "any" operating system. You need to pick your targets and write accordingly. You have mentioned MS-Windows, and Mac, so I will deal with those, and throw in Linux as well. Those three cover the major PC desktop operating systems. You could add BSD, Solaris, QNX, etc. according to your desires. More supported platforms however, mean more work, and possibly more expense (if you have to set up more hardware for testing).

First, you have to pick a portable development language. That is, you need a language that is available for all the platforms. When you pick a particular language, you also should have a very strong preference for using the same compiler or interpreter as well. For example, if you write the software in 'C' or 'C++', then you may wish to use 'gcc' on all platforms. The reason for this is to avoid having to deal with slight implementation differences between compilers from different suppliers. You *can* use different compilers (e.g. MS and gcc and Metroworks), but that will involve extra work.

If your software has a non-trivial user interface, then you need a portable GUI toolkit. Some examples of this are QT, GTK+, wxWidgets, and TK. You may have some problems here, as many of the toolkits support the Mac via X11, rather than through the native GUI. The GUI will still work, but it won't look exactly like a native Mac program.

An alternative is to use a web interface, but that is only suitable for some applications.

Some of the "GUI toolkits" provide a lot more than just GUI components. Some of them also take care of other common non-GUI tasks as well.

If you use any other third party components such as libraries or databases, you also need to select ones that are available on all platforms. There are no shortage of these, but you have to select accordingly.

When you write your program, there will often still be be some differences between platforms that the toolkits don't hide. Your programming language will need to have compiler directives that can compile alternative blocks of code, depending upon the selected platform (e.g. "ifdef" statements for 'C').

You will need to keep in mind these platform differences when writing your program, and try to keep these differences isolated to particular parts of the program, rather than scattering them all through it.

I won't claim to be an expert on portability, but many people feel that it is easier to write a program in Linux (or BSD) and then port it to MS-Windows and Mac OS-X than it is to go the other way. The reason for this is that Linux (and BSD) tend to stick very closely to recognised official standards and try to avoid introducing unique features where those features matter to an application program. These standard features are more likely to be supported on non-standard operating systems than visa versa.

One thing working in your favour in this is that there are these days really only two major operating system families for PCs. One is MS-Windows, which borrowed a lot of its fundamental ideas and features from VMS (which itself is now more or less dead). All the others (Linux, Mac, BSD, Solaris, etc.) are modelled on Unix.

On the other hand, supporting multiple platforms is a lot of work (especially when it comes to testing), so you should examine carefully just how portable you really want to be.
 
Top