Thread: C or C++ for first language ?

  1. #16
    Registered User Mobidoy's Avatar
    Join Date
    May 2007
    Posts
    18
    Thanx alot JVerne, This is exactly what i was looking for as info I went from Python to C to C++ to end up with C# lol !!! As Regis would say " Final answer ".

    We will see

    But, lets look for some good books/tutorial for C#

  2. #17
    Its hard... But im here swgh's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,688
    C# is indeed very windows based. It involves an awful lot of Microsofts.net, so if you want to go with C# then I highly recoment you get Visual Sudio from Microsoft. You can either get the free 2005 express edition download from MS website or like me shell out the ££'s and get the proffesional version, I have 2003.,net. Seems outdated compared to 2005 but its very stable and has an excellent compiler and debugger. The choice is yours
    Double Helix STL

  3. #18
    essence of digital xddxogm3's Avatar
    Join Date
    Sep 2003
    Posts
    589
    please nobody hate me for this, but i would recommend visual basic .net to start out in programming. then c++ all the way after that.
    "Hence to fight and conquer in all your battles is not supreme excellence;
    supreme excellence consists in breaking the enemy's resistance without fighting."
    Art of War Sun Tzu

  4. #19
    Registered User
    Join Date
    May 2007
    Posts
    88
    My 2 cents:

    Python is free, very well documented, cross-platform, interactively interpreted (which will aide the learning process), has a simple, consistent, and forgiving syntax. It even supports object orientation. It has modular support for just about any library you would want. With Python you will go far as a beginner.

  5. #20
    "Why use dynamic memory?"
    Join Date
    Aug 2006
    Posts
    186
    i advice you to learn C++. cuz C++ will expose you to more "present time" programming terminology like OO programming and stuff. and after all, C++ is a subset of C, so C++ will have everything that is C, and more


    the bottom line is :
    dont move to any advanced programming with the language (like WinAPI32, for example) until you MASTER all the language topics

    good luck
    "C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg."-Bjarne Stroustrup
    Nearing the end of finishing my 2D card game! I have to work on its 'manifesto' though <_<

  6. #21
    semi-colon generator ChaosEngine's Avatar
    Join Date
    Sep 2005
    Location
    Chch, NZ
    Posts
    597
    Quote Originally Posted by UMR_Student View Post
    My 2 cents:

    Python is free, very well documented, cross-platform, interactively interpreted (which will aide the learning process), has a simple, consistent, and forgiving syntax. It even supports object orientation. It has modular support for just about any library you would want.
    Agreed.

    Quote Originally Posted by UMR_Student View Post
    With Python you will go far as a beginner.
    In fact, I'd go further than that. Many professional apps are written in python. I use it in combination with boost.python to allow scripting and testing at work.

    [soapbox]I wouldn't develop an application in C++ these days. It's a systems-level language that's very good at what it does, but compared to Python, C# or Java, it just doesn't cut it. Even for "high-performance apps", I'd write the application in python first, then replace the bottlenecked modules with c++ boost.python modules.[/soapbox]
    "I saw a sign that said 'Drink Canada Dry', so I started"
    -- Brendan Behan

    Free Compiler: Visual C++ 2005 Express
    If you program in C++, you need Boost. You should also know how to use the Standard Library (STL). Want to make games? After reading this, I don't like WxWidgets anymore. Want to add some scripting to your App?

  7. #22
    Registered User
    Join Date
    Nov 2004
    Location
    Pennsylvania
    Posts
    434
    See i notice this common misconception that you need to start with C to get onto C++. This is not true.

    They are two (very similar) yet still different languages, each with its pros and cons. If you want C++ jump right into it with a good book. BOOKS are the key, haha, not online tutorials. Use tutorials to learn new little things that the books dont have.

    I started C++ with less experience than you probably have and i am managing fairly well with it, i've tried some Win32 stuff, as well as DX too. I just dont have oodles of time on my hands for it, that's my problem.

    C++ is the way to go. You'll be fine.

    Good luck!
    "Anyone can aspire to greatness if they try hard enough."
    - Me

  8. #23
    "Why use dynamic memory?"
    Join Date
    Aug 2006
    Posts
    186
    Python is good... great, but cannot compare it with C nor C++ in terms of power and control over the computer.

    In my opinion, Python is perfect for a retired programmer, just to chill out and make good commercial programs with not so much effort.
    "C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg."-Bjarne Stroustrup
    Nearing the end of finishing my 2D card game! I have to work on its 'manifesto' though <_<

  9. #24
    Its hard... But im here swgh's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,688
    One of the main problems I had when going from C to C++ was "unlearning habbits I had been taught at college when I learnt basic C after I left school. It is one of the reasons I use C a bit more than C++. Everyone has their perosnal view on why or why not you sholud use one and not the other, It all boils down to a fsw things:

    1 What are you trying to create
    2 Picking the language you know best and are happy to use
    3 Picking the tools that are best to get the job done
    Double Helix STL

  10. #25
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    Quote Originally Posted by Hussain Hani View Post
    i advice you to learn C++. cuz C++ will expose you to more "present time" programming terminology like OO programming and stuff. and after all, C++ is a subset of C, so C++ will have everything that is C, and more


    the bottom line is :
    dont move to any advanced programming with the language (like WinAPI32, for example) until you MASTER all the language topics

    good luck
    No, C++ is a superset of C, and C is a subset of C++.

    While C++ offers more, this can be a bad thing for a beginner.

  11. #26
    semi-colon generator ChaosEngine's Avatar
    Join Date
    Sep 2005
    Location
    Chch, NZ
    Posts
    597
    Quote Originally Posted by zacs7 View Post
    While C++ offers more, this can be a bad thing for a beginner.
    I disagree. When you start programming, you want to learn about control structures, variables, functions, etc. You don't need to know about memory models, buffer overruns or memory leaks.

    To borrow from a presentation Stroustrup gave a while ago, ask a beginner to write a simple program to input a name and output "Hello, name"

    in C++ it,s easy.
    Code:
    #include <string>
    #include <iostream>
    
    int main()
    {
        std::string name;
    
        std::cout << "What is your name?" << std::endl;
        std::getline(cin, name);
    
        std::cout << "Hello, " << name << std::endl;
    
    }
    in c, a trivial implementation is
    Code:
    #include <stdio.h>
    
    int main()
    {
        char name[256]; /* hope this is enough!! */
    
        printf("What is your name?\n");
        
        scanf("%s", name);
    
        printf("Hello, %s\n", name);
    }
    at first, glance they're pretty similar, but the c implementation is arbitrarily limited to 256 chars in a name. Ok, it's not likely that someone will have a name longer than 256 chars, but the first law of software testing is that if it can happen, it will happen at some point.

    The C++ implementation protects you from this. How is that not a good thing for beginners?

    While C++ is probably not the best language I'd choose for beginners, C is definitely not the language I'd choose!
    "I saw a sign that said 'Drink Canada Dry', so I started"
    -- Brendan Behan

    Free Compiler: Visual C++ 2005 Express
    If you program in C++, you need Boost. You should also know how to use the Standard Library (STL). Want to make games? After reading this, I don't like WxWidgets anymore. Want to add some scripting to your App?

  12. #27
    "Why use dynamic memory?"
    Join Date
    Aug 2006
    Posts
    186
    I disagree that C++ is a bad thing to start with, I started with C++. Everything went went just perfect, nothing was hard if you took it step by step
    "Little by little, everyone travels far"-JRR Tolkien
    "C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg."-Bjarne Stroustrup
    Nearing the end of finishing my 2D card game! I have to work on its 'manifesto' though <_<

  13. #28
    semi-colon generator ChaosEngine's Avatar
    Join Date
    Sep 2005
    Location
    Chch, NZ
    Posts
    597
    Quote Originally Posted by Hussain Hani View Post
    Python is good... great, but cannot compare it with C nor C++ in terms of power and control over the computer.

    In my opinion, Python is perfect for a retired programmer, just to chill out and make good commercial programs with not so much effort.
    No offense, but it never ceases to amaze me how far removed some programmers are from reality.

    Programming is (primarily) a commercial activity. We are paid to program by people who want programs so they can a) sell them and make money or b) use them for some other purpose and make money. They couldn't care less how you write the program as long as it works and is done for as cheap as possible.

    Unless you really have a need for "power and control over the computer" (and IMHO, 95% of the posters on this board don't), then "power and control" just equate to "more work and potential errors".

    apologies for hi-jacking the thread.
    "I saw a sign that said 'Drink Canada Dry', so I started"
    -- Brendan Behan

    Free Compiler: Visual C++ 2005 Express
    If you program in C++, you need Boost. You should also know how to use the Standard Library (STL). Want to make games? After reading this, I don't like WxWidgets anymore. Want to add some scripting to your App?

  14. #29
    Registered User
    Join Date
    Oct 2001
    Posts
    2,934
    >but the c implementation is arbitrarily limited to 256 chars in a name.
    More like 255.

    I agree with your viewpoint on the topic though.

  15. #30
    Its hard... But im here swgh's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,688
    Good points Chaos Engine, But I put this to you...

    Seasoned C programmers i have spoken to at college and university state that they would never revert to C++ as they are so used to how they code now. Even thiough they have glanced at C++, they know C "too well" to revet back for one reason:

    'It is too hards to break our habbits' Ie: #define for a constant instead of C++ const keyword.

    Do you agree with their statement or would you say to them C++ offers more to them than C? i do agree with all you have said, I know more C than I do C++. But as David P pointed out once, there is no harm in learning both languages.
    Double Helix STL

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. What language did they make Java in?
    By jverkoey in forum A Brief History of Cprogramming.com
    Replies: 17
    Last Post: 07-03-2005, 04:18 PM
  2. Strange loop
    By D@rk_force in forum C++ Programming
    Replies: 22
    Last Post: 12-18-2004, 02:40 PM
  3. assembly language...the best tool for game programming?
    By silk.odyssey in forum Game Programming
    Replies: 50
    Last Post: 06-22-2004, 01:11 PM
  4. Language of choice after C++
    By gandalf_bar in forum A Brief History of Cprogramming.com
    Replies: 47
    Last Post: 06-15-2004, 01:20 AM
  5. Languages dying
    By Zewu in forum A Brief History of Cprogramming.com
    Replies: 31
    Last Post: 07-29-2003, 10:08 AM