个人工具

UbuntuHelp:PowerUsersProgramming

来自Ubuntu中文

Oneleaf讨论 | 贡献2007年5月24日 (四) 15:17的版本 (新页面: {{From|https://help.ubuntu.com/community/PowerUsersProgramming}} {{Languages|UbuntuHelp:PowerUsersProgramming}} == Ubuntu and Programming == Ubuntu is a great development platform. You c...)

(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳转至: 导航, 搜索

Ubuntu and Programming

Ubuntu is a great development platform. You can easily program in C/C++, java, fortran, python, perl, ruby, tcl, lisp ... and many more.

Scripting Languages

Scripting languages are usually easy to learn and use. They are called scripting languages because of they are interpreted instead of compiled to machine language like C/C++ for example.

Python

Out of the box Ubuntu comes with Python and many extension modules. Self:Python is very powerful and easy to use. In fact it is the prefered language by most of the Ubuntu developers. You can easily play with python interactivly. Start a terminal and type python[enter]. For a more elaborate tutorial and a billion of other useful information about Python, visit http://www.python.org

Perl

Another great programming language is Perl. Perl is very popular with web programmers and system administrators. One of Perl's main features is the way regular expression. Most languages now include regular expressions but Perl is the best language to use if you need to process a lot of text. Perl is already installed on you system. For more information visit http://www.perl.org Perl has a large amount of extension written for it; Visit cpan.perl.org to find them.

Ruby

Ruby rocks. It's much better (in my personal opinion) than both of the other ones mention. Ruby is just quite simply intutive to use. Check out http://www.ruby-lang.org for more. Ruby is installed by default on your system but there are much less modules that are installed by default compared to python. Most Ubuntu developers use python extensively so that has a lot to do with it.

You might what to install the irb package to use the ruby interactive interpreter.

Others

This is a collection of other extremely useful languages.

C and C++

C is not usually a great language to begin programming with but it is the most powefull programming language ever. There is nothing you can't do in C. If you need speed and efficiancy, C is the best choice. The Linux kernel, the heart of the Ubuntu operating system, is written in C. C++ is mostly an extention of C. The main advantage of C++ is that it is an Object Oriented language.( With some talent C can also be used for OOP). To use C and C++ you will need to do to install the build-essential package:

sudo apt-get install build-essential

You can now compile C and C++ programs with gcc and g++. Read there respective man pages for the most information.

Gambas

Gambas is very similar to Microsoft's Visual Basic system (but not compatible) and available in Ubuntu's repositories. If you are familiar with VB then you may want to try Gambas as a stepping stone to more powerful languages.

Java

Java was created by Sun Microsystems and is now used all over the place. The beauty of Java is it's power, combined with it's portability. Programs written in Java can usually be run across multiple operating systems on multiple machine architectures without a need to recompile like C/C++, as long as there is a Java Virtual Machine available on the desired OS and platform. Java is a popular language to learn due to it's object oriented nature, cross platform abilities and the fact that instructing a virtual machine can often be easier than instructing a real machine. One of the most comprehensive development environments for Java is Eclipse, which you can find in the Ubuntu repositories along with many plugins.

Java was created as a proprietary format, and although Sun Microsystems has started opening up their licenses it is still not fully Free Software. The GNU project recognised the popularity of Java and created a Free Software interpreter for Java programs called GCJ (which is in Ubuntu). Be aware when writing your Java programs that Sun's official Java implementation contains the most features and is the standard reference for other implementations but any programs you make for it cannot be truly Free Software, and thus cannot be included by default in Ubuntu for instance (although there are Java programs in the community maintained repositories). If you make your program compatible with GCJ you may lose some functionality but your program should be available across many platforms which would otherwise be inaccessible for legal and ethical reasons.

Mono

Mono is a Free Software implementation of Microsoft's .NET system. If you are familiar with languages such as C# then you will like Mono. Mono Devel is in Ubuntu and can quickly create extremely powerful programs which, if coded accordingly, can even be run on Microsoft Windows. Mono is relatively new to the programming world, but it's power has attracted many popular projects like the Beagle "desktop search" tool, the Banshee media player and the F-Spot picture/photo organiser.