Best way to program on Linux?

This is a discussion on Best way to program on Linux? within the Tech Board forums, part of the Community Boards category; What is the best way for someone who is new to both Linux and C programming to program on Linux? ...

What is the best way for someone who is new to both Linux and C programming to program on Linux? A particular IDE or command line?

I use gcc http://en.wikipedia.org/wiki/GNU_Compiler_Collection for my compiler, its free and very easy to use, it is run through a terminal. I think all Linux distro come with this (I may be wrong here, probally am) I think you can type gcc in a terminal to see if you do, if you get an error you dont have it, but it is very easy to get.

For learning to program theres some tutorials on this site but I find for myself a book is much more helpful than online tutorials.

You probably won't be doing anything for a long time that will warrant a big IDE with lots of advanced features. Just use one of the gazillion text editors available and stick to the terminal for all the compiling.

Gcc's C99 support isn't complete yet (which is why the default mode is C90), so most people don't use -std=c99. In addition, there are a few things which are required in C90 but not in C99 (such as an explicit return statement in main()), so using C99 mode makes it less likely that code is C90 compatible. Most people try to write code that is compatible with both C90 (since it's currently the most commonly used standard) and C99 simultaneously. Someday, when compilers catch up to C99, then C90 compatibility can be thrown out the window.

An explicit return from main() is not required in C89/C90 either, robatino. A fair few compilers, however, issue warnings if it is left out.

Your statement "when compilers catch up to C99, then C90 compatibility can be thrown out the window" is incorrect unless only the latest compiler is used. In practice, anyone working on a non-trivial project must support a range of old and new compilers. Compilers catching up to a standard is therefore necessary but not sufficient to justify eliminating compatibility with an older standard.

As sure as I can be going from memory. My copy of the C89/90 standard is in a box at work, so I don't have access to it at the moment.

My copy of the C++ standard, which I happen to have handy, states that reaching the enclosing } of main() has the same effect as "return 0;". Annex C of the C++ standard, which lists incompatibilities between C89/90 and C++, makes no mention of anything like this. Not conclusive, I know, but production of the list of incompatibilities for information purposes was a formal requirement during the C++ standardisation process -- and I'm more inclined to believe in the content of an ISO standard over behaviour of any compiler.

zacs7: Maybe so, but if the FAQ is inaccurate it should be fixed pronto.
grumpy: Another possibility is that in C89 the explicit return may not be required, but without it the return value may be undefined (in this case the FAQ is still inaccurate). Some googling seems to hint at this.

I use Linux all the time (Debian GNU/Linux 3.1 AMD64 version with 2.6.16 kernel) and I mainly use gcc and makefiles. The text editors I use are mostly fte, vim, and Kate. Most of the time I use Kate, which is halfway between a text-editor and an IDE (BTW, I use GNOME . . .).

I'm new at Linux, too. And after using Windows for a long time, it comes a bit strange to do things in terminal. It's like using DOS command prompt in XP, which i don't like very much and find obsolete. I used to do all my work with Dev-C++ and it really made things easy for me. While trying to figure out these things, why some people especially like using command line compilers or text editors? Isn't it time consuming and unuseful? Can somebody explain me this?

To me, a command line is easy to interface with and faster for most things than messing with an IDE to compile a quick test program. I write a lot of console programs anyway. Even when I write GUI programs, I like to write debug information to a console.