Where should a absolute beginner start to learn programming?

Discussion in 'Mac Programming' started by ravenvii, Mar 24, 2009.

  1. macrumors 604


    I'm thinking of going back to school for a CE/EE or CS degree.

    But before that, I'd like to get a strong foundation, so I'd have a easier time in school.

    I'd like to ultimately program apps for OS X and the iPhone.

    But I know zero about programming, other than XTML/CSS, which I taught myself.

    So which language should I start with to learn the fundamentals, and to write good code? And where should I get/find the materials to learn from?

    A thousand thanks in advance!
  2. macrumors 6502a

    Computer science? Learn mathematics.
  3. Moderator emeritus


  4. macrumors regular

  5. macrumors 603


    Ahaha. Nice, eatbacon!

    My first Apple ][ program was very similar, it printed "I CAN BEEP" and beeped. Constantly. My teachers very quickly told me to turn it off.

    I think Python is probably a good modern equivalent to the days of programming in Applesoft BASIC (or Microsoft QuickBasic, which is where I did a lot of futzing around when I was younger).

    If you want to get a head start on C programming (not C++; start with C for now), go to the library or bookstore or Amazon and look up books published by O'Reilly and Associates. The one I started with is "Practical C Programming" (the so-called purple cow book). It's old, but it teaches all the fundamentals including good style.

    Start with that, and/or Java and Python. What you'll find is that once you learn one programming language, it is not too difficult to learn another one. The concepts are all the same, even if the keywords and syntax are different.
  6. macrumors G4

    Hopefully a CS degree will teach you a LOT more than jus programming. It is kind of like learning to type so you can take a creative writing class

    When I was a CS major at UCLA they were on the "quarter" system and there were only three programming classes required for the degree. All the other classes assumed you could figure out or teach yourself to program or they dealt with non-programming CS topics like hardware design or finite mathematics, algorithms and so on. Later I was at another school and their CS program as based even more on theory and math. The idea was that a university should not teach the "technology of the day" but cover material of lasting value. That said some 4 year CS programs are nothing more then programming classes. Depends on the school.

    The best place to learn pure programming is a community collage or the book store. But the CS degree is useful if you want to do any kind of more complex stuff that might look more like engineering than coding.

    If you must pick a programming language to start with Java is not a bad one.

    HTML/CSS is not programming and has little to do with it. The reason is that HTML/CSS does not specify the flow of control. It is just static content. A program would have instructions for generating that content
  7. macrumors 6502a


    I'm in the process of teaching myself Cocoa programming (essentially from scratch). I'm a lifelong Mac user who studied logic/philosophy in college and always did well in math, but that's basically the only programming foundation I have.

    I started with Kochan's "Programming in Objective-C" which is a great place to get started. If you plan on writing Cocoa apps, you'll need to learn Objective-C, so you might as well start there. The book assumes no prior programming knowledge and is very well written.

    You might want to follow along through some of the tutorials on CocoaDevCentral just to get a feel for what Cocoa programming is like. It's not going to teach you everything there is to know, but it'll let you see if programming for OSX is something you enjoy.
  8. macrumors newbie


    Intro to C.S.

    Well I was fortunate enough to take some C.S. courses in High School before majoring in it in college (though with no college credit for it in High School :-/). So far the pattern I've seen is that they always start you off in an object-oriented language (most notably C++ and Java). Looking back, imho this was probably for the best as at the beginning level it lets you work with fundemental programming constructs without having to worry about memory allocation or pointer arithmetics (at least not seriously). As well, I'm told that even if you end up not going down the C.S. trail, in EE they use C++ so that's something to consider (though I would think they would use just C). In the intro to programming classes I've taken they always start you off with the fundementals:
    - Boolean operators
    - Variables and Types (such as int, char, double, float, string)
    - General Syntax (such as knowing where to put the comma, semi-colon, parenthesis and whatever else the lanaguage needs or understands)
    - The basic structure of a program (where to declare variables and headers/libraries, starting main() and returning something [usually zero for starters])
    - IF-ELSE statments
    - Loops (such as while, for, do-while)
    - Arrays
    - Structs/constructors/objects
    - Classes/Functions

    I think that's about it (it's been a while :-/) but if you can get a handle on those then you pretty much have the intro class down and it is the "formal" intro to programming (reads: it will help you in all aspects of programming). A book I would suggest as well is The C Progamming Language Know oftenly as "The C Book" or more locally "The C Bible". GorillaPaws suggestion of Programming in Objective-C is a good one as well. I personally used Coca With Objective-C back in the day. I'm sure with some slight modifications here and there the information in that book should be still very relevent. Well hopefully this helps some, good luck.
  9. macrumors newbie

    i'm a current Computer Engineering student, currently in my sophomore year, and so far all three of my programming classes have mainly dealt with C/C++. also just as important would probably be brushing up on your math/physics/chemistry skills because most colleges will require these types of courses for an engineering degree. One thing you might want to check out is a program called alice, it's used to introduce computer programing to non-CS major and could help you understand more in the beginning. Otherwise, i would take everyone's advice and dive straight into C or C++
  10. macrumors 604


    CE/EE are quite different from CS. Have you narrowed down which one you want?

    A lot of time the in-class foundation for programming is the best. But there are a few books already mentioned. C++ and Java should be the languages you start looking into. You also need to have a strong foundation and interest in mathematics.

    That requires learning Objective-C, which is not something you will use in CS or CE/EE. If you are serious about school, make Obj-C the 2nd language you learn after you build your foundation.

    Do you plan to also do OSX/iPhone programming for a living?

    Since those are not exactly programming languages, they won't help as much, but at least you are used to good structure and formatting.

    I think C++ or Java. Writing good code really depends on following the rules. Good code can also mean different things based on the end target. Efficient code might not be the most readable, vs. most reusable, etc.
  11. macrumors 6502a


    I'm having a hard time understanding why so many people are recommending languages like Java, C++, BASIC, Python etc. when the OP wants to program OSX and iPhone apps. It seems analogous to someone wanting to learn Japanese being told to learn Chinese first since it has a similar grammar which will help him with Japanese later. Why not take the direct approach and dive right in?

    I admit that I am still learning, have much less experience than most of you, and certainly no academic experience with computer science at the university level so there may be some things that I'm ignorant of here. As someone who's struggling through teaching himself Cocoa from scratch, I can say that it's very challenging but also doable (thus far at least) with enough hard work/effort.
  12. macrumors newbie

    I need some help with my mac.

    ok, so, my like desktop color for example is like greenish blue. but my computer is reaally messed up, and it turns the desktop color light blue, and the shadow behind the application like the color my desktop wassss. and all the icons in the dock are like super dark. ANNNDD hahh the windows are like white and the color is just like screwed up.

    so in general, my colors out of whack.

    do i need to get it replaced or fixed?

    i hope this is the right place to ask.
  13. macrumors 65816

    I've been researching this topic for a while. Here is what I've come up with.

    Go to www.Apress.com and get the following PDF books.

    Learn C on the Mac
    Learn Objective-C on the Mac

    If you like you can also pick up a nice book on learning to program on the iPhone.

    Then get the softcover book "Cocoa Programming for Mac OS X" by Aaron Hillegass.

    With these three books you'll have the best texts available to teach yourself how to program on a Mac. Clearly there are other things to read and study. These will give you a solid start on the topic.

    It would be good to hook up with some others learning the same subjects or find a teacher at a local community college you can talk to from time to time. It's always nice to have a buddy when tackling a subject like this.

    I'll second much of the discussion above. Learning to write the code itself is like learning the basics of grammar. Next you need to learn to express yourself. Here is where the study of algorithms and math and physics comes in.
  14. macrumors 604


    Because the OP wants to build a foundation for a CE/EE or CS degree. It helps to use one of the languages that they will most likely use.
  15. macrumors 65816


    Ah, but does he want to go to school to LEARN programming? He probably figures since he knows nothing now it will be harder to succeed in school because they assume he will have prior experience and knowledge. Once he finishes he could then jump to the iPhone.

    That's what I got from reading his post... I could be wrong though.

    Maybe he could directly just teach himself and learn how to do it that way and skip school + fees altogether!
  16. macrumors 604


    OP, why do you want to go to school again? We are getting confused on what your plans are.
  17. macrumors 6502


    I'd learn C and objective C on the Mac. I started with a "C for dummies" book a couple years back, and I really have learned a lot since.
  18. macrumors 6502

    Apparently you don't know anything about Chinese and Japanese.

    Sorry, had to.:rolleyes:
  19. macrumors 604


    Forget the other thread in community discussion, and forget what I said about CE/EE/CS/WTFBBQ.

    I want to start developing kickass iPhone apps and make a fortune on the App Store. I know zilch about programming. Where do I start?

    Thanks for the advice above - I'll check out the eBooks and of course the Hill-guy book.

    I saw in another thread www.cprogramming.com is that a good tutorial to get started with too?
  20. macrumors 604


    That changes all the responses so far ;)

    Get a the Objective-C books mentioned, download XCode and play around.

    Good luck!
  21. macrumors 603


  22. macrumors 6502

    I have great respect for people who know this art...

    Good Luck on your desire to learn
  23. macrumors 65816


    Haha, I'm in the same boat... I'm not sure why I thought of the idea to learn this earlier..... it all intimidated me I guess. Once I saw how (relatively) simple iPhone applications CAN be compared to OS X applications.... I looked into it more and realized it should be within my grasp if I try hard and work at it.

    I have no prior experience with programming other than HTML and basics like if and else statements, variables, loops, etc, etc... so I have read SO many different websites and documentation on Objective-C and Cocoa Touch.

    Programming still does intimidate me though... I try to think of ways to exercise the code I learn but never come up with good examples....

    I bought the book Beginning iPhone Development: Exploring the iPhone SDK and it is really well written and I find it very useful. I also thought the Programming in Objective-C 2.0 looked really good as well so I will try to pick that up when it's in stock at my local bookstore.

    Apple's documentation looked scary to me at first, so I'd stay away from that and pick up a good entry level book.

    Also "Becoming an Xcoder" or whatever that online pdf book is helped a lot too! That's where I started, I suggest you read all of it (as it will get you familiar with both XCode and Interface Builder) for Mac OS X applications.... and then when you move onto the iPhone you'll see how much simpler it seems and feels. Did for me anyways.

    Just my 2 cents.
  24. macrumors 6502


    Cannot agree more. I set myself the goal of going from C ---> Obj C ---> Cocoa and took the route suggested by Cromulent. I think you don't **have** to do it this way, but you if you do, it will pay off.
  25. macrumors 6502a


    I know it sounds kinda newb (which I am), but after you have a small foundation in some C language, I suggest that you buy "Cocoa Programming for Dummies". The new edition just came out and gives a wonderful intro into using the full power of the Xcode tools and Objective-C language. I found it helpful, hope it helps you.

Share This Page