Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Luigi239

macrumors 6502a
Original poster
Jan 25, 2007
529
0
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 :)
 

kainjow

Moderator emeritus
Jun 15, 2000
7,958
7
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.
 

ham_man

macrumors 68020
Jan 21, 2005
2,265
0
I learned BASIC out of sheer boredom during math class. TI-83s are a wonderful thing...:cool:
 

mags631

Guest
Mar 6, 2007
622
0
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 :)


Why BASIC? If you must, download a trial of REALbasic.
 

Pedantic

macrumors newbie
Apr 2, 2007
5
0
How to learn BASIC

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 :)

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
 

dubhe

macrumors 65816
May 1, 2007
1,304
10
Norwich, UK
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
 

cube

Suspended
May 10, 2004
17,011
4,973
BASIC is the language one learned with home computers in the 80s when having access to nothing else.

Go here
 

ChrisA

macrumors G5
Jan 5, 2006
12,907
2,156
Redondo Beach, California
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.
 

ham_man

macrumors 68020
Jan 21, 2005
2,265
0
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.
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.)...
 

iJed

macrumors 6502
Sep 4, 2001
264
10
West Sussex, UK
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.
 

Pedantic

macrumors newbie
Apr 2, 2007
5
0
Answer the question!

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.)...

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
 

Pedantic

macrumors newbie
Apr 2, 2007
5
0
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

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
 

dasein

macrumors member
Jun 7, 2007
30
0
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).
 

MagicUK

macrumors regular
May 12, 2007
130
0
Hampshire, England
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.