LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-01-2007, 02:32 PM   #1
JMJ_coder
Member
 
Registered: Apr 2006
Distribution: Fedora
Posts: 478

Rep: Reputation: 30
Which Language?


Hello,

Which language is used most today for programming - C or C++? Can one be a good programmer learning C++ and not C (I know that C is closely related to C++, but there are some differences)?

For helping out on programming for Linux and Unix OS's and comprehensive and large programming projects (i.e. typesetting engines and front-ends, text editors, etc.), which one is better C or C++?
 
Old 09-01-2007, 02:55 PM   #2
manwichmakesameal
Member
 
Registered: Aug 2006
Distribution: Slackware
Posts: 804

Rep: Reputation: 110Reputation: 110
I think it would depend on what you plan on doing. If you are going to do a lot of kernel development, go with C. If you are going to do a lot of gui stuff, from what I've noticed (I use KDE, so a lot of qt) it's mostly C++. Personally, I would say learn as many as possible, don't limit yourself to just one language.
 
Old 09-01-2007, 03:17 PM   #3
PatrickNew
Senior Member
 
Registered: Jan 2006
Location: Charleston, SC, USA
Distribution: Debian, Gentoo, Ubuntu, RHEL
Posts: 1,148
Blog Entries: 1

Rep: Reputation: 48
I write most of my gui work in gtk, so I'd say mostly C for guis. But what it ultimately breaks down to is this: if you want to work on mostly free software, learn C first. If you want to make a career out of it, learn c++ first. The only big c++ free software projects you really see are Qt and Mozilla, both of which began life as closed commercial products. But eventually, it will benefit you to learn both, and others.
 
Old 09-02-2007, 03:44 PM   #4
sci3ntist
Member
 
Registered: Dec 2006
Distribution: Debian,Slackware,FreeBSD,CentOS,Red Hat,Windows Server 2008
Posts: 133

Rep: Reputation: 16
C is the best.
 
Old 09-02-2007, 06:25 PM   #5
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
C and C++ are different languages, whilst their is much familiarity with the syntax between the two C++ is more than just C with extra functionality. C++ requires a different approach to software development. Put crudely the reason this was felt important is that C is great for small projects, whilst more structured language elements were required for larger projects. Of course it is possible to have successful large projects written in C, the features of C++ are designed with large projects in mind. So when talking about large projects, are C++ projects more successful that C projects? I don't have any data on that but the statistics of successful projects is fairly grim reading, but this failure is more to do with the management of projects, feature creep, unrealistic time frames, and / or poor quality procedures.

So back to your question, which is better C or C++?

There is no better, they are different, it's like asking which is better apples or oranges? They are both good and they both perform a function very well. So learn both, but more importantly learn to program like a good C programmer, and also learn to program like a good C++ programmer.

Last edited by graemef; 09-02-2007 at 06:27 PM.
 
Old 09-03-2007, 11:05 AM   #6
JMJ_coder
Member
 
Registered: Apr 2006
Distribution: Fedora
Posts: 478

Original Poster
Rep: Reputation: 30
Hello,

I am in a C++ Programming class this semester at the University. I have done some other programming in the past (Pascal in High School and some Basic programming in a couple courses at the University several years back). This is the first intensive programming course I have taken so far.


No matter the case, one of my primary goals is to learn how to program well, with well structured programs that function as well as they can. Any documentation you can link to would be appreciated.
 
Old 09-03-2007, 09:40 PM   #7
95se
Member
 
Registered: Apr 2002
Location: Windsor, ON, CA
Distribution: Ubuntu
Posts: 740

Rep: Reputation: 32
They're both tons of fun. I'm a C programmer at heart, but I love programming in C++ when I get the chance. I do both quite often, along with a host of other languages. As for which is best to learn? Since C++ is object oriented, it is better supported by current modelling tools and techniques, so most large commercial projects use C++. This support generally means C++ is cheaper, easier to implement with, and more maintainable. This is not a "C can't be maintained" thing, but rather "it is generally easier and more cost effective to maintain C++ code." If you are really only coding for a job, then learn C++, otherwise you'll probably end up learning both.
 
Old 09-03-2007, 09:52 PM   #8
pengu
Member
 
Registered: Dec 2005
Location: Canton, GA, USA
Distribution: Ubuntu 7.10, FreeBSD, Debian
Posts: 207

Rep: Reputation: 30
I dont see how everyone thinks c and c++ are so different...

true, a real c++ program looks a lot different to a c one, but when your learning a language you usially dont get into the object oriented phases until you have learnt most other aspects.

I dont know how your being tought, but that was defenitaly the case for me

I learned c++ first, i later bought a c book just to look over and i had no trouble picking it up. If you ask me, once you know c++ you know c, but it might be wise to buy a book (i highly reccomend "The c programming language" publisher: prentice hall) just to become familiar with the standards when NOT using o.o.p.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
which language everyonebleeds Programming 43 07-18-2007 04:08 PM
language chaos111 Slackware 2 02-23-2006 06:30 AM
Best first language? NotJustANewbie Programming 33 09-04-2005 06:03 AM
D language greg108 Programming 33 11-18-2004 08:53 AM
Which language? rooman Programming 4 10-21-2004 08:11 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration