CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9
  1. #1
    Join Date
    Jan 2011
    Posts
    1

    My Path to Mastery of C#

    Why:When i reach the 12th grade i would be required to learn C. So i decided to start with C#.

    Why not C++:From what i read on the web C# is a little bit more user friendlily for noobs like me to learn.

    What do i plan to do in the far future:Game Programming. I love games and i love computers along with programming. So putting all of this together i aspire to make games for computers and browsers.

    So i plan by summer to have at lest the Basics and Intermediate stuff down. I know before you go making a game in any language you have to know it back and front and you have to practice with it alot. So i just want some help if any of you have done it before.__.
    Current Status:Looking for a good Tutorial for it.

  2. #2
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: My Path to Mastery of C#

    Read the forums. Download the SAMPLES in my sig, and ask questions!
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  3. #3
    Join Date
    Dec 2007
    Posts
    234

    Re: My Path to Mastery of C#

    If you're going to games, I won't bother with C#... just go straight for C/C++

    And learn about DirectX, GDI/GDI+

    -tg
    * I don't respond to private requests for help. It's not conducive to the general learning of others.-I also subscribe to all threads I participate, so there's no need to pm when there's an update.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help - how to remove eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to???
    * On Error Resume Next is error ignoring, not error handling(tm). * Use Offensive Programming, not Defensive Programming.
    "There is a major problem with your code, and VB wants to tell you what it is.. but you have decided to put your fingers in your ears and shout 'I'm not listening!'" - si_the_geek on using OERN
    MVP '06-'10

  4. #4
    Join Date
    Sep 1999
    Posts
    137

    Re: My Path to Mastery of C#

    If you're going to games, I won't bother with C#... just go straight for C/C++
    I use C++. I have been wanting to learn C# because it is a new, improved C++. So this is interesting.

    What do people use C# for? Who uses C++?

  5. #5
    Join Date
    Jan 2011
    Location
    Netherlands
    Posts
    45

    Re: My Path to Mastery of C#

    Yes thats a good question.


    can somone tell us what are advantages and/or disadvantages of C# vs. C++ ??? or is there anything that you cant do in C# and only possible in C++??

  6. #6
    Join Date
    Feb 2011
    Posts
    1

    Re: My Path to Mastery of C#

    C++ is generally faster than C# and is mostly used for bigger projects, games and operating systems, that's what I've heard and read.

    What I would like to ask about C#, what is the best way for somebody to learn it/start learning some things, on your own of course, considering that person already has some C++ experience, and has been introduced to most of basic concepts of C++?

  7. #7
    Join Date
    Jan 2010
    Posts
    1,133

    Re: My Path to Mastery of C#

    Quote Originally Posted by TechGnome View Post
    If you're going to games, I won't bother with C#... just go straight for C/C++

    And learn about DirectX, GDI/GDI+

    -tg
    This is not quite right. Managed DirectX was perfectly capable, and the XNA framework too. The thing is, there are maybe one or two commercial games that were written in C# (nothing famous), and a bunch of small studio or indie games, that all prove it is not impossible. Why only few? In the past years, mainstream games were all made in C++, and now the stakeholders prefer to stick to what they know. The teams would have to learn the new language, new concepts, new environment... It's risky and it costs. And there's the widespread misconception (especially amongst C++ programmers) that C# is way to slow. The truth is, while C++ is faster (since the code compiles to native instructions among other things), C# is not that slow at all. And as the time goes by and the hardware becomes more powerful, it will cease to matter and I believe that, in the near future, C# will take prime, or become at least as widespread as C++, since the benefits will by far outweigh the drawbacks.

    Game programming is more about design than it is about optimizations, and since anyone learning game programming won't be writing 3D blockbuster games from the start, C# is IMO the perfect language to use to learn how to actually construct the engine.

    Quote Originally Posted by mmesser View Post
    I use C++. I have been wanting to learn C# because it is a new, improved C++. So this is interesting.

    What do people use C# for? Who uses C++?
    Quote Originally Posted by Sean87 View Post
    Yes thats a good question.

    can somone tell us what are advantages and/or disadvantages of C# vs. C++ ??? or is there anything that you cant do in C# and only possible in C++??
    Quote Originally Posted by _first View Post
    C++ is generally faster than C# and is mostly used for bigger projects, games and ope8rating systems, that's what I've heard and read.
    C# is not "new, improved" C++. Despite the similarity in syntax, these are two different languages. They both belong to the "C" family of languages, but so does Java. All different languages.
    There are many things that you can do in almost any programming language. Heck, except for being cumbersome, there's noting preventing you to use the assembly language today.

    C# is used for a wide variety of applications/problems; take the available technologies:
    Windows Forms, and now WPF are used for the UI layer (like Windows 7?).
    ADO.NET and Entity Framework are used for database access (and data access in general) and data services.
    WCF is a platform that Microsoft now pushes for distributed application development, and this should be especially interesting to big companies - enterprise applicications.
    WF "is used to create applications that execute an ordered business process, such as the steps needed to approve a document, hire a candidate for a position, or make a purchase." (quote: Wikipedia)
    And then there's a bunch of other things that the .NET framework provides: threading, cryptography, networking, graphics, interoperability, XML, globalization, reflection...
    Almost anything you can imagine.
    Incidentally, you could say that for C++, too. It accomplishes many of the same tasks in a different way. And there's C++/CLI that's used to create managed code, and very often to create a bridge between the legacy native code and the new managed code.

    Some of these technologies rely on previous technologies (many of which were written in C++), most of them are written to relatively easily interoperate with the old code. The C# language is managed, and the code compiles to MSIL, which makes it platform (and language) independent (the same .NET application can be written in several languages with almost no trouble, like C#, VB.NET, C++/CLI...). At runtime, it is (very effectively) JIT-compiled into the language native to the platform.
    C# is also a more OO language.

    The thing is, you either write code to achieve something or use a library - the .NET Framework provides a wide variety of libraries to work with.
    C++ has it's own set of libraries, too, developed over the years to address specific challenges. When performance is an imperative, native C++ is the language of choice. But even C++ developers sometimes use assembly code to speed things up even further.
    I don't need to tell you what can be done in C++: a wide variety of applications in the past two decades were written in C++, probably more than 80% of what you yourself used on your PC.
    C++ can also be used to create embedded software. C# on the other hand, requires the presence of the Common Language Runtime (CLR), as all .NET languages do. (Or at least of the CLR for.NET Compact Framework for resource-constrained devices.)
    C# was created as a modern language, with the challenges of the new age in mind, where the Internet and other forms of connectivity will rule our lives even more than now.

    C++ is power & speed, but it is also a bit messy and prone to being misused by programmers.

    C# is reason & elegance, and somewhat less prone to being misused by programmers.

    Not much to go on, but that's how it is. Once you have enough experience, try both and see what feels better for you.
    IMO, C# is the language of the future (but I'm not saying C++ isn't gonna be there also).

    Quote Originally Posted by _first View Post
    What I would like to ask about C#, what is the best way for somebody to learn it/start learning some things, on your own of course, considering that person already has some C++ experience, and has been introduced to most of basic concepts of C++?
    Buy a good book, take a good course, explore the web, find some tutorials, ask questions on forums, learn to read MSDN documentation, write programs and have fun exploring.
    First you want to thoroughly understand the basics, than have at least some understanding of the .NET platform, managed environment and the garbage collector (GC). Then it becomes less language-specific, and it depends on how far you want to go: make sure to understand what OO programming is, what is the reasoning behind it, understand inheritance and composition, then possibly learn UML, then Design Patterns, have the ear for best practices, and the more you know and truly understand, the more you'll see what is the essence of things and how everything is connected in some ways, how some APIs are supposed to work. The more you know, the better code you should write.
    And remember: practice, practice, practice.
    Last edited by TheGreatCthulhu; February 1st, 2011 at 07:31 PM. Reason: A few thigs to add...

  8. #8
    Join Date
    Sep 1999
    Posts
    137

    Re: My Path to Mastery of C#

    Thanks, Cthulhu.

    What I would like to ask about C#, what is the best way for somebody to learn it/start learning some things, on your own of course, considering that person already has some C++ experience, and has been introduced to most of basic concepts of C++?
    For learning it, there is a set of courses I have been thinking about. They are $725 each. The first two courses cover C#. Two more electives are needed if you want a certificate. So it is a fair investment of time and money to go that route. Other courses are likely similar.

    The text for the first two courses is Pro C#2010 and the .NET 4 Platform, by Andrew Troelsen. Reviews say it has broader coverage than most, and good depth. I bought a copy, and am up to chapter 2. So far it seems readable on my own. But at 1700 pages, it is about the heaviest text book I have ever seen. Don't drop it on your toe. It looks like a good choice. Reading all the way through on your own would be a big project.

    Troelsen make a few points at the beginning of the book. It sounds like the hard part is not learning C#. He says "The .NET Framework 4.0 SDK documentation is extremely good, very readable, and full of useful information. Given the huge number of predefined .NET types (which number well into the thousands), you must be willing to roll up your sleeves and dig into the provided documentation. If you resist, you are doomed to a long, frustrating, and painful existence as a .NET developer."


    Troelsen says "The languages (C++, Visual Basic 6.0, Java), frameworks (MFC, ATL, STL), architectures (COM, CORBA, EJB) and APIs that were touted as the silver bullets of software development eventually become overshadowed by something better, or at the very least something new."

    He explains some of the problems of the older technologies.
    • C++ programming is difficult and error prone, even with MFC.
    • Visual Basic is limited. E.G. There is no support for inheritance or multithreading.
    • Java doesn't mix well with other languages. If a project uses Java, the entire project must be Java.
    • COM is complex and difficult to learn. ATL or VB6 can help, but not enough. There are DLL Hell problems. Supporting data types from different languages is cumbersome.

    .NET is supposed to make our lives easier. If offers
    • Interoperatbility with existing code. COM binaries can run under .NET.
    • Support for numerous programming languages, including C#, J#, etc.
    • A common runtime engine shared by all .NET-aware languages. They all use the same types.
    • Complete and total language integration. Inheritance, exceptions, debugging all work the same way for all .NET aware languages.
    • A comprehensive base class library. Less complex and more consistent than other technologies.
    • No more COM plumbing.
    • A simplified deployment model. Support for multiple versions of a DLL. No registry issues.


    From his description, .NET sounds great. Everybody should be switching to .NET.

    But before I go too far with it, is everyone switching? Will C++, MFC, and COM only be used to support legacy applications?

    Or is .NET a good idea that hasn't really caught on? Is it a niche framework?

    I have the impression that C# is becoming increasingly popular, but still is much less used than C++. Relatively few programmers use it. Much more existing code has been written with C++ than C#. There are jobs available for both (or will be when the economy improves).

    I have the impression that, even though the framework can do many things, most of the C# jobs are for web development.

    Are these impressions correct?

  9. #9
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: My Path to Mastery of C#

    Brad Jones has written books in both C# and C++ as I recall. Check out his profile.
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured