LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   distro for C programming (https://www.linuxquestions.org/questions/linux-newbie-8/distro-for-c-programming-811932/)

bcbotha 06-03-2010 09:32 AM

distro for C programming
 
I understand that it's not the distro but the compiler and such that I need, but does anyone have an opinion as to which distro would be a good one for someone starting to learn C programming and wanting to learn and use bash more?

Thanks

jamescondron 06-03-2010 09:38 AM

As with all calls on distros, there really is no difference for this sort of thing; you're a million times better off just finding the one that looks and feels best for you.

The compiler/environment is just as easy to set up as it is to get a distro with it built in. Editors are standard across the board, and there is more or less no difference in how they use, what I'd consider anyway, the big two: emacs or vi.

Bash is always around too.

jens 06-03-2010 09:47 AM

Quote:

Originally Posted by bcbotha (Post 3991323)
I understand that it's not the distro but the compiler and such that I need, but does anyone have an opinion as to which distro would be a good one for someone starting to learn C programming

They all use gcc [1] (gnu compiler collection).
You might prefer a more stable one (as in less updates and version changes) like the three big ones (Debian, Slackware, Redhat/CentOS).

[0] http://gcc.gnu.org/

Quote:

Originally Posted by bcbotha (Post 3991323)
and wanting to learn and use bash more?

Don't use/install X.
My main setup is Screen[1](more functional terminal) + Emacs/tex(text)[2][3] + Gnus(email)[4] + w3m/Links(webbrowsing) [5][6] + Mplayer (full multimedia suite)[7].

[1] http://www.gnu.org/software/screen/
[2] http://www.gnu.org/software/emacs/
[3] http://www.tug.org/
[4] http://www.gnus.org/
[5] http://emacs-w3m.namazu.org/
[6] http://links.sourceforge.net/
[7] http://www.mplayerhq.hu/design7/news.html

Doing all your normal tasks without X will get you startd in no time.

CoderMan 06-03-2010 03:20 PM

Quote:

Originally Posted by bcbotha (Post 3991323)
I understand that it's not the distro but the compiler and such that I need, but does anyone have an opinion as to which distro would be a good one for someone starting to learn C programming and wanting to learn and use bash more?

Thanks

Really, you can use any distro you want. Just install a terminal program (like gnome-terminal), pick an editor (Vim/Emacs), and go at it.

I'd avoid distros that use old libraries like Debian or any distro that uses the Debian software repositories straight up. When programming, it is better to be using the latest and greatest development libraries, which tend to become standard by the time your program is released.

I think Ubuntu and Fedora keep up fairly well. Gentoo is the best path to Guru-hood, but I'm not sure if you are ready for that yet. ;)

pixellany 06-03-2010 03:32 PM

Bash is Bash
C is C
gcc is gcc

In other words, the choice of distro is irrelevant----unless maybe: If you are really short on memory or disk space.

Personally, I would never attempt to do serious programming without LOTS of RAM and HD space. Even the development of my pathetic website generated mountains of crud.

CoderMan 06-04-2010 01:32 AM

Quote:

Originally Posted by pixellany (Post 3991710)
Bash is Bash
C is C
gcc is gcc

In other words, the choice of distro is irrelevant----unless maybe: If you are really short on memory or disk space.

Not entirely true. First of all, there are different implementations of C, and different versions of gcc.

But seriously, the choice of distro is not entirely irrelevant. As I mentioned before, your choice of distro will affect your options for conveniently accessible libraries. An example from my own experience: most distributions still only make ClanLib 0.8 version libraries available, whereas the ClanLib itself is actually available as version 2.1 on the web. With distributions like Debian, the libraries (and the rest of the software) only get updated once every 2-3 years, which is an eternity in the FOSS development world. Distributions like Ubuntu get refurbished around every six months or so.

You can of course install your own libraries from source, though you are likely to run into more conflicts dealing with a distro with older libraries already installed.

At the end of the day, I'd say Gentoo is the best distribution for programming, for these reasons: 1) you get access to the latest and greatest libraries most of the time; 2) Gentoo is source-based, so the development libraries are automatically installed with all your software; 3) through Gentoo's Portage package management system, you can enable or disable the components of individual library builds, depending on your needs, whereas with binary-based distribution, you must rely on the intuition of the distro maintainers.

bcbotha 06-04-2010 02:28 AM

Thanks guys for your replies, it much appreciated.
I'm currently using Mandriva and am trying to setup a dual boot with Zenwalk. How do thier library updates fair? and would it be better to drop Zenwalk(or Mandriva) for Gentoo?

Thanks

jens 06-04-2010 09:04 AM

Quote:

Originally Posted by CoderMan (Post 3992097)
Not entirely true. First of all, there are different implementations of C, and different versions of gcc.

But seriously, the choice of distro is not entirely irrelevant. As I mentioned before, your choice of distro will affect your options for conveniently accessible libraries. An example from my own experience: most distributions still only make ClanLib 0.8 version libraries available, whereas the ClanLib itself is actually available as version 2.1 on the web. With distributions like Debian, the libraries (and the rest of the software) only get updated once every 2-3 years, which is an eternity in the FOSS development world. Distributions like Ubuntu get refurbished around every six months or so.

You can of course install your own libraries from source, though you are likely to run into more conflicts dealing with a distro with older libraries already installed.

At the end of the day, I'd say Gentoo is the best distribution for programming, for these reasons: 1) you get access to the latest and greatest libraries most of the time; 2) Gentoo is source-based, so the development libraries are automatically installed with all your software; 3) through Gentoo's Portage package management system, you can enable or disable the components of individual library builds, depending on your needs, whereas with binary-based distribution, you must rely on the intuition of the distro maintainers.

Your assumptions are all wrong.
Debian can be as up to date as you want. Gcc (and dep's) isn't distro specific.
Install whatever version you like if you're unhappy with the distro version.

Using a bleeding edge distro will only confuse most students with extra bugs and changing features. Pick any howto/book/... you like, they never cover multi versions.

alli_yas 06-04-2010 09:11 AM

Quote:

Using a bleeding edge distro will only confuse most students with extra bugs and changing features.
Have to agree with Jens here, in the RHEL/CentOS/Fedora world; I definitely wouldn't recommend a student focusing on development use Fedora - but rather something like CentOS which is much more stable.

Conversely, if your focus is learning Linux - then in my opinion its a good idea to go with a cutting edge/newer distro.

CoderMan 06-05-2010 12:16 AM

Quote:

Originally Posted by bcbotha (Post 3992132)
Thanks guys for your replies, it much appreciated.
I'm currently using Mandriva and am trying to setup a dual boot with Zenwalk. How do thier library updates fair? and would it be better to drop Zenwalk(or Mandriva) for Gentoo?

Thanks

Gentoo is many great things... but it /is not/ a beginner-friendly distribution. Only switch to Gentoo if you are either highly knowledgeable about Linux, or you are really determined to get there quickly.

I have depended on several distros in the past. Before coming to Gentoo, I was a hardcore Debian fanatic, because I felt Debian gave me good tools for making my systems the way I like them, and it helped me get closer to becoming a Linux guru. But ultimately Debian was too restrictive (and too out-of-date) and I found what I was looking for in Gentoo.

jens 06-06-2010 10:10 AM

Quote:

Originally Posted by CoderMan (Post 3993038)
Gentoo is many great things... but it /is not/ a beginner-friendly distribution. Only switch to Gentoo if you are either highly knowledgeable about Linux, or you are really determined to get there quickly.

I'm glad you found your perfect OS, but how does this make Gentoo a better C platform?

Very new libs might be useful for python and other unhealthy rubbish, but not for a more pure C languages.

EDIT: ...and if you compare debian with gentoo, gentoo is a lot more outdated (compare it with sid if you like buggy/upstream software).

CoderMan 06-07-2010 12:12 AM

Quote:

Originally Posted by jens (Post 3994295)
I'm glad you found your perfect OS, but how does this make Gentoo a better C platform?

Very new libs might be useful for python and other unhealthy rubbish, but not for a more pure C languages.

EDIT: ...and if you compare debian with gentoo, gentoo is a lot more outdated (compare it with sid if you like buggy/upstream software).

More outdated than Debian? Who are you kidding? For starters, you can't "compare it with sid" because, like Debian, Gentoo also has an "unstable tree" where software is kept before it sees some real world action. (Technically, the Gentoo system uses "masking" rather than a separate tree.)

Unlike Debian, Gentoo has a software management infrastructure that actually allows it to stay in tune with what is actually going on the FOSS development world. In contrast, even Debian unstable can't keep up with the real world. Debian sid was developed for what, two years, before it was finally frozen last December? And we are still waiting for it to be official released.

Keeping up-to-date is about more than just having the latest-and-greatest libraries at hand and easy to install (which is quite nice). It is also about having to most recent stable releases of established libraries. You go to the help forums of library libxyz, and tell them that you are using the version released two years ago, they'll curse your ancestors and then throw you out of your thread. With Gentoo, the recent version will either be available already, or it can become available to the Gentoo community fairly quickly by submitting a bump request or starting an overlay.

Now, having a distro that stays up-to-date, and evolves on the fly, certainly presents a few extra challenges to Gentoo maintainers to keep everything in order. (Though Debian development hasn't exactly been a walk in the park either, from what I hear.) But the question isn't which distro is better for system administration; rather, which distro is better for development. If the OP wants my opinion, I'd say: For development, don't use Debian or another other distro with a real slow release cycle. Gentoo is great, but if you aren't ready to tackle Gentoo system administration, probably try something like Fedora, Ubuntu, or another distro that keeps development on a reasonably short and reliable schedule.

jiml8 06-07-2010 12:38 AM

Quote:

Originally Posted by bcbotha (Post 3992132)
Thanks guys for your replies, it much appreciated.
I'm currently using Mandriva and am trying to setup a dual boot with Zenwalk. How do thier library updates fair? and would it be better to drop Zenwalk(or Mandriva) for Gentoo?

Thanks

I develop in Mandriva. I like it; it suits me.

I develop for targets that run Fedora, Gentoo, SUSE, and Centos mostly, as well as stripped systems that are intended to run as embedded systems. I also develop in Mandriva using GCC for Microsoft Windows targets (though I often use Visual Studio when I'm doing Windows).

The issues I encounter (particularly with Centos) is that I'm developing using a later version of some libraries than are available in Centos. Other than that, no problems.

evo2 06-07-2010 12:55 AM

Quote:

Originally Posted by CoderMan (Post 3991696)
I'd avoid distros that use old libraries like Debian or any distro that uses the Debian software repositories straight up.

Hmm, I'd have thought that there aren't too many distros that have more recent libraries a than Debian sid.

Evo2.

jens 06-07-2010 06:24 AM

Quote:

Originally Posted by evo2 (Post 3994987)
Hmm, I'd have thought that there aren't too many distros that have more recent libraries a than Debian sid.

Evo2.

Indeed.

jens@debian:~$ apt-cache show gcc
Package: gcc
Priority: optional
Section: devel
Installed-Size: 64
Maintainer: Debian GCC Maintainers <debian-gcc@lists.debian.org>
Architecture: i386
Source: gcc-defaults (1.95)
Version: 4:4.4.4-2
Provides: c-compiler
Depends: cpp (>= 4:4.4.4-2), gcc-4.4 (>= 4.4.4-2)
Recommends: libc6-dev | libc-dev
Suggests: gcc-multilib, make, manpages-dev, autoconf, automake1.9, libtool, flex, bison, gdb, gcc-doc
Conflicts: gcc-doc (<< 1:2.95.3)
Filename: pool/main/g/gcc-defaults/gcc_4.4.4-2_i386.deb
Size: 4964
MD5sum: 78b47f5049aa070e44334f1b670a12de
SHA1: 1bdbabb5b27f12f034d548f4cba447f94de837ed
SHA256: a92e7dce0eb45170a071e377f692be41988821e4a0b1bd15536125f9872ee129
Description-nl: De GNU C compiler
Dit is de GNU C compiler, een vrij goed overdraagbare,
optimalizerende compiler voor C.
.
Dit pakket bestaat alleen om de standaard GNU C compiler aan te wijzen.
Build-Essential: yes
Tag: devel::compiler, devel::lang:c, implemented-in::c, interface::commandline, role::metapackage, role::program, special::meta, suite::gnu, works-with::software:source

jens@debian:~$

Gentoo:
http://packages.gentoo.org/package/sys-devel/gcc

His other claims are wrong as well:

Quote:

Originally Posted by CoderMan (Post 3994967)
More outdated than Debian? Who are you kidding? For starters, you can't "compare it with sid" because, like Debian, Gentoo also has an "unstable tree" where software is kept before it sees some real world action. (Technically, the Gentoo system uses "masking" rather than a separate tree.)

Just google this.
Sid really IS more up to date (and that's not just an opinion).
Sid is also a full distribution (you don't need any other packages).
Those debian packages that are being "kept before it sees some real world action" are in the experimental repo.

Quote:

Originally Posted by CoderMan (Post 3994967)
Unlike Debian, Gentoo has a software management infrastructure that actually allows it to stay in tune with what is actually going on the FOSS development world. In contrast, even Debian unstable can't keep up with the real world. Debian sid was developed for what, two years, before it was finally frozen last December? And we are still waiting for it to be official released.

Who's kidding who?
Debian did not freeze last December.
Sid wil never be released, it's indeed a rolling distribution.

...

We're getting offtopic though ;)

I wouldn't recommend Debian Sid either.

If you're teaching someone to swim, you shouldn't drop him in the deep ocean either.


All times are GMT -5. The time now is 04:53 PM.