Which programming language do I start with?

Discussion in 'Mac Programming' started by dstearns96, Dec 16, 2007.

  1. dstearns96 macrumors member

    dstearns96

    Joined:
    Dec 16, 2007
    #1
    I have never programmed anything in my life. I just xcode and wanted to learn how to use it. which language should i start and how do I learn. I want to make applications for mac os x ppc and intel. I also want to develop windows applications. How long does it take to make a simple application. tell me anything else I might want to know.
     
  2. Monkaaay macrumors 6502

    Monkaaay

    Joined:
    Jun 19, 2006
    Location:
    Richmond, VA
    #2
    A lot of it depends on what your goal is. Do you want to create programs that have a GUI? Or, are you more interested in console programs? Another question is whether you're planning to do OS X development only or are you interested in Linux and Windows as well.

    I'll assume that you're going for GUI programs in OS X. You should start with Objective-C as a language working on console based programs. Once you're comfortable with the language itself, you can start learning the Cocoa framework for GUI development.
     
  3. dstearns96 thread starter macrumors member

    dstearns96

    Joined:
    Dec 16, 2007
    #3
    os

    i'm aiming for OSX (PPC and Intel) only. then later I might make copies of my applications for other OS's
     
  4. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #4
    Learn C. Straight, old, honest to goodness C. It underpins everything. Cocoa/Obj-C is a strict superset of C so if you want to be good with it you need C. C is portable across almost all OSes and makes it easy to learn almost any other procedural language and even offers insights into assembly.

    Everyone should know C.
     
  5. dstearns96 thread starter macrumors member

    dstearns96

    Joined:
    Dec 16, 2007
    #5
    how do I learn. trial and error, online research, or lessons
     
  6. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #6
    I'd suggest a good book and/or lessons. Without some sort of start you cannot learn by trial and error (although with a little knowledge this is a good strategy).

    The course text on my Uni courses on C (now many moons ago) was A Book On C. I found it easy to follow and very good, but then I could already program in Basic, and a little in Pascal.
     
  7. Catfish_Man macrumors 68030

    Catfish_Man

    Joined:
    Sep 13, 2001
    Location:
    Portland, OR
    #7
    Personally I'd say go for Python for a first language, C or ObjC for a second. C is certainly still very useful, but I think it's better to learn the important concepts before you focus in on the fine details.
     
  8. dstearns96 thread starter macrumors member

    dstearns96

    Joined:
    Dec 16, 2007
    #8
    Language

    you're all confusing me with the languages :confused: which do I start with. how long does it take to make a complete application
     
  9. Sun Baked macrumors G5

    Sun Baked

    Joined:
    May 19, 2002
    #9
    I know there were some online c primers and classroom type references that had a similar approach to a college course, cannot remember where any of it is anymore.
     
  10. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #10
    You cannot run until you can walk, and right now you are still working out how to grow legs. You cannot write an application until you know at least the basics of programming. If you want to write Mac OS based apps then you need to learn C then Objective C then the Cocoa framework. From there the time to write an application will depend on the complexity of the application. It might only take a few hours for a simple, rough and ready application. If you want something complex like Photoshop (or even Delicious Library which is the work of only a few people) it takes months to years of continuous work.
     
  11. dstearns96 thread starter macrumors member

    dstearns96

    Joined:
    Dec 16, 2007
    #11
    ok. I'll learn c first. what is the difference between the languages anyway?
     
  12. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #12
    Syntax, compiled vs interpreted, programer memory managed vs garbage collected...

    Then there are the bigger distinctions between classes of languages: procedural, functional and whatever Prolog is :p
     
  13. dstearns96 thread starter macrumors member

    dstearns96

    Joined:
    Dec 16, 2007
    #13
    ????????:confused:????????
     
  14. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #14
    As I said: you are still trying to work out how to grow legs. C is a useful start as most languages use a C-like syntax and most of the highly used languages are functional, which C is.
     
  15. Eric5h5 macrumors 68020

    Joined:
    Dec 9, 2004
    #15
    To be honest, you have a loooooong way to go. At this point I'd suggest taking a class.

    --Eric
     
  16. Cromulent macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #16
    There are plenty of books which are more than capable of teaching the beginners stuff for C.

    I would recommend the following:

    A Book on C
    Pointers on C (intermediate I would say)
    The Unix Programming Environment

    they are all highly respected books and have helped me a great deal with programming.
     
  17. dstearns96 thread starter macrumors member

    dstearns96

    Joined:
    Dec 16, 2007
    #17
    if you don't believe in god, then who pops up the next Kleenex in the box?:p
     
  18. Monkaaay macrumors 6502

    Monkaaay

    Joined:
    Jun 19, 2006
    Location:
    Richmond, VA
    #18
    I strongly disagree.

    Learning C can be more of a waste of time than a path towards a more productive programming language. If you're speaking purely of academics, sure, learning C is a good suggestion. If you want to learn programming to get a job or for more than learning the details of computer science, starting with C is a waste of time. Not to mention harmful once you decide to forget your procedural knowledge for object oriented. If you're trying to learn programming for more than computer science, chances are you'll graduate from C once you decide to become productive and create applications instead of programs.

    I'm not suggesting that C isn't used for being "productive". There are numerous examples otherwise; operating systems, compilers, database systems, etc. Notice the computer science background of each. When it comes to the business world, C puts you 20 years behind everyone else.

    So like I said before, if you want to stay on OS X with your programs, stick with Objective-C and then begin to the learn the OS X specific framework Cocoa. There is no need to concern yourself with C before stepping into Objective-C. As has been said already, Objective-C is C with additional features and functionality.
     
  19. kainjow Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #19
    Let's say you wanted to build a house. You're at the stage where you don't even know what a nail and hammer are used for yet, how do you think you'll be able to build your house in a week? Baby steps :)
     
  20. Tygernoot macrumors member

    Joined:
    Jul 3, 2003
    Location:
    London
    #20
    I wouldn't really recommend starting with C. I wouldn't recommend C at all actually, but directly learn C++.

    However, before you start with a language as big and difficult as C++, it would be wise to start with a much more simpler one. If you start right away with C++ you might give up or get totally lost. Like someone said earlier, start out with Python (or Scheme e.g.) and try to understand the basics: variables, assignment, comparison, functions, parameter passing, lists, recursion, ...

    Once you have a basic understanding of how a programming language works, you can take the step to C++ or Objective-C.

    In any case, buy a book to start learning. The tutorials online are useful when looking for something specific, but they don't teach you everything you need to know (in enough detail). Since you don't have any experience, start with a book for beginners. Then you can pass on to something more advanced.

    It takes a long time and a lot of patience before you can write big applications, so keep that in mind. Not to discourage you, but just so you know you won't be writing a full application within just a few weeks. Try to take it step by step and see if you enjoy it :).
     
  21. twoodcc macrumors P6

    twoodcc

    Joined:
    Feb 3, 2005
    Location:
    Right side of wrong
    #21
    i would advise to pick a language yourself, and not listen to everyone on here. different people will like different programming languages, and thus you can't listen to everyone.

    just google for tutorials on mac programs. pick a language, and then ask for help here.
     
  22. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #22
    I work for a very large financial institution writing custom internal applications: I know programming in the business world. I have worked with quite a few different programmers and the ones who are best are the ones with a good understanding of C. We don't ever write anything in C, but they have a more solid understanding of what the machine is doing so tend to write more efficient, better structured code than the people who have started with "more productive" languages.
     
  23. Monkaaay macrumors 6502

    Monkaaay

    Joined:
    Jun 19, 2006
    Location:
    Richmond, VA
    #23
    I didn't start with C and I'm not exactly on the lower end of the spectrum in programming talent. That may be your experience but it doesn't hold true for everyone. Which programming language you started with or have a solid understanding of means nothing when considering your ability. Any argument for that statement suffers from a lack of logic and common sense.

    What do efficiency and code structure have to do with understanding C? Last I checked, Java, C++, C#, and many others share the same code structure. I've always found that efficiency comes from an understanding of data structures and algorithms. My course in school went a long way towards teaching me the importance and eye for efficiency than learning C ever could. Understanding pointers is important towards a mastering of C but it means next to nothing in modern garbage collected languages like C# and Java.

    Threads like this cause problems for the original poster because instead of getting answers to the real question, they get opinions from what the responders wish they had done when they began programming. Sure, I wish I had learned C, but not because it would have made me better in any way. We need to understand what the original poster's needs are and then answer the question. Just saying "what language do I start with" isn't the whole question and answering it as asked will see nothing more than opinion. If he wanted to write scientific applications where performance is everything, C is a great suggestion. If he wants to write OS X applications like Adium, Cyberduck, Quicksilver, etc, C probably isn't the best suggestion.
     
  24. Les Kern macrumors 68040

    Les Kern

    Joined:
    Apr 26, 2002
    Location:
    Alabama
    #24
    Tygernoot is correct in my opinion.
    Guys, the guy never programed before, so you CAN'T say "Learn C or C++, that's what I use!". That's nutz, and a sure path to failure. It will be YEARS before any good comes of it. I was in the same boat long not too long ago, and what came to the rescue? RealBasic. EASY to learn, all the concepts are there, excellent tutorials, lots of samples, cross platform, and you are rewarded with a finished product much sooner, so it's good for the soul. Master the basics there and you have a good foundation for the future. There is also Revolution. But C? No way. You are condemning him to hell.
     
  25. GavinT macrumors member

    #25
    There is no right or wrong answer really, and a lot depends on the person.
    Me, started with BASIC on my Commodore Vic20 (and then on Amstrad CPC464, something us Brits used to be able to get). That was pretty much self taught from the manuals that came with the machines.

    Moved onto Pascal at school when I was 15-18. That taught me how to write proper procedural code (though, to be fair, I was doing a reasonably good job at writing psudo-procedures in BASIC).

    Pascal led on to Object Pascal/Delphi at university first year.
    C for my second university (plus a bit of Prolog). So, that's where I learnt about memory management.
    I decided to use Java (1.0 and 1.1) for my third year project.

    In the mean time, at work, done Java, C, Visual Basic and PL/SQL.

    The point is though... those latter work-place ones were relatively easy to learn, because I'd learnt about procedural languages, OO languages, memory management, bits of GUI stuff and basic good algorithms stuff.

    Could I be a better programmer if I'd done it some other way... who knows.


    My recommendations. Hmmm, I think there is an advantage to maybe starting in an Interpreted Language* rather than a Compiled one. Ruby would be a good start, because Ruby is well supported on OS X. Ruby is a better language than BASIC was when I started.
    If the original poster is willing to stick with it, then it's time to move onto something compiled*. So, then you are looking at Java or "C/Objective C". My gut feeling is, is that if you've got the gist of learning how to program, say based on experience with Ruby, then I don't think it would be that difficult to learn Objective C (and thus C at the same time).

    Of course, YMMV!

    * I've supplied Wikipedia links so that the original poster knows what is being talked about...
     

Share This Page