0

I would like to start programming using the Linux operating system and all the free stuff out there.

  • What is the most common and the best language to use with Linux, C or C++ or C#?

  • What tools are similar to Turbo C, or Visual Studio in Windows?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
user287745
  • 3,071
  • 10
  • 56
  • 99
  • 1
    The answer might be the same for C and C++, but many people will give you a different answer for C#. You can start with [C++ IDE for Linux? ](http://stackoverflow.com/questions/24109/c-ide-for-linux) and [IDE's for C# development on Linux? ](http://stackoverflow.com/questions/151350/ides-for-c-development-on-linux). – Matthew Flaschen Dec 14 '10 at 08:09
  • 1
    Recently asked: http://stackoverflow.com/questions/222471/setting-up-a-programming-environment-in-linux – jkerian Dec 14 '10 at 08:15
  • 2
    Turbo C is an old and outdated compiler. Stop using that. For Windows, you can use MinGW or MSVS. – Saurabh Manchanda Dec 14 '10 at 08:19

9 Answers9

5

vim + gcc/g++ +make. Language choice is task dependent/personal, but I'm not sure C# can be considered for Linux (Mono fans are welcome to downvote :) ).

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
khachik
  • 28,112
  • 9
  • 59
  • 94
  • It always amazes me that Linux programmers eschew proper graphical development environments. Yes, you can build a boat with just hand tools, but you'll get there faster with a power drill. Seriously, get yourself an IDE and quit with the hair shirt. – JeremyP Dec 14 '10 at 08:46
  • By the way, you should at least have a debugger in your tool chain. – JeremyP Dec 14 '10 at 08:47
  • 1
    @JeremyP Sure you should have a debugger. I should write g.., I think :) `gcc, g++, gdb`. I'm not a Linux programmer. Mostly I develop cross-platform programs on Java, Python, Common Lisp. Without IDE. – khachik Dec 14 '10 at 08:51
  • 4
    What does a graphical programming environment buy you other than having to write crap like `system("pause");` at the end of `main` to see your output? :-) – R.. GitHub STOP HELPING ICE Dec 14 '10 at 08:54
  • 3
    @JeremyP: I strongly disagree. While an IDE can fasten development in some cases, I usually work **way** faster with properly configured consoles and Vim. And I wouldn't recommend `make` : I believe `SConstruct` is much more efficient and modern. – ereOn Dec 14 '10 at 09:14
  • @ereOn: I strongly disagree. Most developers work faster with an IDE with refactoring tools, integrated debugging, context sensitive auto-complete, integrated unit testing etc etc etc. – JeremyP Dec 14 '10 at 09:22
  • @R..: No IDE I know of makes you have to write `system("pause")` at the end of main. They all have console windows that don't go away for seeing the output (and entering input). – JeremyP Dec 14 '10 at 09:24
  • 2
    Well why do newbies on SO always have `system("pause");` or `getch()` (with otherwise-useless `#include `) all over their code? – R.. GitHub STOP HELPING ICE Dec 14 '10 at 10:11
  • 1
    @JeremyP: I guess you haven't used Linux consoles and tools enough. They are nothing alike Windows default one and can provide at least the same level of features. Actually, auto-complete and stuff in Vim has existed way before IDEs even became popular. As a programmer, I don't need fancy, I just need efficiency. – ereOn Dec 15 '10 at 13:59
  • @ereOn: On the contrary: I have used the Unix dev environment for most of my programming life. vim is now quite powerful, but the basic environment of editor/compiler/debugger/make has nothing on a decent IDE. – JeremyP Dec 15 '10 at 14:40
  • @R..: I don't propose to modify my workflow or tools based on the fact that newbies sometimes do incomprehensible things. Actually, maybe its not incomprehensible if you are using an old version of Visual Studio in Windows, but since this question is about Linux dev tools we can safely ignore the non-existent-on-Linux conio.h – JeremyP Dec 15 '10 at 14:58
2

For the language it really depends what you want to do :

  • C is good for low level software, specially if performance is a priority, otherwise syntax can be painful for a first programming experience.
  • C++ is good for high level software and has a lot of good qualities that C misses (e.g. classes, operator/function overload), but may require some good knowledge of C in case of serious trouble.
  • if it is really your first programming experience, maybe learning with an interpreted language like Python/Perl could be a good idea to begin with.

For the text editor you have:

  • the good old classics: emacs/VIM, I don't want to argue about the choice
  • graphical editors: gedit, gvim, kate. Personally, I really like kate.
  • IDE: kdevelop, anjuta, eclipse, netbeans. Personally I use netbeans for C/C++ development. Again, if it is a first experience, maybe beginning with an IDE is not a great idea to make things clear.

For the compiler, unless you have special needs, you don't need something else than GCC.

Zythos
  • 180
  • 2
  • 8
Antonin Portelli
  • 688
  • 5
  • 12
1

I'd say C and python are the best integrated languages with linux.

You'll need:

  1. A text editor (I won't suggest one as I don't want to cause a (/another) religious debate).
  2. gcc to compile C or cpython to run python programs.
  3. Some knowledge of a shell (like bash).
  4. For more complicated C programs, knowledge of a build system like make/scons/cmake/etc
  5. For debugging there is gdb for C and pdb for python.
  6. For version control there's git/mercurial/svn/etc.
dan_waterworth
  • 6,261
  • 1
  • 30
  • 41
1

It depends on what sort of applications you intend to produce.

  1. C/C++ is suitable with embedded/OS applications (Vim + GCC).
  2. Java is suitable with business applications (Eclipse + J2SE)

PS: Visual Studio isn't supposed to be run on Linux.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Ricky
  • 34,377
  • 39
  • 91
  • 131
1

You may also consider portability, that is you can deploy and run your application to different OS, like Mac-OS. And one candidate that offers that is C# Mono.

LEMUEL ADANE
  • 8,336
  • 16
  • 58
  • 72
0

C is one of the most common languages for Linux programming, so you should know it. I would advise against using C++, maybe once you've done a project in C.

I use vim + gcc + gdb

Others use IDE's like Code::Blocks, KDevelop, or Eclipse.

My first advice would be: make Makefiles for anything you do.

buddhabrot
  • 1,558
  • 9
  • 14
  • 1
    I will avoid the urge to downvote... there is no reason to start with C before C++, while C++ compilers will digest most C code, the fact is that the approach to problem solving in the different languages are quite different. If you plan on developing with c++, you should start with c++ (I recommend *Accelerated C++*, no C required) – David Rodríguez - dribeas Dec 14 '10 at 09:08
0

This is a very wide question and depends on many elements, such as: what is your programming experience, and more important - what do you want to develop.

The common languages are obviously C\C++, using mainly the GNU compiler. There are many IDEs available, like Eclipse CDT (maybe the most used one), CodeBlocks, and more. If you are coming from the Windows world, I guess you won't want to use text editors for coding, although there are many many Linux developers that use them (VI\ Emacs...) For GUI development, you can use Qt - this is a wonderful, easy to start with infrastructure (which supports also threading, networking, and much more). Qt is C++ as well.

C# is still not widely used in Linux, as Mono is not ripe enough. This language is the favorite for .Net developers, but it doesn't give you very much Linux experience.

And of course, after all you have Java - where the JVM does the compatibility work behind the scenes for you...

rkellerm
  • 5,362
  • 8
  • 58
  • 95
0

Python is the best choice to start programming, by far. Especially in a modern Xubuntu or similar environment, where packages exist to make GUI-based applications and much more.

There's an interactive editor where you can get the hang of things very quickly.

For a Python IDE, try PyDev or NetBeans or Geany. Me, I'm a recent NetBeans convert and I think it's an excellent IDE, even if I haven't tried it with Python (yet).

Why not try Python online and see if you like it? http://try-python.mired.org/

I like Python most for its lucidity and the ability to very quickly test out solutions.

Henrik Erlandsson
  • 3,797
  • 5
  • 43
  • 63
0

Well if you already have coded in C#.Net before then you may try C# Mono, incase you want to shorten your learning curve. But must linux users use Python, actually.

LEMUEL ADANE
  • 8,336
  • 16
  • 58
  • 72