Tuesday, May 6, 2014

Write your first program


Way back in the the late '70s and early '80s, as PCs were becoming more popular as consumer devices, the programming language of the time was BASIC, which was an acronym for 'Beginner's All-Purpose Symbolic Instruction Code.' It's a cumbersome name, but it was the layman's first exposure to programming and to what it could do, and it was easier to understand than the Assembly code that was used by serious programmers, and it's even more understandable than the languages we have today such as C# (pronounced "C sharp") and Java.

It used line numbers in front of every line, usually incremented by 10, so  program might look like:

10 print "Hello World!";
20 GOTO 10

This program would print the phrase 'Hello World' over and over until you stopped it. If you needed to add a line between the two that comprise this program, you could preface it with any number between 11 and 19, but if you needed more than that you were in trouble.

BASIC programs could be very complex, as you can see here. In fact, one of the earliest graphics-capable adventure games ever created for the computer, back in 1979 and on an Apple IIe - while not looking like much - was created entirely in BASIC; it's still considered a programming triumph. Back then we'd never seen anything like it, and it shows the power of the language in capable hands. You can see it in all its glory below.


However, if you are interested, you can experiment with BASIC programming yourself at the Quite Basic website. I'll even give you a program to start with.

When you first visit the site, you'll see a program already typed in, and if you's like to see what it does you can hit the 'play' button right above the code window and it will draw some circles. Or, you can delete all the green code in the text window and type this instead:

10 input "What is your name?"; n
20 print "Well hello there, "; n; "!"

If you type this in the window, then hit the play button right above the window, you will be prompted for your name, and when you type it in it will respond with "Well hello there [you]!".

You can experiment with it, the site is rich with information and examples, you can even create and save projects if you're so inclined. The complex program I linked to earlier didn't work quite right due to some compatibility issues, but I'm working through it to see if I can get it up and running.

7 comments:

  1. I went into the site, it took me back to elementary school. Back then (1990's early) I was growing up in Peru. so the computer programs I was enjoying was DOS and for the love of myself I can't remeber the program we used that was similar to this. It was a little turtle in the middle of the computer and with commands we would make it draw circles, squares, rectangles, houses or anything (2D of course and in a black screen with just white lines from our codes), I even remeber given it codes for it to draw infinite circles while I watched in awe with all of my friends and then hoping we could save it into a floppy disk... Good times....

    ReplyDelete
    Replies
    1. That's LOGO you're thinking of. The language was developed as an educational tool to get kids interested in structured programming, but it was very acCessible due to its simplicity. There were even robots that could draw lines on paper using the language, and toys (like the Big Trak which you could program to drive around the house using a LOGO-like language) were based off those same concepts/.

      Delete
  2. This was a fun little trip down memory lane. I remember my first computer course in school and having to write little programs in BASIC. Things have come so far! I am sure these days you need an advanced degree to write any kind of computer code or maybe that is just my perspective. I too remember the turtle and of course DOS. I actually had a job in the late 90's where our whole system was DOS based, which was behind the times even then. It did get the job done though.

    ReplyDelete
  3. I remember it was a very big privlage to have computers back in my days. The screen was black and the writing was green. We had a typing game that would show you a letter and if you didn't hit the letter with your fingers on time then it would explode and you would have to start all over again. It was like a mining setting. I loved it, I felt so cool. Those were the good ol days, or maybe not.

    ReplyDelete
  4. I unfortunately do not remember this type of programming. But I have learned a little bit about programming. There is a website where you can learn how to code for free; it is called codeacademy.com. On this website it shows you all the basics first and then gradually you start to learn how to code games like solitaire, chess, and checkers. Let me tell you that the design is very sketchy because it is the basics. When you advance you learn how to design them with very nice graphics, I have stopped for awhile but it is very interesting to learn.

    ReplyDelete
  5. This is actually very interesting. Before I left the community college in California to come here I started taking a C++ programming class and it was a lot of fun for me. I found that I was quickly understanding the concepts behind it and it actually made sense to me. I am still very much interested in learning about this kind of stuff and am going to be using the summer to finish going through my textbook and getting a good foundation for it. There are also free online computer science classes offered by MIT, Stanford, Harvard, and many others. It shall be fun and keep me busy this summer.

    ReplyDelete
  6. I was interesting in learning how to create one but after seeing all those commands but like you said it becomes easy once you know how to do it. So I will try to create a program. I don't understand how they chat, send email, or play video games throught that.

    ReplyDelete