LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


View Poll Results: Which one would you recommend?
C 12 30.77%
C++ 27 69.23%
Voters: 39. You may not vote on this poll

Reply
  Search this Thread
Old 02-22-2007, 08:09 PM   #1
gregorian
Member
 
Registered: Apr 2006
Posts: 509

Rep: Reputation: 34
Should I learn C or C++


Well, I already know a little Java, so C++ would probably be the more natural choice. But I've heard that C is much more powerful than C++. Which one would you recommend?
 
Old 02-22-2007, 08:14 PM   #2
ksgill
Senior Member
 
Registered: Apr 2003
Location: Toronto, Canada
Distribution: Ubuntu Jaunty (9.04)
Posts: 1,044

Rep: Reputation: 45
Quote:
Originally Posted by gregorian
Well, I already know a little Java, so C++ would probably be the more natural choice. But I've heard that C is much more powerful than C++. Which one would you recommend?
C++ should be fine, it can do everything that C can...relatively easier too. My .
 
Old 02-23-2007, 04:18 AM   #3
anant
Member
 
Registered: Nov 2006
Distribution: Sles 10
Posts: 108

Rep: Reputation: 15
Well i would suggest you to go for C++, I tried out many different languages so that i could avoid C++ but atlast i left with a choice of C++ for certain applications...AS Ksgill said C++ does everything like C does but yeh no doubt C is a mother of all languages but C++ is equivalent and more demanding these days...

All the Best..
 
Old 02-23-2007, 04:51 AM   #4
Tux-Slack
Member
 
Registered: Nov 2006
Location: Slovenia
Distribution: Slackware 13.37
Posts: 511

Rep: Reputation: 37
Almoast, ALMOAST, every C command works within C++ if you include the right library in the code
So i would vote for C++
And i've been programing with both C and C++ and i don't see why C would be a better choice

It's true that my studies were based on win32 C and C++ programing and i've been doing the programing in Linux C++ POSIX only for a few days, so i'm still a newbie in programing under Linux with
 
Old 03-01-2007, 05:56 AM   #5
LaughingBoy
Member
 
Registered: May 2006
Location: Adelaide, South Australia
Distribution: Fedora 6-17 x64 / Ubuntu 10.x x64
Posts: 95

Rep: Reputation: 16
Thumbs up C++ = Oo C

C is a nice procedural language, but C++ (like Java) is an OO (Object Oriented) language. There are books on "switching from C++ to Java" and "Switching from Java to C++", but because C is so different, you'd be hard pressed to find such a title.

C++ was allegedly C made into an Object Oriented programming language.

If you're familiar with Java, then the transition to C++ won't be as bad as the transition to C, but it's handy to know what's C and what's C++.

I say learn both!
 
Old 03-01-2007, 06:54 AM   #6
Junior Hacker
Senior Member
 
Registered: Jan 2005
Location: North America
Distribution: Debian testing Mandriva Ubuntu
Posts: 2,687

Rep: Reputation: 61
I don't have any experience in the field.

But I do know "knowledge is power", I agree with LaughingBoy
 
Old 03-01-2007, 06:57 AM   #7
The Headacher
Member
 
Registered: Jan 2007
Distribution: Vector Linux
Posts: 90

Rep: Reputation: 15
Start off with 'C', then learn C++.

you'll get a good start in C++ when you do so. You can see how similar they are and where they are different. I finished studying my book on 'c' some time ago and am now in the process of learning C++.

By learning 'c' I hoped to get the basic knowledge needed to start programming, but I was kind of disappointed to find out I knew far too little. I started learning gtk+ to make gui's but it was too much of a pain to work with, and most other widget sets are designed to work with c++. A lot of other libraries seem to be designed to work with both 'c' and c++. Often, tutorials & such will use 'c' as default though.

I finished most of the stuff that was already done in my book on 'c' in little time, so now I can continue to learn the stuff in c++ that is different or new from 'c'.

I can still say I learned c though.

Last edited by The Headacher; 03-01-2007 at 07:00 AM.
 
Old 03-01-2007, 07:46 AM   #8
zsd
Member
 
Registered: Dec 2005
Location: Nova Scotia
Distribution: Slackware
Posts: 70

Rep: Reputation: 24
Quote:
Originally Posted by LaughingBoy
C is a nice procedural language, but C++ (like Java) is an OO (Object Oriented) language. There are books on "switching from C++ to Java" and "Switching from Java to C++", but because C is so different, you'd be hard pressed to find such a title.
Not that hard. "C for Java Programmers" by Muldner is such a book.

Jim
 
Old 03-01-2007, 10:54 AM   #9
blue_hat
LQ Newbie
 
Registered: Feb 2007
Posts: 4

Rep: Reputation: 0
From a beginner's standpoint I'd go for C++, I'm big on teaching myself some language, I've started with XHTML and for someone totally new to computer ptogramming whatsoever, I'd say go for XHTML it teaches the concepts you need to know to learn the rudimentary principles of programming.

Now for real programming C++ is my pick, I'm sure if you ask other people they'll tell u other languages, I've heard Perl, Python, Pascal, Ada etc. When comparing C and C++, I'd go for C++, I've tried C first but got bored and switched to C++ and after a couple of weeks, I'm able to write a few useful programmes and I'm not even 15% competent in the language yet, it is the easier of the two I believe!!!
 
Old 03-01-2007, 11:12 AM   #10
Jaqui
Member
 
Registered: Jan 2006
Location: Vancouver BC
Distribution: LFS, SLak, Gentoo, Debian
Posts: 291

Rep: Reputation: 36
It really depends on what you want to program.
OS / Device Driver* programming is most commonly done in C and Assembly [ the first re-usable programming language, re-usable in that you could load the program and go in minutes, not the days of reprogramming the pre solid state computers had ]

Application* programming is C++ and Java

system admin tasks are often scripted in perl, python, bash, php, ruby, lisp.

Website programming, javascript, java, python, ruby [ on rails ], php, perl, xlst / xml / xhtml.

most programming skills are transferrable across languages, and a lot of syntax is also transferable between languages in some groupings. Pick a direction and that will help you to pick a language.
It definately never hurts to learn more languages, and to join open source projects to keep the language skill up after learning it

* Apple's Mac OSX uses the cocoa framework in Objective C.
 
Old 03-01-2007, 11:26 AM   #11
gregorian
Member
 
Registered: Apr 2006
Posts: 509

Original Poster
Rep: Reputation: 34
Well, thanks for the replies guys. I've started learning C++ . The reason I wanted to go for C is because lots of Linux programs come written in C. Actually, I haven't come across any Linux programs written in C++ . Not yet.
 
Old 03-01-2007, 11:29 AM   #12
The Headacher
Member
 
Registered: Jan 2007
Distribution: Vector Linux
Posts: 90

Rep: Reputation: 15
Quote:
I've started learning C++ . The reason I wanted to go for C is because lots of Linux programs come written in C. Actually, I haven't come across any Linux programs written in C++ . Not yet.
oh, I think you have, you just might not have realized it yet. Everything that uses QT (KDE) is written in c++ for instance.
 
Old 03-01-2007, 12:27 PM   #13
m_wielgus
LQ Newbie
 
Registered: Apr 2006
Location: Gliwice, Poland
Distribution: Debian testing
Posts: 7

Rep: Reputation: 0
Definitely C++. C++ combines the speed & power of the good old structural C while adding many other advantages, like Object Oriented Programming (OOP) techniques (like inheritance, polymorphism etc), exception handling, stricter type checking (that's why it's said that you can sometimes find bugs in your C program by just recompiling it using an C++ compiler) namespaces (especially useful in big programs/libraries, where there's a big risk of name conflicts) and others.

If you want to learn c/c++ there's a great book "Thinking in C++" by Bruce Eckel. You can download it freely here: http://www.mindview.net/Books/TICPP/...loadingTheBook
 
Old 03-01-2007, 04:54 PM   #14
andrewfeberwee
Member
 
Registered: Feb 2007
Posts: 30

Rep: Reputation: 15
Always had a soft spot for plain old C. Was a C/UNIX programmer for year and years. K&R is still the most read book in my library. These days I just do java.
 
Old 03-01-2007, 06:53 PM   #15
Electro
LQ Guru
 
Registered: Jan 2002
Posts: 6,042

Rep: Reputation: Disabled
I suggest learn C. Then learn C++. Most backends and the kernel is written in C. Most GUI programs are written in C++. There are GUI such as GTK is compiled in C. Mixing C and C++ in your program can reduce performance. Not always C++ is faster than C and C is not always faster than C++. It depends on the data being process and how you structure your code.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Hello everyone Looking to learn as most as I can Smoken LinuxQuestions.org Member Intro 3 10-28-2005 07:49 AM
new and really want to learn Fear Linux - Newbie 3 11-09-2004 09:16 AM
I want to learn C. KptnKrill Programming 14 12-18-2003 02:03 PM
I want to learn more ThorsHammer Linux - Newbie 2 11-07-2002 09:13 AM
I would like to learn how to do it tournesol Linux From Scratch 2 10-07-2002 11:07 PM


All times are GMT -5. The time now is 02:30 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration