Linux Programming/Cross Platform

From E&E Students
Jump to: navigation, search

Introduction

The focus of this wiki page is cross-platform [1] program development, using Linux and Open Source [2] software mostly, in a top down approach. The intention is to introduce object oriented programming (OOP) [3] using rapid application deployment (RAD) [4] graphical user interfaced (GUI) [5] integrated development environments (IDE's) [6]. The target audience is those new to programming or those who wish to become cross-platform developers. It is not intended for the programming gurus, although their input in assisting with documentation for beginners and intermediate programmers would be greatly appreciated.

Those new to Linux can read this introduction and then click here to apply for a Linux account in the E&E labs.

Cross Platform

A major stumbling block in the adoption of Open Source software is the lack of application software that runs on Linux. Most software available runs on the Win32 platform. This web page attempts to introduce you to software development environments that enable software to be run on almost any operating system platform. The ideal is to code once and compile for various platforms. This strategy of software development is commonly called cross-platform development. A book has been written, check it out at http://cross-platform.net.

What are the requirements for a cross-platform development environment ?

  • The cross-platform environment should enable rapid application deployment (RAD) with a fairly easy to use and intuitive graphical user interface (GUI).
  • The integrated development environment (IDE) software should be available to run on Win32, Mac OS X and Linux/Posix [7] platforms.
  • Of course the means to run the compiled [8] programs must be available for all platforms.
  • Fairly extensive documentation, with examples, should be available.
  • A good debugger [9] (preferably a visual one).
  • An extensive application development platform, in the form of a library or framework, providing infrastructure such as file and directory manipulation, socket streams, persistence, threads and configuration. This is also typically where all the platform-specifics are abstracted away.

Available Cross-Platform Development Environments

  • Mono/.NET (Runs most Microsoft .NET apps)
  • Eclipse (Up and coming universal IDE released as open source by IBM)
  • Kylix/Delphi
  • Python (Interperter that runs on Win32 and Posix)
  • Java (Runs apps thru JVM, but is slow and propietary)
  • LAMP (This web site is LAMP, enough said)
  • FreeGee (Most promising so far)
  • BuilderX

Windows Widget Toolkits

Most GUI windowing environment [10] programs for Linux are written using Widget [11] Toolkits [12]. Deciding which Widget Toolkit to use in the development of your cross-platform program is another important factor. The most popular windowing systems at the moment are:

  • Microsoft [13]
  • KDE [14] which uses the QT [15] Toolkit.
  • GNOME [16] which uses the GTK [17] (Gimp Tool Kit) and wxWidgets [18] Toolkit.

The most popular IDE's to use for each Widget Toolkit are:

Therefore your cross-platform IDE should be able to use both the QT, GTK and wxWindows widget toolkits or be able to convert. There was an issue about the license for the QT library, but it seems that QT [25] is now licensed under the GPL [26]. However it would be prudent to use the GTK widgets for programming, since GTK is fully GPL'ed.

A process has started to formalise desktop standards, see: http://www.freedesktop.org/wiki/Standards

In addition it is important to make the human interface to your windows (GUI) program efficient. Read more about the subject of the user interface in software design here [27].

Programming Languages and Tools

The most commonly used programming language [28] and shell [29] are:

Some others are:

Some efforts to standardise programming on Linux have been made with the Linux Standards Base [33].

Version Control and Software Bug Tracking

In order to keep track of what versions of software are created, a versioning system is needed. CVS is most popular, but conversions to Subversion are common.

Normally the initial release of software is called "alpha" then "beta'. In addition software releases are tagged as "stable" or "unstable/development" releases. The stable releases are normally given even number suffixes and unstable odd number suffixes.

For example:

  • Version 1.0 = stable
  • Version 1.1 = unstable
  • Version 2.0 = stable (newbranch indicating major changes)
  • Version 2.1 = unstable
  • Version 2.2 = stable

Once the program is written and packaged, user feedback in the form of bug reports is usually normal. This form of feedback is one of the strong points of community development of software. The maxim is: Release early, keep it small and update often. A good source for a bug tracking system is Bugzilla [34].

Software/Package Management

Once the program has been written and stored with a version control system, the next step is to package it so that it can be easily installed. The ideal is to have a similar install process as Microsoft Windows where the user simply clicks on "install.exe" or "setup.exe" and the program/software installs.

Honorary

Some pioneers in the Open Source community to whom we pay tribute. (In no particular order).

  • Richard M Stallman [35]
  • Eric S Raymond [36]
  • Eben Moglen [37]
  • Linus Torvalds [38]
  • Bruce Perens [39]
  • Nat Friedman [40]
  • Matthias Ettrich [41]
  • Miguel de Icaza [42]

Watch the video about the Open Source revolution [43]