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

iSaint

macrumors 603
Original poster
I'm not a programmer, but I'm a Business Ed teacher that's been tossed into a BASIC programming class. So far I'm doing fine with the simple stuff. However, I want to show them some of the old role playing games we used to play in the 70s and 80s. I don't know how to describe it other than: you get options to move, you arrive at a door and it asks you what to do, you choose an option and it responds again, etc.

Does anyone have the code or a website where they can play through an emulator? They can't paste into the DOS based program they're learning on.

This is one site I've found. Interesting, but not all programs work.

http://www.calormen.com/applesoft/

Thanks!
iSaint
 
BASIC programming? DOS boxes? It's like you've been thrown back in time!

If you're using QBasic (included with DOS versions after 4.0 I believe), it includes a couple of simple games including a snake game and some monkey-tossing gorillas.

For even more points, show the class how to develop a (very simple) adventure game of their own.
 
BASIC!?!?!?!?!?

who the heck is teaching basic? what a worthless class. At least go with Pascal, even though thats 99% just as worthless.

If they really want to teach something that will be useful, they should just do a basic Java class. Java is something useful, and learning the basics of it is very easy.
 
BASIC!?!?!?!?!?

who the heck is teaching basic? what a worthless class. At least go with Pascal, even though thats 99% just as worthless.

If they really want to teach something that will be useful, they should just do a basic Java class. Java is something useful, and learning the basics of it is very easy.

I wondered if it was even usable. I guess it gives them a start.

Thanks for the replies. Some of the students started changing simple programs into games, so I'm going to have them work on something like that tomorrow. Also introduce them to some graphics building code.
 
There's nothing wrong with BASIC, if it's taught properly and assuming it's a beginner class who may have NO prior introduction to computer programming.

One might argue that in 2010, Python might be a better language to learn on, though.

If you have NEVER seen a single line of code before, what would be less intimidating, and what would you most likely figure out intuitively? Which do you think you'd be most likely to experiment with and not be afraid of compiler errors and syntax problems?

This?

Code:
PRINT "Hello, world!"

Or this?

Code:
class HelloWorld
{  
        public static void main(String args[])
        {
           System.out.println("Hello World!");
        }
}

(Or, worse, in today's world of windowing OSs...)

Code:
import javax.swing.JFrame;
import javax.swing.JLabel;

public class HelloWorldFrame extends JFrame {

	public static void main(String args[]) {
		new HelloWorldFrame();
	}
	HelloWorldFrame() {
		JLabel jlbHelloWorld = new JLabel("Hello World");
		add(jlbHelloWorld);
		this.setSize(100, 100);
		setVisible(true);
	}
}
 
There's nothing wrong with BASIC, if it's taught properly and assuming it's a beginner class who may have NO prior introduction to computer programming.

One might argue that in 2010, Python might be a better language to learn on, though.

If you have NEVER seen a single line of code before, what would be less intimidating, and what would you most likely figure out intuitively? Which do you think you'd be most likely to experiment with and not be afraid of compiler errors and syntax problems?

in a class with an instructor... Java is easy to explain and understand. Sure it might look funny to someone who has never seen code, but the instructor could actually explain what it means. Its not hard to explain "this is a class statement, these always go here like this and you can name it whatever you want..." etc... No in a basic level java class you do not have to explain why its called class, or why there are blocks or anything like that, just that's how it works... then get right to explaining stuff people need to know.

I won't even worry about your second example... theres no way GUI stuff should or would be taught in an intro level programming class.
 
There's nothing wrong with BASIC, if it's taught properly and assuming it's a beginner class who may have NO prior introduction to computer programming.

Dijkstra said: "It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration."

:)


But I don't agree. The problem with BASIC is that it just isn't sexy for the "hardcore dudes" nowadays, I'm referring to the l337 "Oh, you're so lame using BASIC, lolz!"-crowd.

But back in the day, BASIC was king. Most, if not all, microcomputers, came with a BASIC interpreter. Boot up your C64 or Amstrad 464 and write "AUTO 10" at the prompt, and you're going. I was 8 when I picked up my first type-in books at the local library, and within a few weeks (I didn't know english, even) I was able to construct my own small games because "IF t = 10 GOTO 940" was simple enough to understand. Though it made for nice spaghetti-code.

But that was a hobby setting. If you are going to teach a new programming langauge today, I think there's 3 different paths depending on the audience:

The Computer Science and physics major audience: Go for C. They're geeky enough to love the nitty-gritty details. Welcome to nerd-dom.

The "I want to program for a living" audience: Go for Java. It's still somewhat hot, and the people get to write OOP on their resume. Welcome to a life in cubicle paradise/hell.

The "I'm just dabbling around" audience: Go for the language that most rapidly get something "on the screen". It's far more satisfying to see "something I've made" than discuss "what's a class?", "what's a pointer?", "what IDE to use?". This points in the direction of some web-technology, I think, although I strongly oppose PHP to beginners. PHP is like BASIC, with the primary difference that the creators of BASIC actually used their brain when designing the language. Welcome to a life in either your own home, or a fancy start-up that wants you because you walked your own way.

A different perspective on the merits of BASIC: http://www.salon.com/technology/feature/2006/09/14/basic
 
in a class with an instructor... Java is easy to explain and understand. Sure it might look funny to someone who has never seen code, but the instructor could actually explain what it means. Its not hard to explain "this is a class statement, these always go here like this and you can name it whatever you want..." etc... No in a basic level java class you do not have to explain why its called class, or why there are blocks or anything like that, just that's how it works... then get right to explaining stuff people need to know.

I won't even worry about your second example... theres no way GUI stuff should or would be taught in an intro level programming class.

The GUI example was in jest. But I have mixed feelings about your first point. I do happen to be a programmer, I was exposed to BASIC on the Apple ][ when I was about 7 years old and I've since learned the full gamut of languages from Pascal and C/C++ to Java, Python, and most recently, Ada. So I'm one of those people that would "get it".

My sister, by comparison, is a non-programmer. She does not come from that kind of background at all. While I was always very "left-brained" -- analytical, loved logic problems, great at math and science -- my sister is the opposite -- struggles with math, but excels at art and other creative skills. She tried to take a high school class which involved a unit in programming, and she utterly hated it. She did not "get it" at all. I would try to explain concepts to her that seemed absolutely elementary to me, and she never did catch on. Granted, it was very likely because the instructor didn't teach it "properly". (But my feeling is that there are probably a LOT of bad instructors out there, and this certainly isn't going to help...)

So one could either do like you suggested, and just tell students "Don't worry about what this all means, just copy/paste the words 'class' and 'public static void main' and keep your code inside these squiggly things, and it will work." OK, but now it's a problem of rote memorization. "public static void main" now seems like a magic spell -- make sure you don't forget any one of those words, and it must be in the correct order! And was it "System.out.println" or "System.println.out"? A rote learner has a 50/50 chance of guessing that right. To get a proper understanding you'd have to explain what the keywords mean, and the class/package hierarchy (System is a package, out is a static object of class PrintStream, which is part of the package, println is an object method), which means you'd have to explain what a class is, and now your non-programmer student is glazing her eyes over.

BASIC (and to be clear, I mean QuickBASIC or some variant -- no line numbers, and no GOTOs!) can be useful for quick prototyping. As recently as 2003 (which, granted, isn't very recent) I remember using QuickBASIC to hammer out a simple AI algorithm that I read about in a textbook and wanted to take a crack at implementing. It wasn't really pretty, but I had it working very quickly.

In short: if you're teaching a class of extreme beginners, some of whom may not even like programming or have the mindset to "get" programming, a simple language like BASIC or Python will help them with small successes, sooner, and be a stepping stone toward a more complex language like Java or C.
 
Yeah, I'd classify today's BASIC in that league of "type in a command watch it go" languages. Python, again, being one modern day alternative.

The BASIC of yesteryear, with its line numbers, GOTOs and spaghetti code, is definitely out.
 
(Or, worse, in today's world of windowing OSs...)

Code:
import javax.swing.JFrame;
import javax.swing.JLabel;

public class HelloWorldFrame extends JFrame {

	public static void main(String args[]) {
		new HelloWorldFrame();
	}
	HelloWorldFrame() {
		JLabel jlbHelloWorld = new JLabel("Hello World");
		add(jlbHelloWorld);
		this.setSize(100, 100);
		setVisible(true);
	}
}
You neglected to do all the component realization on the event dispatch thread, typically using SwingUtilities.invokeLater(). See example:
http://lists.apple.com/archives/java-dev/2010/Sep/msg00121.html

For the record, I'm being facetious, but only just barely. The Hello World example is simple enough it will work without issues. More complex arrangements, however, I've definitely seen fail unless done on the event dispatch thread.

There are simplified frameworks for teaching Java, such as the ACM one:
http://jtf.acm.org/tutorial/tutorial.pdf
 
You neglected to do all the component realization on the event dispatch thread, typically using SwingUtilities.invokeLater().

Nice. Thanks for the correction. :) I actually copy/pasted that from a website example, because I haven't touched Java in a number of years. I actually do most of my programming in C++, for X/Motif. :eek:
 
I would like to say I started on Basic when I was 3 or 4 and it is a great kids beginners guide to programming. Yes it is missing loads of things but it is a good first step into learning about code without being dropped in the deep end.

Once you learn about programming you can then learn a real programming language but at least Basic gives you first look at the principles of programming without being to strict or requiring to learn lots of grammar before you even get something on a screen.

As someone pointed out with Hello World Basic is an easy simple getting started compared to C/C++/Cocoa or (shudders) Java.

Edwin
 
Go basic!

It's great for learning the concepts. Also if you'd like to get a little niftier, give em a brief into to machine language and basic compiler. Hehe yes and also have a look at the scenes that are still programming for the likes of the c64 and amstard ad similar (old) machines.

Just remember, make sure they have fun doing whatever it is your teaching them, otherwise that will be the last class they will take.

Cheers
 
I would like to say I started on Basic when I was 3 or 4 and it is a great kids beginners guide to programming. Yes it is missing loads of things but it is a good first step into learning about code without being dropped in the deep end.

Once you learn about programming you can then learn a real programming language but at least Basic gives you first look at the principles of programming without being to strict or requiring to learn lots of grammar before you even get something on a screen.

As someone pointed out with Hello World Basic is an easy simple getting started compared to C/C++/Cocoa or (shudders) Java.

Edwin
3 or 4 years old? I call BS on that one. I have yet to see a kid in Preschool or Kindergarten doing BASIC programming of any kind. Many kids are still in diapers when they turn 3. Come ON.
 
3 or 4 years old? I call BS on that one. I have yet to see a kid in Preschool or Kindergarten doing BASIC programming of any kind. Many kids are still in diapers when they turn 3. Come ON.

I kinda agree on that one. My younger son, who as it turns out is quite gifted academically, didn't start speaking until after he was 3!

I am teaching my kids, 12 and 8 to program in basic. The reason being, having never seen any of this before; it is hard for them to grasp how things run and what it takes. How do you explain what a variable is to someone who has no concept of how a computer does anything. I found several old basic languages you can download for free for windows and mac; and a few little games. I wrote a few short programs like asking for their name and ages and printing them to the screen. Just to give them the idea what can be done and how to use the computer.

I am carefully avoiding teaching them how to use GOTO, that's not very nice. But I don't expect them to learn TOO much with basic, just give them an exposure. Then I plan on moving them to Java or Pascal, onto VB, and eventually to C++ / C#. But that may take years.
 
OMG, you just made my day.

I remember playing adventure and getting into computers because of this game. I was looking for this a while go for nostalgia sake. :D

About a year or two ago I replayed Zork and Adventure from scratch (and memory). Loads of fun still. :D How many long hours I wasted on those games? Still feel they had the best graphics of any game. :D
 
3 or 4 years old? I call BS on that one. I have yet to see a kid in Preschool or Kindergarten doing BASIC programming of any kind. Many kids are still in diapers when they turn 3. Come ON.

I know I left Turkey when I was about 4.5 years old, and by the time I had left I had written a few basic programs. I think what you think of a program and what I judged to be a program at the age of 4 are most likely very different. :)

My first program was similar to this:

10 PRINT "Edwin"
20 GOTO 10

It was not saved to a file or anything just typed in with my mother helping if I got stuck, I then started to progress onto slightly more complicated ones which did things like

10 PRINT "Edwin"
20 PRINT "Mummy"
30 GOTO 10

They are not works of art or complex code but I remember doing them on the Apple ][ in Turkey. The fact I was home schooled at that time coupled with having a computer programmer as a mother meant I did a lot of my early learning with a computer and programs my mum bought or programmed.

Examples included 1 + 1 = ? and you had to type in the answer, the other one I still remember was the Yes/No questions with "Yellow Yes Key" and the "Red No Key" where the Y and N keys had Yellow and Red stickers on them. Being around computers since I can remember meant I was naturally curious and I do know I could type my name on the keyboard before I could write it legibly.

I don't claim to be any programming genius but writing basic programs like that (and this bit is crucial) with a parents help is within the scope of someone almost or just over 4 years old. As we were talking about teaching kids about programming I figured I would chime in with my earliest memories of Basic and having my name just loop round and round and round.

I was using (mostly being read) books a bit like the Usbourne book on this page (but it was different) I am sure I can dig out the exact book for you if I phone home and ask if we have it lying around still. I did not get onto loops or other more complex things for quite a few years but my initial dabbling with BASIC programming (with a lot of help) was when I was around 4.

Edwin
 
I know I left Turkey when I was about 4.5 years old, and by the time I had left I had written a few basic programs. I think what you think of a program and what I judged to be a program at the age of 4 are most likely very different. :)

My first program was similar to this:

10 PRINT "Edwin"
20 GOTO 10

It was not saved to a file or anything just typed in with my mother helping if I got stuck, I then started to progress onto slightly more complicated ones which did things like

10 PRINT "Edwin"
20 PRINT "Mummy"
30 GOTO 10
...

Edwin

That looks a lot like my first attempts at a similar age. Atari 800XL with a book of simple listings, help from parents and sister and lots of frustration at the error messages.

I'm not sure that Basic was a great place to start, but I'd like to add a big minus to the suggestion of Java - the switch to that in my university department almost killed off my programming career entirely... I wonder if learning some HTML, CSS and then a bit of PHP might not be a good introduction, these days.
 
That looks a lot like my first attempts at a similar age. Atari 800XL with a book of simple listings, help from parents and sister and lots of frustration at the error messages.

I'm not sure that Basic was a great place to start, but I'd like to add a big minus to the suggestion of Java - the switch to that in my university department almost killed off my programming career entirely... I wonder if learning some HTML, CSS and then a bit of PHP might not be a good introduction, these days.

I would say BASIC when you are young is great as long as you move on to something more powerful once you get the basics (pun intended) nailed down. What I like about BASIC is it is fairly user readable and you can get results fast.

I agree that moving on to HTML and CSS might be an idea after that I would say raw C++ creating command line programs is better like you I agree Java is not a good choice way to complex to do even the most simple thing.

Edwin
 
I'm not sure that Basic was a great place to start, but I'd like to add a big minus to the suggestion of Java - the switch to that in my university department almost killed off my programming career entirely... I wonder if learning some HTML, CSS and then a bit of PHP might not be a good introduction, these days.

PHP is in my view a big NO-NO for beginners. Have a look at the String functions: http://dk2.php.net/manual/en/ref.strings.php - it look like they was thought of and implemented by a bunch of eager nerds with no structure or plan at all. And most, if not all, of PHPs included functions have crazy naming like that.

I think for a language to be good for beginners, you'll need a language with some kind of nice and well-thoughtout structure, which make it easier for people to understand. Not a language quickly hacked together.

On the other hand, PHP makes it quite easy for beginner to "get something on the screen", and that might motivate them to become more interested in programming.

But for kids? I think PHP, HTML and CSS is way too advanced. "This is a web server, a client sends a request and yada yada...".
 
I think VB.net/Forms is a better intro to the basics of actual programing for crowds that loose their focus when presented your traditional Hello World and simple text I/O lessons. Java isn't quite as simple as VB.net and most of the actual implementation is hidden from the user. They're given clean button_click or text_changed event handlers to program and they don't even have to know what all of that means. They can spend their time learning concepts like variable assignment, boolean operators, math, etc and after their single semester ooh wow tour in VB they can learn an actual programing language like C, C++, C#, Java, etc. (oddly enough, for as much as I dislike VB, I program in it a lot)

One thing to remember is that most new students forget a huge amount of how to use a particular language after that first semester so switching between languages with similar concepts (i.e. not going from Smalltalk to Applescript) really won't pose as much of a problem as just getting someone to understand the concepts themselves.

My brother goes to RIT and they started him off with Python before moving on to Java and now C++. I think he'll be sticking with C++ for a while more before C# gets added.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.