Newbie to Programming seeks Advice

Discussion in 'Mac Programming' started by divinemercy, Jul 12, 2008.

  1. divinemercy macrumors regular

    Jul 12, 2008
    Greetings everyone!!

    A few years ago when i was in like 7th grade i started looking up computer programming, and started to play with javascript scripts on my grandpa's PC.... I really loved it and wanted to do it 'when i got older'... All i really did was little things like learning how to make pop-up boxes with messages and make scrolling text at the bottom of windows... little things like that. I quickly, though, stopped everything...

    ANYways... Now i am about to start college and i would like to start playing around with computer programming again. I was lucky enough to be introduced to macs two years ago thanks to my highschool which gave out free laptops to all of the students ^^ So now i have just purchased a macbook for myself and would like to start putting it to use programming little things like i mentioned above..... Also i would love being able to make some text-only adventure games.... maybe they're called interactive fiction? i dunno just those games that are like 'look at door.... the door before you is made of wood.. go north'


    I am completely new to everything and dont even know where to start looking for what i should start looking for to start learning about what to learn... if you see what i mean ^^

    So what language? What program to use on my mac? What things are even 'learnable' for a young guy at home lol? Im not looking to program the next operating system for apple, lol, i just want to have some fun and get some experience.... My friend told me that there was no point in trying to program on a mac, but that its only on a PC that much can be done... is that true?? surely not, macs can do everything im sure of it ^^

    Thanks in advance for your help everyone!

  2. numero macrumors regular

    Jul 23, 2002
    The text game you described is probably harder than you realize. First you will have to come up with a way to remember where all of the objects are (is the sword in the box in the hidden room or did player X pick it up). Then you will have to write the code to understand "look north", etc. Then you will have to come up with the plot of the game. Do you just go around and find things or do other things or people attack you along the way. There may be some game engine available to get you started on this. I don't know. Not my area of interest.

    OK. Enough discouraging (it really isn't my style, but I thought I would give you a little idea of the scope of the task). Now for the positive advice. You said you are going to college this year. Try to get into the entry-level computer science class. Look at the CS department's web site to find out which class this is. It isn't necessarily the lowest number class. At my school the first class that CS majors took was CS151. CS101 (and in that range) just taught things like using spread sheets and general computer usage. CS151 was the lowest class that would count towards a CS major. For me, it was taught in C, but the language really doesn't matter.

    I am suggesting this for two reasons.
    1) It will give you structured learning. It starts easy and gets progressively harder.
    2) It will give you (obtainable) projects to work on. Look at where you are at now. You want to find a project that can teach you something. You don't realize the complexity that can be in a simple game.

    If you can't officially get into that class (sometimes they restrict enrollment to CS students and other related majors) I'd just go and sit in on the lectures. Chances are it is in a large lecture hall with extra seats or it is in a room just large enough to hold all enrolled students, but some students will either drop or decide they don't need to come to class. Either way there will be available seating and the prof. won't know or care who is in the room. Then go to the class web site and get the reading assignments and programming projects. Stick to the schedule as if you were doing this for a grade and you should end up learning something. You may even decide you want to switch majors, or even double-major.

    As far as the PC being better. . . here's my response to that.

    I welcome further inquiries if you have any.
  3. divinemercy thread starter macrumors regular

    Jul 12, 2008
    Thanks for the replym and may i say nice use of song haha.... I gather that i can do just as well on a mac learning programing.

    As far as taking or attending classes.... I may eventually do so, but for now i am looking to teach myself if possible. So im looking for program/book/website suggestions and the like...

  4. lee1210 macrumors 68040


    Jan 10, 2005
    Dallas, TX
    Do you want to write an Interactive Fiction engine, or write an interactive fiction script and have a game be generated?

    If the latter, you can use a number of existing interactive fiction engines. One you might look at is Inform 7:

    If you want to program an engine you might want to start simple, giving a list of actions and objects instead of allowing the user to type freely. For this you need text I/O capabilities. The basics are part of any language you might start with, but I would recommend ncurses for building a nice looking text interface.

    If you just want to get something out there, you can just use HTML and javascript, perhaps with a little server-side programming to access the database of responses to actions. This might simplify your I/O, and you stated you already know HTML and javascript.

  5. numero macrumors regular

    Jul 23, 2002
    I did a little looking around and I agree with the introduction that is made in Lecture 1: Overview. I didn't listen to the rest, but I liked what I heard in the intro.

    If you decide to go this route then get the zipped files and then open the .wmv file in QuickTime Player. If it doesn't open then you need to get the Flip4Mac plugin for QuickTime.

    Good CS departments don't turn out Mac or Windows or Unix or .NET or Web 2.0 or (fill in the blank) programmers. They teach the building blocks. At some point you must practice these building blocks so you end up learning C or Java or something else during your studies.

    Think of it like trying to learn a spoken language. You might think that all you have to do is learn the meaning of the words, but think of the building blocks you take for granted. The building blocks are the concepts of nouns, verbs, adjectives, etc. Once you are aware of spoken language concepts you can learn English and say "the big dog" or learn Italian and say "il cane grande". The point here is that the noun and adjective are reversed between the two languages.

    Development tools on the Mac:
    Get Xcode from Apple. You can do C or Java programming with it. Since the link above is in C I'll explain how to start a C project. Select "New Project" from the File menu. Then select "Command Line Utility" and then "Standard Tool". This will give you a basic C project that should match most introductory lessons.
  6. divinemercy thread starter macrumors regular

    Jul 12, 2008
    Alrighty... Ive downloaded xCode...

    And the cocaolab's free book...

    So now i need to do what? Learn c? objective c?

    Is cocaolab's tutorial really the best?

    Also, i mentioned that the last time i tried programming it was with javascript, and i noticed that xCode can do java..... so how does java compare with C in its ease and potential usage?

    THANKS again

  7. lee1210 macrumors 68040


    Jan 10, 2005
    Dallas, TX
    You really need to choose what it is that you want to do. If you want to start programming, that's great. Do not expect to build an interactive fiction engine/game for minimum 6-12 months. If you have an idea and you want a game out of it, using an existing engine is the way to go.

    Starting your first serious foray into programming with xCode is not the way to go, in my opinion. I would start with a text editor, and learning to write some C and compile it, run it, and debug it from the terminal. I would go through some tutorials on to get you started.

    Java is iterative like C, but is completely object-oriented, garbage collected, runs on a VM, etc. so they are not very similar in style or usage. Don't be confused by the naming, Java and Javascript are not at all similar. It is likely that the only thing that will transfer from learning javascript is general programming syntax and flow.

    In all honestly I think at the very beginning C is easier than Java, because you don't need to know a ton of class library information for C like you do for Java. Eventually Java might be easier because you don't have to deal with memory management explicitly (you can still have leaks, but overflows are generally less likely). I think starting with C is easier, because you can get the basics without worrying about an object model, class methods vs. instance methods, inheritance, etc. right away. Once you're comfortable programming in C it will be easier to move to other languages.

    These are, of course, my opinions and there will be plenty of advice to the contrary.

    Good luck!

  8. divinemercy thread starter macrumors regular

    Jul 12, 2008
    just a quick update...

    after thinking about it and talking with some people i decided to go ahead with using xCode for now....

    In addition i should be recieving two books tomorrow:

    Hillegass' "Cocoa Programming for Mac OS X (3rd ed)"
    Kochan's "Objective-C Programming"

    Based on the reviews and everything, im pretty sure that i should be happy with these two books (although i wish that Kochan's O-C Prog 2.0 book was already out.....)

    Thanks for your help again, and ill be sure to keep you posted if i need any more advice ^^
  9. Darkroom Guest


    Dec 15, 2006
    Montréal, Canada
    i would suggest you start with kochan's book... i haven't started reading it yet but it claims no prior knowledge of C language is necessary, while i just finished reading hillegass's book and i found it very confusing in parts... i'll definitely be rereading hillegass's book again when i have a stronger grip on some common principals of objective-c.

    a seasoned programmer suggested these 2 books for me, as well as another book (which i just received today) called "Absolute Beginner's Guide To C" (1994) by Greg Perry... it may not be a necessary read, especially with kochan's book, but i'm sure there are some useful bits and pieces that have falling thru the cracks in objective-c...

Share This Page