Linux Guide/Programming tools

Because of its heritage as part of the FLOSS movement, the GNU/Linux operating system is well-suited to software development.

Compilers

edit

GNU Compiler Collection

edit

gcc, which stands for GNU C compiler, is a C compiler. It can be used for compiling C programs.

g++, which stands for GNU C++ compiler, is a C++ compiler. It can be used for compiling C++ programs.

gfortran

edit

gfortran is GNU's compiler for the Fortran 95 language.

gcj, which stands for GNU Java compiler, is a compiler that can compile Java. Though not complete, it can already compile simple Java programs.

OpenJDK

edit

Most modern distributions (2010) include OpenJDK in their repositories which mostly implements the standard Java Sun (now Oracle) JDK.

Mono

edit

Mono is a Linux implementation of the .NET Framework.

Scripting Languages

edit

Lisp code can be compiled or interpreted, with good compilers producing code that runs almost as fast as C. It is also used as a scripting language in GIMP and Maxima CAS

Python

edit

The success of Python in the Linux platform has been astonishing. Part of the merit comes from the fact that it was designed to be easily embedded in C/C++ programs, so today most major applications in Linux (and GNU apps by extension) have the possibility to be scripted through Python (Blender, Gimp, Inkscape, OpenOffice or Dia are good examples but many others exist). It has also succeeded as a great alternative to Java in the server space mainly because it is much easier to learn and use. (Python was initially designed as a language for introductory programming courses).

The Plone content management system is probably the biggest success of Python as a server platform offering a full-featured system for content creation through a user friendly web interface that has displaced commercial solutions in many companies.

Sagemath is another example of a successful Python application. It combines many existing open-source packages into a common Python-based interface offering a real alternative to mathematical software like Magma, Maple, Mathematica and Matlab.

WARNING: Still it must be advised that Python lacks good support for multi-threading (June 2010) so it will fail in some circumstances when high input-output concurrent load and/or low-latency responses are required.

GIMP also includes a python console.

R is not a general purpose language. R is designed for statistical computing and graphics. It's extremely powerful and today is considered by the experts to have overtaken most commercial solutions around (some of them priced more than 200.000 dollars per license!).

Editors

edit

Vim (short for vi- improved) is a text editor written by Bram Moolenaar based on source for a port of the Stevie editor to the Amiga and first released publicly in 1991. Vim is designed for use both from a terminal-based interface and as a standalone application in a graphical user interface. Vim is free and open source software and is released under a license that includes some charityware clauses, encouraging users who enjoy the software to consider donating to children in Uganda. The license is compatible with the GNU General Public License.

Version control

edit

Building tools

edit

IDEs

edit

Code::Blocks

edit

Code::Blocks is a free and open-source cross-platform IDE for developing code. It is written in and designed for use with C++. Although it is probably possible to configure it to other languages. Read more at the Wikipedia article.

Being a Java-based application, eclipse runs in any Linux with Java support. In particular, it runs flawlessly with OpenJDK. While it's developed in Java, Eclipse offers excellent support and integration with other platforms. In particular it excels in its support for PHP and C/C++. For example, the Eclipse CDP (C/C++ Development plugin) allows for code refactoring, syntax highlighting, autocompletion, integration with the GNU compiler+linker+debugger tool chain. It provides also with automatic "real time" indexing of code, allowing for example to query for a method or variable's references in other files in the workspace.


Emacs

edit

Emacs can be used as IDE for many languages :[1][2]

Geany is a text editor using the GTK2 toolkit with basic features of an integrated development environment. It was developed to provide a small and fast IDE, which has only a few dependencies from other packages. It supports many filetypes and has some nice features.[1]

IDLE is Python's "Integrated Development and Learning Environment." It includes a text editor with syntax highlighting and a REPL (read-evaluate-print-loop) console for running Python programs or arbitrary Python code. It comes bundled with Python on Windows, but can be installed through the repositories of most distributions.

A Delphi compatible cross-platform RAD IDE using Free Pascal Compiler (FPC). Contains the cross-platform GUI library LCL which is more or less compatible with Delphi's VCL. It connects to native GUI widgets, as opposed to being a customdrawn library.

Based on Java. Similar to Eclipse. For Linux development Eclipse is preferred since it offers better tools for C/C++/PHP and other languages as well as better integration with GNOME/KDE desktops. NetBeans was originally developed by Sun Microsystems. After its acquisition by Oracle, its future is uncertain, since Oracle offers a different set of tools to its customer base.

Qt Creator is a cross platform development environment based on the Qt C++ toolkit. Linux, Windows, Mac, Symbian, Meego OSes are currently (2010) supported. It was originally developed by Trolltech, that in 2008, was acquired by Nokia. Nokia released the Qt code under the GPL. Qt forms the base of KDE, that along with GNOME are the two most successful desktop environments on Linux. Qt, being cross platform, has also been widely used by software companies (apart from Nokia, that standardized on Qt, the Skype client is a famous example).

Visual Studio .NET

edit

Visual Studio cannot be natively run under Linux. However, you can still run the Visual Studio IDE under Linux by using the Wine layer. Visual Studio Express is not supported at this moment. See next section about Mono.

Mono is the "native" implementation of .Net by Novell. Mono Develop installs and runs perfectly on any major Linux distribution.

VIM + Screen

edit

Vim is a powerful text editor with good programming support. It's especially well suited for scripting languages like Perl, Python or SQL. With the help of the "cscope" plugin it also allows to index C/C++/Java code searching for declarations, definitions and references to variables and functions. While really powerful, for complex projects it has been superseded by Eclipse in most situations. Still with the help of "screen",a powerful terminal multiplexer, it provides an excellent support for development when we need to simultaneously check code, tune complex config txt/xml files, logging output and monitoring system or network. Vim is somewhat difficult to learn when compared to visual tools, since it require memorizing about 30 different commands (Training vim can extends for 10-20 hours). Still it's worth the effort since once learned, it's much easier to use than a conventional text editor and much faster at editing complex code. It's block mode allows (with a bit of imagination) to even create small text diagrams or use it simultaneously as a text editor or micro-database system.

The diff mode (vimdiff command) mode allows to edit and visually compare changes in two versions of the same file. It's an excellent tool when working with control version systems like subversion or playing with complex configuration files (all those files inside the /etc directory).

Libraries

edit

"A high number of comments might indicate that the code is well-documented and organized, and could be a sign of a helpful and disciplined development team." In Open Hub 19% of all source code lines are comments.[6]

Code Analysis

edit

Valgrind comprises a set tools that can automatically detect many memory management and threading bugs, and profile your programs in detail. Valgrind can also be used to build new tools. For example, cachegrind, one of the many tools included, allows to profile internal CPU cache L1/L2 usage.

SystemTap offers diagnosis for a running system. SystemTap eliminates the need for the developer to go through the tedious and disruptive instrument, recompile, install, and reboot sequence that may be otherwise required to collect data.

References

edit