710 Part VI . Programming in Linux feel (Web hosting domain)

710 Part VI . Programming in Linux feel more comfortable with and work more productively using the tools I have been using since 1993: vi or emacs for writing and editing code, gcc and make for compilation, and gdb and kgdb for debugging. In any event, the lines are not so sharply drawn. Emacs, for example, has the facility to invoke both compilation and debugging facilities, has an extremely rich code editing interface (syntax highlighting and automatic indentation, for example), and also supports other code development features such as source code control, symbol and class browsing, and built-in support for at least three different online help facilities. If you prefer vi, it also can be configured to support symbol and class browsing using the ctags program, has basic syntax highlighting (depending on the implementation), and can also work with the error messages produced by failed compilation. Perhaps the GUI versus CLI debate boils down to this distinction: CLI-oriented programming environments give developers direct access to the tools and utilities they need, don t consume system resources to draw an attractive GUI, and don t provide so-called point-and-click programming. GUI-oriented programming environments hide the tools and utilities underneath a consistent, unified interface; provide a convenient dashboard or instrument panel for access to the necessary programming tools; and let developers take advantage of some of the conveniences associated with graphical environments. Linux Programming Interfaces As defined at the beginning of this chapter, a programming interface refers to the rules or methods followed to accomplish a particular task. Programming interfaces are usually thought of as graphical or command-line. Graphical interfaces use the X Window System to receive and process user input and display information. Command-line interfaces, sometimes referred to as text-mode user interfaces (TUIs), are strictly text-based and do not require a windowing system to run but, thanks to the X Window System, you can also execute CLI-based programs in terminal emulators running on top of X. There is a third type of interface, however: an application programming interface or API. This section of the chapter looks at the ncurses library used to create text-mode user interfaces, examines some of the popular graphical interfaces in use today, and describes a small set of the most popular APIs used by Linux programmers. Creating Command-Line Interfaces There are three primary means of creating programs that interact with users at the command line. Two use libraries of screen manipulation routines, S-Lang and ncurses, to create TUIs, and the third just uses standard input and standard output, conventionally known as stdin and stdout, respectively. Using stdin and stdout is trivially simple. Input and output occur one line at a time; users type input using the keyboard or pipe input in from a file, and output is displayed to the screen or redirected to a file. Listing 27-2, readkey.c, shows such a program.
We recommend you use shared web hosting services, because many users agree that it is cheap, reliable and customer-satisfying webhost.

Leave a Reply