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 01-28-2005, 04:09 PM   #1
hubabuba
Member
 
Registered: Jan 2002
Location: UK
Distribution: Slack 14.1
Posts: 193

Rep: Reputation: 30
C or C++ or C#????


Hey

I'm learning C and also want to learn C++, but i can't find that many books on C any more. Then, I see the new C# language. Is that a replacement/modern C/C++ or does it have a different applications? Is C getting out of date or would it never get out of date?

Thanks
 
Old 01-28-2005, 04:18 PM   #2
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536

Rep: Reputation: 111Reputation: 111
As far as I know C# is microsoft's C-like lanuage for their DotNet-thing.
 
Old 01-28-2005, 04:23 PM   #3
jrtayloriv
Member
 
Registered: Jun 2004
Location: Inland NW, US
Distribution: Ubuntu
Posts: 366
Blog Entries: 1

Rep: Reputation: 44
C++ is basically (Don't jump on me I know it is oversimplification) a superset of C, meaning it is C with a funky new syntax and a bunch of new functionality and features added on. C# is an attempt by Microsoft to compete with Sun's Java Platform. C++ is a fantastic language to begin with, one reason being the enormous amount of beginner's literature focused on it. C would not be a bad idea either, especially if you plan on working seriously with Linux, as Linux/Unix are built mostly in C. I would reccomend that you start out with C++ and C will be easy to pick up afterwards.

Some great books:

C -
The C Programming Language, by Brian Kearnighan and Dennis Ritchie
It has been around forever, but still remains the BEST resource for learning C

and of course don't forget those info pages...
info libc
info glib


C++ :
C++: How To Program by Harvey and Paul Deitel


hope this helps,
jrtayloriv

Last edited by jrtayloriv; 01-28-2005 at 04:32 PM.
 
Old 01-28-2005, 04:34 PM   #4
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 67
C and C++ are really totally different animals in my opinion.

C is very much a "mid-level" language. It is great for things like OS-kernels and device drivers. I also use C for most of my applications programming since I'm very comfortable with it.

C++ looks like C, but in reality it is intended to be a "high-level" object orriented language. It is great for gui programming, but as a result of it's broken single handling it is pretty terribly for low level things (I don't mean to start a flame war here.... it's just my opinion).

Of course, you can write non-OO code in C++. And you can write OO code in C... nothing is writtin in stone.
 
Old 02-13-2005, 01:37 PM   #5
jarobman
LQ Newbie
 
Registered: Jan 2005
Location: Manitoba, Canada
Distribution: SUSE Personal 9.1
Posts: 23

Rep: Reputation: 15
Quote:
I would reccomend that you start out with C++ and C will be easy to pick up afterwards.
Personally, I think C would be the better language to start with rather than C++. If you start with C++ and then go to C, you have to think about all the stuff you can't do in C that you can do in C++. It's very frustrating when you go to write C code and get a bunch of syntax errors because you have too many C++ elements in it. Also, since C++ is a superset of C, it is backwards compatible with most C syntax. In short, C should be learned first to understand the underlying logic of C++ so that you can take better advantage of C++-exclusive properites.

If you really want to ease your way into C and C++, learn how to become proficient in Java first. It's a very easy language to learn and it is actually based on C.

Quote:
Some great books:

C -
The C Programming Language, by Brian Kearnighan and Dennis Ritchie
It has been around forever, but still remains the BEST resource for learning C
This book is my C bible!


I have actually taken a course in human interfaces where I was writing code in C# using Visual Studio .NET. C# is like C++ and Java fused together. It is actually pretty neat, although I have some issues with some of its syntax. The language is mostly geared towards making windowed applications and can do so very nicely. However, I have come accross some issues in the .NET environment concerning inheritance of forms. C# is in fact made to be a competetor for Sun's Java. If you look at the code, it looks almost exactly like Java. If you know Java, you probably know at least 95% of C#.


In response to the question raised by the title of this thread, I would go with C and C++ seeing that C# is created by Micro$oft and is made to compete with Java (a very good programming language IMHO), a very open source oriented language.
 
Old 02-13-2005, 01:43 PM   #6
mebrelith
Member
 
Registered: Nov 2004
Location: Torreón, Coahuila, México
Distribution: Gentoo
Posts: 342
Blog Entries: 1

Rep: Reputation: 30
C++ all the way mate, oh and if you need some help try some books, theres this one called "Teach yourself C++ for Linux in 21 days" that you may find interesting.
 
Old 02-13-2005, 05:44 PM   #7
darklogik_org
Member
 
Registered: Jan 2004
Distribution: freebsd 5.3, openbsd 3.6, slackware 10
Posts: 96

Rep: Reputation: 15
Don't forget Objective-C, which seems to be a nice middle ground between C and C++ in terms of complexity.
 
Old 02-14-2005, 01:23 AM   #8
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Java as the best OO language for a beginner

Just my $0.02:

1) You're absolutely correct that "C ... will never get out of date".

2) jtshaw was equally correct in stating that "C and C++ are really totally different animals...".

So which one should you go for first?

I'd suggest you start with Java. For the following reasons:

1) Java, like C++ and C#, is an object-oriented language

2) Java is much simpler than C++ and, frankly, much cleaner than C++.

3) I strongly believe you'll be a much better programmer learning C++ after you study Java
than you would be if you studied Java as a second language after learning C++. It's just
much easier to acquire "bad habits" with C++ than it is with Java.

4) Objective-C and C# are also cleaner and simpler than C++.
Objective-C definitely has strong appeal if you're on a Mac, and C# if you have access to Visual Studio .Net.

I'd suggest learning an OO language first (my top vote goes to Java; "runner up" to C#), and learning C (which is *not* object-oriented) afterwards.

And I, too, vote for Kernighan & Richie. It's is not only THE best book on 'C' (by the guys who invented it) ... it's also one of the best computer books of all time.

IMHO .. PSM
 
Old 02-14-2005, 04:37 AM   #9
gr33ndata
Member
 
Registered: Aug 2003
Location: DMZ
Distribution: Ubuntu
Posts: 144

Rep: Reputation: 15
C => Kernel Development, Time Sensitive Applications, etc.
C++ => Object Oriented Design (Can be done via C too with some code hacks)
c# => Micro$oft Lamers
 
Old 02-14-2005, 08:47 AM   #10
redhatrosh
Member
 
Registered: May 2004
Location: Student of University of Mumbai, Maharastra State, India
Distribution: Redhat Linux 9.0, Knoppix LIVE CD, Ubuntu Live CD, Kubuntu Live CD
Posts: 483

Rep: Reputation: 30
c/c++/java/C#

Woh woh...!!! What a long thread!... Looking at the hierarchal structures of the languages that were developed ... one might consider that learning the languages in the form they evolved would be beneficial.. And may be the person suggesting this is me! So,
1) C
2) C++
3) Java
4) C#

and why not?

Secondly, people who learn a particular language first or probably become proficient at a language .. , no matter which language they learnt first.. always consider to tell people that what they learnt perfectly is the language to start first... NO PROBLEM... you are right.. but just give it a second thought.

Well, thanks to the people who made me aware of the fact that C# is a microsoft's foundation....

and.. lets see... I have knowledge of C and a bit of C++.. Hopefully I will learn the four subjects in my academics.. and return later....
 
  


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



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

All times are GMT -5. The time now is 11:42 AM.

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