Very first language.

Discussion in 'Mac Programming' started by redking31591, Jul 3, 2009.

  1. macrumors 6502

    Joined:
    Jul 10, 2008
    #1
    I needed a summer project and I decided to learn my very first computer language. I picked up a teach yourself C++ book at the bookstore. Was this a bad move should I have learned something else first or was this a good move just to dip my toes into writing programs? I have no aspirations to be a dev I just wanted something new to do and maybe help me with college math. Of course I have a mac. Would it have been better to have started with C or Objective-C or was this a good jumping off point?
     
  2. macrumors 604

    chrono1081

    Joined:
    Jan 26, 2008
    Location:
    Isla Nublar
    #2
    C++ is generally seen as not the best choice for a beginner. Reason being is it takes a long time to be able to do anything useful and there are a million pitfalls along the way. Programming can get discouraging if you can't see results in the beginning.

    Also it depends what you want to learn to program as well (games, etc). Python is great for a beginner. Java is good for beginners as well.
     
  3. macrumors 603

    richard.mac

    Joined:
    Feb 2, 2007
    Location:
    51.50024, -0.12662
    #3
    Java is easier than C which C++ is an enhancement on.
     
  4. macrumors 6502a

    Jayomat

    Joined:
    Jan 10, 2009
  5. macrumors G4

    Joined:
    May 10, 2004
  6. macrumors 6502a

    GorillaPaws

    Joined:
    Oct 26, 2003
    Location:
    Richmond, VA
    #6
    Based on your stated goals, it sounds like either Java or Python would be good choices. Good luck, and have fun.
     
  7. macrumors 6502a

    Joined:
    Sep 3, 2005
    Location:
    Cramlington, UK
    #7
    If you're interested in maths then you might find something like Maple or Mahematica more rewarding and useful. Both of these have their own programming language too.

    b en
     
  8. thread starter macrumors 6502

    Joined:
    Jul 10, 2008
    #8
    So would I be okay to start with say Python and then move on to C++? I have maybe a future goal of iphone development but I am in no hurry to get there. I just kind of want to know how programs work. So would this be a good route
    Python/Java to C++ to Objective-C to Cocoa? I just don't want the book I bought for $35 to go to waste. Also what would be the best language to first learn on windows xp. My younger brother wants to learn some language but he uses windows.
     
  9. macrumors Core

    miles01110

    Joined:
    Jul 24, 2006
    Location:
    The Ivory Tower (I'm not coming down)
    #9
    That would work. Generally languages fall into one of two broad categories: compiled and scripting languages. Compiled languages like C, C++, etc tend to be more "powerful" and robust, but scripting languages (perl, tcl, etc) are, in my opinion, more intuitive when you're first starting out.

    The more important thing is to learn the general structure of programs and the methodology. Once you've got that down it's just a matter of adjusting syntax to fit whatever language you're working in.
     
  10. thread starter macrumors 6502

    Joined:
    Jul 10, 2008
    #10
    That sounds good. while I said I don't want to be a full blown dev, i don't plan to quit at the end of the summer and I plan to continue this through college and on for fun maybe write a few basic programs. thats why I want to learn cocoa since thats a primary language for macs. I also figured since Cocoa is based on objective-c that learning C++ before objective-c would be easier since I have read they have similarities but that c++ is easier but that it isn't hard to jump from c++ to objective c
     
  11. macrumors newbie

    Joined:
    May 2, 2009
    #11
    Personally, I would go straight to Objective-C and then to C++. I found that I got a much better grasp of OOP this way than the other way around.
     
  12. macrumors regular

    Joined:
    Jun 30, 2008
    #12
    There are certainly similarities between the two, but I would recommend just going straight into objective-c, especially if you would like to eventually create a few iphone or mac apps.

    Once you learn one programming language, picking up others is usually fairly easy. If you are starting with C++ and then move to Objective-C, some of the object oriented syntax might look strange or seem hard to grasp at first, even though most of the syntax is pretty similar.
     
  13. thread starter macrumors 6502

    Joined:
    Jul 10, 2008
    #13
    Well I was planning on switching to python as my first language so you think I should go python to objective-c to c++ right? Just want to know if I should return this book I got the other day. I have read that it takes about a month or two to learn python so if I went to C++ i would keep the book but if I went into objective-C I would return it or should I just keep it no matter what so I don't have to re-buy it. Is there even a point in learning c++ after objective-c and am I better giving the book to my brother who wants to learn on windows?. I'm not really in a hurry to write mac apps, I just want to take a nice and relaxed approach that can function as a hobby throughout college.

    Also how hard is the jump from objective-c to cocoa and cocoa touch?
     
  14. macrumors 68040

    Joined:
    Apr 22, 2005
    #14
    Cocoa and Cocoa Touch are Objective-C frameworks, not languages on their own. If you know Obj-C, using them is just a matter of understanding the design patterns they follow to and being able to look up the correct classes/methods to use in the documentation.
     
  15. macrumors 6502

    Joined:
    Jul 1, 2006
    #15
    I liked Learn C on the Mac, it has followup books for Obj-C and Cocoa / Cocoa Touch as well.
     
  16. macrumors regular

    Joined:
    Jun 30, 2008
    #16
    If it were me, I would just start out going straight for C, then any other language you want to pick up will seem like a breeze since most will use a C-style syntax. I think that if anyone really wants to learn to program, C is easily one of the best foundations. Objective-C is essentially C with some extensions added to it, and as the previous poster noted Cocoa is a framework built with Objective-C. So if you want to eventually use Cocoa, then definitely go straight for C or Objective-C.
     
  17. Joined:
    Jun 30, 2009
    #17
    I find C++ to be an easy language if you've got the right material. I, for one, am using Brian Overland's C++ Without Fear. It's probably the most basic and gentle introduction to the language. It teaches you more of the basic PROGRAMMING concepts, instead of getting into C++ specific language features.

    Next, you could go for Bruce Eckel's Thinking in C++, which has two volumes, teaches you many advanced concepts, and probably the best of all, it's FREE :)

    And of course, Bjarne Stroustrup's The C++ Programming Language.

    But if you want to see results fast, I'd say web programming is the best fit. You'll spend some time (the more the better) on HTML/XHTML and CSS, which are not programming languages, but you'll get to JavaScript, PHP and SQL, which will give you a gentle introduction to programming.
    The main advantage is that you will see how your web pages evolve from plain HTML, to fancy CSS and AJAX effects, to your own server-side scripts.

    I've also heard on other boards that your book has many wrong lines of codes and so on.
     
  18. macrumors regular

    Joined:
    Feb 1, 2009
    #18
    c is a subset of objective-c
    so learning c from the beginning is a good idea
    pick this: C Programming: A Modern Approach, 2nd Edition

    and then i think objective-c is much easier than c++
     
  19. macrumors regular

    Joined:
    Mar 17, 2008
    #19
    Don't stress too much, though, it really is not *that* important. Personally, I hopped around randomly. I started with VB, then BlitzMax, then Actionscript, then Java, then C++, then finally ended up in Objective C.

    Each language has a different feel, and each has its own advantages. However, for math, you can make simulations in Java by using Greenfoot, solve problems with C++ by making a command line tool, or make a simulation app in Objective C.

    Personally, I enjoyed my time with C++. I found it interesting, and it was a tool for me to solve math problems. For example, you could make a simulation of water running through cups with holes. (User sets volume and flow rate, and the program tells you how much volume is in each container, or if one overflowed ... etc.)
     
  20. macrumors 68040

    lee1210

    Joined:
    Jan 10, 2005
    Location:
    Dallas, TX
    #20
    Sometimes when this question gets asked (which is about 1-2x/week), people just say to search the forum and read the guides linked at the top. Every once in a while, everyone jumps in and restates what has been said many times before.

    As far as I'm concerned C->Objective-C is best, but it really doesn't matter. Just get programming. Don't spend a lot of deciding what to start with, you're just wasting time that you could be learning. You're not going to be eternally, irreparably crippled by picking a particular language (recovering from Fortran or BASIC might take some time, but i believe it's possible).

    Just choose one and go. When you have questions, ask. Good luck!

    -Lee
     
  21. macrumors 6502a

    GorillaPaws

    Joined:
    Oct 26, 2003
    Location:
    Richmond, VA
    #21
    I agree in general, but the OP's situation is a bit different than most:
    Usually, the question is more about how to get started writing Cocoa apps. From everything I've heard about Java and Python, I think either one would be a great place to start for someone just looking to learn fundamental programming concepts in general and don't really have any aspirations to learn Cocoa.
     

Share This Page