Good way to get started in BASIC programing?

Discussion in 'Mac Programming' started by Luigi239, Jun 5, 2007.

  1. Luigi239 macrumors 6502a

    Joined:
    Jan 25, 2007
    #1
    Hello all, I am trying to start learning to program. I thought a good language to start with would be basic itself. So, I downloaded Chipmunk, but every example program I try to run with it (examples off the internet), there are always errors, or something wrong.

    So my question is what is a good way to start learning Basic on OS X? With which program, and possibly tutorials should I look at?

    Thanks :)
     
  2. kainjow Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #2
    Chipmunk basic is old, and not suited for modern programming.

    I would suggest learning AppleScript instead. You can use AppleScript Studio (in Xcode) to make full fledge Cocoa applications, but quite easily. Check it out.
     
  3. ham_man macrumors 68020

    ham_man

    Joined:
    Jan 21, 2005
    #3
    I learned BASIC out of sheer boredom during math class. TI-83s are a wonderful thing...:cool:
     
  4. mags631 Guest

    Joined:
    Mar 6, 2007
    #4

    Why BASIC? If you must, download a trial of REALbasic.
     
  5. Pedantic macrumors newbie

    Joined:
    Apr 2, 2007
    #5
    How to learn BASIC

    First of all, don't worry too overmuch about which version you use, provided you are certain it will work on your machine. BASIC is not really good for more than learning the basic principles of programming (hence its name). When you get ready to write serious code, that's when you will want to be particular about the language/version you select.

    To get started you might try just writing your own code. For example, dream up your own projects. Write a program that adds 2 + 2 and displays the answer. Then write a program that makes the user enter in two numbers, then it displays the sum. Then write a program that does the above but writes the sum to a file. Then write a program that does something more complicated to the numbers, such as sorting a list of them. Then write a program...and so on.

    Even for a language as rich and complex as C/C++, the traditional first program a C programmer learns to write is one that simply prints out to the screen the words, "Hello World!" so don't be afraid to take baby steps on your own.

    Finally, once you have even the smallest program written, when it has errors that you cannot fix, come back to the forum with the code and ask for help. There are a lot of helpful souls out here who would just love to give you some assistance.

    HTH!

    John
     
  6. dubhe macrumors 65816

    dubhe

    Joined:
    May 1, 2007
    Location:
    Norwich, UK
    #6
    Maybe someone can help me, I had a load of programs I use at work which were on a Casio FX-880P calculator. They were pretty simple, just for working out spherical trigonometry (which I use being a navigator at sea). However, I sold this calculator on eBay (for over £100 :) ) thinking I could just use Chipmunk to do the calculations, but I can not get it to work.

    Here is the beginning of one of my programs as an example:

    10 CLEAR :pRINT “Chart Assistant”
    20 INPUT “Lat A Deg”;Z
    30 INPUT “Lat A Min”,Y
    40 C=Z+(Y/60)
    50 W=((C-(0.1955717*(SIN(2*C))))/2)
    60 D=7915.704*(LOG(TAN(45+W)))
    70 E=Y+(Z*60)
    80 INPUT “N/S”,A$
    90 IF A$=”S” THEN D=D*-1:E=E*-1
    100 INPUT “Long A Deg”,Z

    etc, you get the idea, simple stuff and I can do it on a calculator, but this program makes it so much quicker.

    Any idea how I can modify the program to work in Chipmunk, or another program I can use? Or should I just buy a TI-85? (I sold the Casio as it was getting old and they are going for so much!)

    Thanks :D
     
  7. cube macrumors G5

    Joined:
    May 10, 2004
    #7
    BASIC is the language one learned with home computers in the 80s when having access to nothing else.

    Go here
     
  8. mags631 Guest

    Joined:
    Mar 6, 2007
    #8
    No you didn't.
     
  9. ChrisA macrumors G4

    Joined:
    Jan 5, 2006
    Location:
    Redondo Beach, California
    #9
    Funny to see "Good way to get started" and "BASIC" in the same sentance.

    Best to start with ANYTHING but that. Pick a language with features like blocks structure and scoping rules. Java, Python, Ruby, Even C++

    BTW I need to learn simple addition and subtraction. What is the best Roman math textbook. I'm getting my fingers tied up in knots doing even simple stuff like (LLXXIIV)/(XIV) BASIC is like roman numbers, so much easier when you use a modern system.

    In Roman time long divison was not taught until th university level. It was simply to hard for most people as they did not have the option to convert to Arabic numbers, do the work then convert back like we can, back then if the numbers could not be worked in your head it was a very, very hard problem. It was because the writing system did not closely match the concept it represented. You want a programming language that can express the concepts you want to learn.
     
  10. ham_man macrumors 68020

    ham_man

    Joined:
    Jan 21, 2005
    #10
    Your analogy is no good for this situation. You gotta crawl (BASIC) before you can walk (C) before you can run (Obj. C, Java, etc.)...
     
  11. iJed macrumors 6502

    Joined:
    Sep 4, 2001
    Location:
    West Sussex, UK
    #11
    Python

    Python is a great choice to learn to program in. It has relatively simple syntax and enforces indenting. It is a much better teaching language than any form of BASIC and is included with every Mac.
     
  12. Pedantic macrumors newbie

    Joined:
    Apr 2, 2007
    #12
    Answer the question!

    Hey guys and gals, Luigi asked a simple question: "can you help me with BASIC?" Instead of helping him/her with the proffered question, you plied the individual with unsolicited advice which may or may not evolve into a nice little flame war about which programming language should be used to learn programming. If you want to show off your prowess WRT computer issues, start your own thread. :mad:

    John
     
  13. Pedantic macrumors newbie

    Joined:
    Apr 2, 2007
    #13
    Its been a while since I actually programmed in BASIC, but I note that in line 20 the var is separated from the prompt by a semicolon, while the var is separated by a comma in line 30. You might want to check that out.


    It would also be helpful if you could tell us what errors the interpreter is reporting when you run this program.

    HTH!
    John
     
  14. dasein macrumors member

    Joined:
    Jun 7, 2007
    #14
    If you're serious about programming, stay away from BASIC....there's really not much use or future left in it. Consider a high level language. A good way to start learning both structures and syntax for free would be to write your own HTML code and inject some JavaScript into it. It's all free (there's no compiler or interpreter you need to purchase), and best of all, the syntax is derived from the C/C++/JAVA family, so you could make a later transition rather easily (XCode is a syntactical descendent of C as well). It's easy, fun, and you get immediate results running it through your own browser ... a great way to start learning. You can go online for some simple tutorials. If you already know HTML, go right to JavaScript (HTML is only a scripting language).
     
  15. bobber205 macrumors 68020

    bobber205

    Joined:
    Nov 15, 2005
    Location:
    Oregon
  16. MagicUK macrumors regular

    MagicUK

    Joined:
    May 12, 2007
    Location:
    Hampshire, England
    #16
    Do this.....do that....may favourite tool of the day is......blah blah blah

    Okay don't touch basic, there just isn't any point. If you really want to get into programming you need to start at the start, understand what a machine does get into 1's and 0's assembler and the like, then build upon that.

    If you understand what the machines are doing the language is just syntax and standards.
     

Share This Page