Archived

This topic is now archived and is closed to further replies.

C# and C++

This topic is 5594 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey Guys, Ive just started to learn C++ but im wondering if perhaps I should have looked into C# instead. Could any of you explain C# to me? Would I do better to stop where im at with C++ and move to C#? And lastly, I installed visual C++.net on my computer which seems to me to be just visual studio.net with only C++ stuff. Can I install visual C#.net on top of visual C++.net? (did I word that right??) Thank you for your help.

Share this post


Link to post
Share on other sites
C++ is more general, so learning C++ will make great benefits later. C# is .NET specific, meaning it can only make programs run under .NET platform.


My compiler generates one error message: "does not compile."

Share this post


Link to post
Share on other sites
Learning C# first would be a hell of a lot less frustrating to a newbie than learning the confused mess that is C++. The fact that you have a vast class library available to you which lets you do interesting things very early on(such as GUI programming, sockets, threading etc...) makes the whole learning process a lot more motivating and you are much less likely to give up. While some see those months working with cout and cin as some sort of rite of passage, I don''t.
quote:

C++ is more general, so learning C++ will make great benefits later. C# is .NET specific, meaning it can only make programs run under .NET platform.


This is a valid point, but it doesnt really matter for someone at Emeran''s stage. If you are new at programming, your choice of learning language shouldnt be dictated by considerations as to industry support and the whole "my language is more l33t than your language" thing. The only thing that matters is the pedagogical aspect of the language.
As a newbie, you should learn the concepts behind programming. C++ has a tendency to hide those concepts behinds layer upon layer of quirky syntactical issues, and as such is not very well suited to be a beginner language.

quote:

Can I install visual C#.net on top of visual C++.net?


Visual Studio.NET is mostly a plugin architecture. You have the base IDE, and then you have all the languages that can be plugged into it(Third party vendors have made plugins for other languages as well, such as Python, Perl and XSL/T). Installing VC# should work just fine.



"It is precisely because it is fashionable for Americans to know no science, even though they may be well educated otherwise, that they so easily fall prey to nonsense. They thus become part of the armies of the night, the purveyors of nitwittery, the retailers of intellectual junk food, the feeders on mental cardboard, for their ignorance keeps them from distinguishing nectar from sewage."
Isaac Asimov

Share this post


Link to post
Share on other sites
Thank you all for your reply, particularly Arild Fines, who not only answered my questions but responded to the other posters comments. Im going to go ahead and order some C# books and visual C#.net. I still have all of my C++ stuff so I can always go back there if need be.

Thanks again!

Share this post


Link to post
Share on other sites
quote:
Original post by Arild Fines
Learning C# first would be a hell of a lot less frustrating to a newbie than learning the confused mess that is C++.



I''d hardly consider C++ a confusing mess. The basics of C++ are just as easy to learn as C#.

quote:

The fact that you have a vast class library available to you which lets you do interesting things very early on(such as GUI programming, sockets, threading etc...) makes the whole learning process a lot more motivating and you are much less likely to give up.



Agreed. C++ lacks a strong standard library for doing things such as interprocess communication/remoting, GUI programming and what not. C++ is still a very exciting language to learn though.

I can''t wait until C# supports generic programming though.



Dire Wolf
www.digitalfiends.com

Share this post


Link to post
Share on other sites
i guess the bigger question is what do you want to use programming for. all of the big console game makers use C and maybe some c++. windows games are almost exclusively written in C/C++ or Visual Basic. most windows GUI applications are written in Visual Basic and some in C++. most scientific programs are written in c/c++

note that i haven't mentioned C# anywhere, b/c i honestly don't know of any domain of application programming that uses it in the majority of the field. if there's a field out there in which the majority use C#, i'd like to know so i can give some validity to the language in my own mind.

C# hasn't taken off yet, so learning C# at the expense of C++ you are banking on the industry turning to C#. learning C# in addition to C++ could be good for resume stuff.

I also don't think C++ is a hard language. I think it's pretty easy given that you have a good book from which to learn. the STL _is_ a big library from which you can draw many good things. my biggest hurdle in C/C++ programming was the lack of any native support for strings. STL solves that with it's string class.

my general feeling on learning programming languages or APIs is that you should learn as a first language the one that is the most commonly used in the industry that you wish to enter. In general, it looks best if you have the most experience with the language that the company you are applying to uses. learning an industry standard language is the best way to hedge your bets. IMHO, learning, as a first language, one that not many people use is not the best use of your time.

-me

[edited by - Palidine on August 18, 2002 4:08:40 PM]

Share this post


Link to post
Share on other sites
quote:
Original post by Palidine
i guess the bigger question is what do you want to use programming for. all of the big console game makers use C and maybe some c++. windows games are almost exclusively written in C/C++ or Visual Basic. most windows GUI applications are written in Visual Basic and some in C++. most scientific programs are written in c/c++

note that i haven''t mentioned C# anywhere, b/c i honestly don''t know of any domain of application programming that uses it in the majority of the field. if there''s a field out there in which the majority use C#, i''d like to know so i can give some validity to the language in my own mind.

C# hasn''t taken off yet, so learning C# at the expense of C++ you are banking on the industry turning to C#. learning C# in addition to C++ could be good for resume stuff.

I also don''t think C++ is a hard language. I think it''s pretty easy given that you have a good book from which to learn. the STL _is_ a big library from which you can draw many good things. my biggest hurdle in C/C++ programming was the lack of any native support for strings. STL solves that with it''s string class.

my general feeling on learning programming languages or APIs is that you should learn as a first language the one that is the most commonly used in the industry that you wish to enter. In general, it looks best if you have the most experience with the language that the company you are applying to uses. learning an industry standard language is the best way to hedge your bets. IMHO, learning, as a first language, one that not many people use is not the best use of your time.

-me

[edited by - Palidine on August 18, 2002 4:08:40 PM]


Why do you assume Emeran is in such a hurry to learn? Its totally possible to apply skills and techniques you learn in one language to another. The majority of programming languages all have the same concepts - if statements, loops, assigment... Once you have them down, its easy to pick up another language. The same goes for OO languages and concepts too.

I agree with Arild Fines, C++ *is* a mess compared to "modern" languages like C#, Java or Python. Beginners shouldnt have to worry about array bounds checking or pointers etc. They''ll only end up getting frustrated and then quitting programming all together. Beginners want to able to get results quickly - so their confidence increases along with their interest in programming. They shouldn''t worry about the whatever industry they want to get into yet - if they do then they are going about programming the wrong way IMO.

Python is recommended as a good beginners language by many experts - and from what i''ve seen of it i agree.

Share this post


Link to post
Share on other sites
I would go the same way - start learning with a "strong runtime" language such as Java or C#.

Then moving to C+ will be faster, though very frustrating - frustrating in that you basically will realise how much money a good runtime saves you :-)

Regards

Thomas Tomiczek
THONA Consulting Ltd.
(Microsoft MVP C#/.NET)

Share this post


Link to post
Share on other sites
As a beginner I''m learning C++ first. My cousin recommends it as a MS Certified programmer that knows both C++ and C#. I really have no idea. I haven''t looked in C# either. Considering I''m young I can''t afford to spend 2k on Visual Studio.net anyway.

Share this post


Link to post
Share on other sites
IF you are young, ou are in school, right? UIf you are in school, youqualify for VS for around 30 USD - there are cheap student licenses available. If you are not a student, but an unemployed person then well - how can you afford a computer anyhow .-) ok, that was my sarcasm.

Anyhow, I would strongly recommend against using C++ as a first language. Unless you are extremely luckywith your learning material (and if you cant afford the compiler this also means you cant afford a course, soyyou are stuck with books etc.) you willcatch up a ton of bad habbits. THe main problem with ++ is that it is way too easy to mix it with structural C.

And - you will have to learn a MESS of things to handle graphical user interfaces etc. (not DirectX). These are way fasterdone in C# - and much cleaner. If you start learning, you dont start with 3d engines, you know :-)


Regards

Thomas Tomiczek
THONA Consulting Ltd.
(Microsoft MVP C#/.NET)

Share this post


Link to post
Share on other sites
Here is an easier answer: Learn C!

-C is easy tu learn
-Everything yu learn from c will aplly tu other languages such
as Java, C#, C++ and many other scripting languages that are
C-like
-all the pros use it
-when you're writing games it's fukk load faster than that
object-oriented hogwash
-It's cool
-Did I mention it's cool
-Are yu sure I mentioned it was cool
-it's the original, simple, beautiful, classic language that many other modern languages base themselves upon

Of course, this answer only matters if yu don't know C, which I made an awesome assumption that yu didn't.

[edited by - Fucho on August 20, 2002 6:42:38 AM]

Share this post


Link to post
Share on other sites
quote:
Original post by Arild Fines
/me hands Fucho the award for the most entertaining post of the day

My favourite bit is "when you''re writing games it''s fukk load faster than that object-oriented hogwash". I can''t stop laughing!

Share this post


Link to post
Share on other sites
go to www.bruceeckel.com and download the thinking in C++ books or buy the book and go throught the C course on the CD, so you have a foundation in C, Then learn C++ if you want to learn how to program, if you want to learn an API that is basically Java then learn C#

Once you know how to program in C++ pretty good, all the other languages should come pretty easy, most are C derivatives in syntax and structure.

If you want to make games, learn C and then C++, if you want to do web services and some slow win apps learn C#

I think your best bet is to get Visual Studio 6 and learn C, C++ and Visual Studio, then the rest is yours for the taking, then learn a little VB to impress the parents with your deluxe windows programming skills

Share this post


Link to post
Share on other sites