Slashdot Log In
What Programming Language For Linux Development?
Posted by
kdawson
on Saturday December 06, @06:46PM
from the let-slip-the-dogs dept.
from the let-slip-the-dogs dept.
k33l0r writes "Recently I've been thinking about developing (or learning to develop) for Linux. I'm an IT university student but my degree program focuses almost exclusively on Microsoft tools (Visual Studio, C#, ASP.NET, etc.) which is why I would like to expand my repertoire on my own. Personally I'm quite comfortable in a Linux environment, but have never programmed for it. Over the years I've developed a healthy fear of everything Java and I'm not too sure of what I think of Python's use of indentation to delimit blocks. The question that remains is: what language and tools should I be using?"
Related Stories
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
Full
Abbreviated
Hidden
Loading... please wait.

C or C++ (Score:5, Informative)
The *nix API is in C.
Alternatively, you could look at Perl, as well.
If you're really desperate, you could use Mono, but I wouldn't recommend it.
Reply to This
I like Python (Score:5, Interesting)
Reply to This
Language you need to be proficient in. (Score:5, Funny)
Hindi.
Reply to This
Re:Language you need to be proficient in. (Score:5, Funny)
Regards,
Anonymously Cowarding
Reply to This
Parent
How much do you want to learn? (Score:5, Informative)
C/C++, C#, Objective-C, Java, Python, Perl, [insert language of choice]
All can be used to do Linux development.
KDE, stick to C++ and Python.
Gnome, stick to C and C# and Python.
GNUStep, stick to Objective-C
Java and Perl and any other language you choose can be used as well, but the desktop environment support for them is little to non-existent, depending on the language.
Reply to This
Why not stick with C#? (Score:5, Interesting)
http://www.mono-project.com/ [mono-project.com]
Reply to This
Learn C and Python (Score:5, Insightful)
C will give you a good base for learning how the system calls and libraries work, but Python is a lot more fun and better for any program where being close to the metal is not important.
And seriously, if you use a decent text editor, in a few weeks you'll forget Python's indentation conventions ever bothered you.
Reply to This
Re:Learn C and Python (Score:5, Informative)
"We had on average 4 bugs a week due to the indentation bullshit, each of which took multiple hours to debug."
Any chance you could name the company you work for?
Because I want to avoid your products.
Reply to This
Parent
Re:Learn C and Python (Score:5, Funny)
Reply to This
Parent
What do you want to develop? (Score:5, Informative)
Do you want to develop KDE apps? How about GTK apps? Do you want to submit kernel patches, or create system utilities?
You may want to be more specific, however - C, C++, Perl and Python are pretty much the norm.
Reply to This
C/C++ (Score:5, Interesting)
Take a look at Qt and Gtk. They're the two big GUI toolkits. I personally like Qt more, it's better documented and much easier to get running in Windows (and macs). As for the python, there's nothing wrong with its indenting. The problems of the language are much deeper. No language is going to be perfect, it's a tool
As for IDE's, if you're coming from a MS background take a look at the latest netbeans. It's a little slow (fine on new hardware though) and a bit better than Eclipse for C/C++ support.
Reply to This
Re:C/C++ (Score:5, Interesting)
C/C++ are the languages you'd want to go for. They can do *everything*, have great support, are fast etc.
Let's be honest here. C and C++ are very fast indeed if you use them well (very little can touch them; most other languages are actually implemented in terms of them) but they're also very easy to use really badly. They're genuine professional power tools: they'll do what you ask them to really quickly, even if that is just to spin on the spot chopping peoples' legs off. Care required!
If you use a higher-level language (I prefer Tcl, but you might prefer Python, Perl, Ruby, Lua, Rexx, awk, bash, etc. - the list is huge) then you probably won't go as fast. But unless you're very good at C/C++ you'll go acceptably fast at a much earlier calendar date. It's just easier for most people to be productive in higher-level languages. Well, unless you're doing something where you have to be incredibly close to the metal like a device driver, but even then it's best to keep the amount of low-level code small and to try to get to use high-level things as soon as you can.
One technique that is used quite a bit, especially by really experienced developers, is to split the program up into components that are then glued together. You can then write the components in a low-level language if necessary, but use the far superior gluing capabilities of a high-level language effectively. I know many people are very productive doing this.
Reply to This
Parent
Java (Score:5, Insightful)
Using Java avoids most of the nastiness of Linux while preserving a solid code base. On top of that, it doesn't take much juggling to get your app to run on multiple platforms.
I think it's a solid way to go, however, if your interest is in learning to actually develop for Linux, I would recommend C++. It's a language you're already familiar with presumably.
Reply to This
Re:Java (Score:5, Insightful)
I second Java. It's very fast, very portable, well-supported, scales from embedded to enterprise, has great IDEs, is open source, and has a huge body of libraries, sample code, and support.
I'm not sure why you call your fear of Java "healthy". Fear of any particular technology is unhealthy-- it prevents you from making rational decisions about them.
Reply to This
Parent
Re:Java (Score:5, Insightful)
I was also curious about your "healthy fear of anything Java" .NET experience Java is a significantly more mature language than C#. You are more likely to get better performance and stability out of Java's virtual machines just because they've had more time to be beat up by a vast community of developers. M$ did a good job of getting C# out the door but like any child it has some growing up to do.
Really? You are way too young to be developing "healthy fears". Java, like *every other language, has its issues but there is nothing abnormally nasty about it to treat it like a plague. Specifically relating to your
As many of these posts have mentioned: Don't limit yourself. Try everything. Obviously for Linux purposes knowing C (and a healthy amount of Bash scripting and Perl) is useful purely because the OS is built on it BUT for developing applications on top of it many languages have benefits depending on what you are trying to implement and so eliminating anything from your list will hurt you in the long run.
"Free your mind and the rest will follow"
-En Vogue
Reply to This
Parent
C, Java and Python. (Score:5, Insightful)
This question is remarkably easy.
The UNIX API is written in C. If you don't know C, you won't be able to understand UNIX system calls.
Beyond that, learn Java and learn Python. You yourself say you have a "fear of Java." Sounds like a pretty good reason to learn it. Likewise, you say you're not sure about Python's use of indentation. Sounds like another good reason to learn it.
It is usually good practice to learn one new language a year. These recommendations should be seen as beginnings not endings.
My final bit of advice is to learn PROLOG, LISP, Haskell or Erlang. And by 'learn,' I mean 'become fluent in.' These languages are radically different from anything you've experienced before. Learning how to think differently about problems will make you a much better programmer, regardless of what language you ultimately wind up using in the private sector.
Reply to This
Re:C, Java and Python. (Score:5, Insightful)
My final bit of advice is to learn PROLOG, LISP, Haskell or Erlang
If the original poster ignores every other post, and every other sentence from your post, and just reads this, then they will have the correct answer.
Learning `Linux' means learning POSIX / SUS. Then it means learning whatever library you use on top of these. It's not an interesting problem. Learning Prolog, Lisp, Haskell, Erlang, FORTH, and Smalltalk will teach you how to think about writing code, even if you never use any of these languages to write a real application.
Reply to This
Parent
C first, then whatever you want (Score:5, Insightful)
C first. It is the lingua franca of the Unix world. Even if you don't use it for yourself, you have to understand it because so much is written in it. And if you don't understand it, no one will take you seriously. One of my first Linux installs was so I could teach myself C cheaply and I needed a free, as in beer, compiler.
Then after that, any language that you think might be interesting. Try multiple languages. I personally like Ada and there's a free GNAT Ada compiler for Linux.
Reply to This
Fear of Whitespace (Score:5, Insightful)
I just started learning Python a couple of months ago (I come from a Perl/PHP web development background).
Really, get over the whitespace-indentation thing. It's such a small thing to get hung up on compared to how much more powerful, elegant, and flexible the syntax is (for starters). That, and it encourages you to indent source code properly anyway.
Reply to This
IndentationError (Score:5, Insightful)
If something like indentation is a show-stopper for your choice of language, then you are missing the point.
Computer languages are about data structures and idioms for manipulating them efficiently. In contrast, whitespace is a cosmetic, superficial thing.
Yes, I adore Python. (I wish I had paid attention to it ten years sooner than I did.)
Reply to This
LOLCODE (Score:5, Funny)
Develop in LOLCODE:
http://lolcode.com
"HAI WORLD" Example:
HAI
CAN HAS STDIO?
VISIBLE "HAI WORLD!"
KTHXBYE
I'm doing contract work right now, and won't my client be pleasantly surprised to see the project completed in LOLCODE... ROFLMAO!!! I can haz milestone payment?!?
Reply to This
Re:A valuable skill (Score:5, Insightful)
Reply to This
Parent
This is all true however... (Score:5, Informative)
... it is also pertinent to note here that the GNU standards document, section 3.1 [gnu.org]: "Which Languages to Use" strongly advises plain old C for both performance and absolute maximum cross-platform compatibility.
Since operating system and hardware platform independence are both key factors of code re-usability and really what open source software is all about I personally think this is a strong call.
However the parent post is correct in that application intent trumps all. If you are just writing shell tools you never intend to use outside of Linux then PERL is likely fast enough and probably much easier/faster (bottom line: cheaper) for the average developer to work with.
If you're writing web software use PHP, but it will make you feel dirty inside.
Reply to This
Parent
Re:What do you want to program? (Score:5, Interesting)
* for example using kdialog
Reply to This
Parent
Re:Indenting code (Score:5, Insightful)
this line must be indented but slashdot does not allow me to
A very good reason to use a language that delimits its blocks explicitly. C will work great even in forums that lose their linebreaks. (Perl too? I don't use it enough to know.)
Reply to This
Parent