What programming language, languages to learn for linux.
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
What programming language, languages to learn for linux.
Hi all
I want to learn programming in linux so am just trying to get an idea on what languages I should learn.
I have been looking around and are absolutely confused if i should learn C or C+ or both.
Python
Perl
Ruby
Tcl
KDE
Gnome
GTK
Java
Scripting
Shell
I dont know where these guys get the time to learn all these languages to a reasonable degree.
To get the most out of the linux world and eventually contribute back what would be the main languages I should learn, especially since I already get hassled for spending toooo much time on the computer.
I am no programming guru but let me see if this helps any.
Linux is based on the Posix standard, therefore it's an offshoot of Unix. Why that should mean anything to you is because Unix was created with the 'C' programming language and uses Pearl for it's primary scripting language. I think if you read "Sam's teach yourself Unix in 24 hours" you'll get a better understanding of what I mean.
Linux (as far as I know) is written in C++, but has many programs that are from Unix originally. So keep a reference on "C" handy and learning C++ would be a good thing.
Also KDE and Gnome are desktops not programming languages.
GTK is a programming standard, more or less, and information on it can be found at http://en.wikipedia.org/wiki/GTK+
Python, Perl, Tcl,and Ruby are scripting languages.
The Shell is your command line, yes there are different types of shells, but in general the shell is the Command line interface.
Java is a good language to learn, just because of its ability to run on many operating systems without recompiling.
In the interest of keeping this a reasonably short reply, search the web for tutorials on one language and try it. Some poeple loathe C++ but love Java, and vice versa.
People please do not start with the "My favorite language is X". You will know the language you like when you find it. Until then, I suggest to tutorial briefly on many languages.
If you want to be able to troubleshoot, bugfix, and add on to a typical linux setup, you probably want to know these things (eventually):
The kernel is written in C, and tons of apps and common libraries are C or C++. Since C++ is a superset of C, you will effectively learn C before you learn C++ no matter what. Thus, you probably want to know C. Not knowing C++ will only really hurt if you want to do KDE or QT things.
You will want to know at least one scripting language like Perl, Python, or Ruby for small-medium projects. There is probably more existing code in Perl than anything else, but the language may be starting to age poorly.
You will definitely want to know a passable amount of bourne shell (sh, bash), but you don't need to be an expert at it. This is useful for writing small gadgets for yourself and for dealing with your system's existing scripts.
For GUI toolkits, your main choices are Gnome/GTK and KDE/Qt. The main difference is that Gnome and GTK are C, KDE and Qt are C++. They are both respectable. Both GTK and Qt have bindings to other languages like perl, python, and ruby. GTK has a C++ wrapper, but you can't use Qt from C.
Java is a decent language and can save you some time over C/C++ for building medium-large projects. The downside is that there's not a ton of existing Java code on linux so you have to do extra work when you want to interface with anything else.
Tools you'll want to know about:
gcc, gdb for C/C++
make
grep
A text editor: start with an easy GUI one like kate, but learn emacs or vim eventually.
apache web server
Your distro's package system (probably rpm or deb)
autoconf and automake for C/C++ projects
Obviously, you get to choose where to start You can do interesting things with pretty much any language; I've tried to list things that are particularly useful for dealing with existing apps and libraries.
No, that's not the case. In fact C++ is even banned from Linux.
Okay, I wasn't aware of that I followed the link and read. Now I know and understand I guess my corrected answer is forget about C++ unless you really want to learn it.
From the languages you've listed, I'm presuming you want to approach things mainly from a pragmatic perspective. But I'd also like to suggest learning a couple languages that will help you understand the ideas of programming a little better: Scheme and Haskell.
Many functional languages can be thought of as a member of either the Lisp family or the ML (metalanguage) family. The former features identical syntax for data and code, the latter has very strong typing systems. Learning a Lisp-like language will teach you about how you can transform and treat data as code, and vice-versa, while learning a ML-like language will help you think about data very precisely and formally.
Not many of the functional languages are considered very pragmatic from the perspective of being able to interact with basically any existing software (like Perl can; Objective Caml probably comes closest here), but their capabilities can be used to come up with great ways to solve interesting and complex problems. Sometimes, once you come to terms with how they do certain things, you can emulate these features in other languages, for example Perl (see Mark Jason Dominus' excellent Higher-Order Perl book).
The other great thing about functional languages is that they often force you to think recursively, which makes some problems extraordinarily easier to solve, plus it gives you a much easier way to prove your programs (thanks to the fact that they naturally eschew side effects).
...just an addition about Lisp, my favourite word to describe it is "impulsive." Instead of pre-thinking what you need to define/return/allocate/etc., you can just quickly write and inline code snippet to achieve the desired result (for the most part).
From my point of view, this direction is not so proper.
Which language you should learn depends what you are interested in.
If you are interested in system side, i.e. kernel programming or device driver or similar you must learn C with knowledge of how operating system works, since linux in implemented in C.
If your interest is in developing applications you must consider C++ or Java. Java is a platform independent language which is an advantage of it.
If you are interested in GUI programming such as for KDE or GNOME. you should consider programing with QT and GTK.
GTK is an object oriented application programmers interface (API). It is written in C, but implemented using Object oriented ideas.
QT is a cross-platform development framework which uses c++.
Both QT and GTK are having bindings for other languages such as python, ruby, java and perl, i.e. you can use any language apart from c and c++.
Python and Ruby are interpreted languages and are excellent and powerful with all object oriented concepts.
Further if you what to do some web programming you may want php to be there.
Shell script is not a programming language, though you can do a lot with it. Basic shell script knowledge is helpful when you are with linux.
So my suggestion will be first you decide your domain and then learn language accordingly.
Thanks for all the helpful replies. I certainly didn't want to start a debate which was the best language that so and so uses so thanks for keeping it pretty nuetral. I will start on c and maybe a scripting language first.
Do most people use Anjuta for developing in or is that just a personal choice again?
Do most people use Anjuta for developing in or is that just a personal choice again?
I use Emacs for everything. One thing that's nice about IDEs (like Anjuta) is that they tie a lot of language-specific functionality together, but the great thing about using an editor (like Emacs) is that you've always got the same behaviour and functionality directly at hand, no matter what language you're using. Advanced editors like Emacs and Vim can interact with compilers, interpreters, and debuggers like language-specific IDEs can, but most of the time their code-completion features are lacking by comparison. Another great thing about Emacs is that it is easily extended to take on almost any functionality, which is one reason why I use it to edit code in less-popular languages like Erlang and SML, for which no (AFAIK) IDE exists. Eclipse and Vim can be extended, too. In all, I think if you're really working hard in a particular language, you can gain a lot from sticking to a particular IDE. But if you switch between languages often, or are into writing a lot of your own customizations, keeping with a single standard editor may be a better plan.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.