Jump to content
geek504

Teaching BASIC

Recommended Posts

I agree that OOP is not the start you need to go and esp not if you want to understand hardware based programming. There are a lot of languages out there that are still not haveing OOP in them (hello Python). Yes you can do OOP programming, but in reality it does not separate the variables inside of an object form the outside world and you do not need any method to access or change them.

However I believe the basic construct of programming has nothing to do with Object Oriented and OO can be learned easily after you understood programming directly. 

It is very easy to write a text based output on any computer. Writing a Windows based output is getting you into nightmares of different layers and libraries to understand what you are dooing and that is confusing new learners a lot.

So I understand why OP want to have a simple language on a simple computer. It is just much easier to create your first programs on it than on a modern PC/Mac/Linux Desktop or any other device you can get your hands on.

Share this post


Link to post
Share on other sites
On 9/4/2020 at 2:13 AM, BruceMcF said:

IMHO, a good first "text" oriented programming language after Scratch is Logo.

I seriously thought about Logo too! I first learned BASIC on a TRS-80 and then when the school got brand new Apple ]['s they changed the class to Terrapin Logo. While pleasing to the eyes, it didn't do much else... I think today's kids can absorb Logo pretty fast and be bored in about a month or so...

Share this post


Link to post
Share on other sites
On 9/4/2020 at 8:28 PM, Doigt said:

I'm not saying BASIC is hard to learn or use. What I'm saying is that it has been outclassed; there are several other choices which are much better suited for new beginners and there are even technologies such as Scratch which have been created with kids in mind.

I teach Scratch, so that's where I am coming from. Like Matt said below:

On 8/27/2020 at 2:45 PM, MattGrandis said:

Not at all a waste of time. It's important to teach CONCEPTS, not languages. Learning BASIC is about teaching kids how stuff works.

BASIC is able to teach simple programming concepts like functions, loops, variables, etc. which can then be taken and applied to other languages.

I'm old school, so one of my goals is to (enventually) make my students comfortable with a text editor (Textedit or emacs) working on a terminal (DOS or bash) and not lean too much on an IDE, Debugger, or GUI. BASIC seemed like a good intermediate step between Scratch and Python. I do find C64 BASIC rudimentary but GW-BASIC (MS-DOS) is pretty advanced and modern.

My other goal is to present Computer Science as very affordable without the need for fancy expensive laptops/desktops. A simple Raspberry Pi (and the like) would be enough to attain a high level of programming competency, either with modern GNU tools or running older systems via emulator... that is, until X16 comes out in embedded SoC format!

Fun Fact: one of my students brought to class a Chromebook... 😵 Now that is a pickle... how do I tell the kid to go flash Debian Linux over that browser-only OS?!?

Edited by geek504

Share this post


Link to post
Share on other sites
On 9/5/2020 at 3:02 AM, DoubleA said:

That's a good thing (most of the time). It doesn't really matter if it's "object oriented" or "structural". Objects tend to become bloatware and structures need some discipline to maintain properly. And Java, excuse my french, is a pain in the ass: Bloated, slow, depends on a huge runtime (needs a paid licence for companies) and permanent patch-management ...

Java and C++ also has ugly boiler-plate code polluting the source (not to mention its weird syntax at times)... Microsoft fixed that with C#... that's a sweet elegant language!

Share this post


Link to post
Share on other sites
1 hour ago, SerErris said:

So I understand why OP want to have a simple language on a simple computer. It is just much easier to create your first programs on it than on a modern PC/Mac/Linux Desktop or any other device you can get your hands on.

Yes! Show me the code in these languages to plot a simple line across the screen and you'll see what I mean! (I guess Logo wins first place LOL!)

Kids want to draw lines and circles... not add libraries and access methods with many arguments from complicated objects (that is, after setting the entire window, handles, viewport, etc. etc. etc.)!

Share this post


Link to post
Share on other sites
4 minutes ago, geek504 said:

Microsoft fixed that with C#... that's a sweet elegant language!

Yes, but still has a bloated runtime which has to be patched regularly ...

Share this post


Link to post
Share on other sites
1 minute ago, DoubleA said:

Yes, but still has a bloated runtime which has to be patched regularly ...

Extraordinary claims require extraordinary proof. Like do you have actual credible sources or are you pulling this out of your ass because you don't like C#?

Share this post


Link to post
Share on other sites

I'm not sure if @DoubleA refers to the CLR or the .Net (or .Net Core) framework itself. The CLR itself is considered very stable in the industry and is extremely compact. But then - without the .Net framework is not of much use. But I personally never experienced the .Net Framework as bloated, especially since .Net Core.

  • Like 2

Share this post


Link to post
Share on other sites
47 minutes ago, AndyMt said:

I'm not sure if @DoubleA refers to the CLR or the .Net (or .Net Core) framework itself. The CLR itself is considered very stable in the industry and is extremely compact. But then - without the .Net framework is not of much use. But I personally never experienced the .Net Framework as bloated, especially since .Net Core.

You are right, CLR alone is not very useable. The current version of the C#/.net runtime can be downloaded here: https://download.visualstudio.microsoft.com/download/pr/5e4695fb-da51-4fa8-a090-07a64480888c/65aa842670d2280b5d05b8a070a9f495/windowsdesktop-runtime-3.1.7-win-x64.exe --> It's more than 50 MB! 

.net core SDK (you want to develop, don't you  :-)?) is more than 126 MB --> https://download.visualstudio.microsoft.com/download/pr/547f9f81-599a-4b58-9322-d1d158385df6/ebe3e02fd54c29487ac32409cb20d352/dotnet-sdk-3.1.401-win-x64.exe

That's the definition of bloatware!

You want even more proof Doigt? Just check your installed updates, you'll find loads of (almost monthly) .net patches. Which are huge, too. 

On the other hand: .net provides you with very much comfort and functionality. For that, you have to pay a price ... 

Edited by DoubleA
Error

Share this post


Link to post
Share on other sites

Oh noooooo the big bad microsoft uses more than 50 mb for their software development tools, call the bloatware police! Do you still live in the early 2000s? Look, I don't know much about windows. I don't like Microsoft too. However, I use a Linux distro as my main development OS and even I have had multiple security updates for many things within a single month. Are those "bloatware" now? I don't think you know what bloatware is. Bloatware is when it makes things slower, use more memory, more processing power, etc for no tradeoff. Also, that's a red herring anyways; how does that matter to kids in a teaching context? What is preventing anyone from not updating if it bothers them? Do you really need to regularly update to teach kids about the basics of programming? BASIC is very old, yet it doesn't matter when it's BASIC, but it matters when its C#?

Anyways, you'll just say anything modern is bloatware just to be contradictory. You said the same thing about Java. I'll give you that it was true (and still sort of is) to a certain extent for Java. However, you must know that what is true about Java is not necessarily true about C# or whatever other language you have a bone with. btw Java is much faster than you might think; it wouldn't still be used in IoT if it was that slow.

Edited by Doigt

Share this post


Link to post
Share on other sites

It doesn't matter at all what language it is. And i'm not a fanboy of Basic or C(#,++) or any other language.

But: This is a forum for a computer with a mighty 64 kB of Ram. So 50 MB is a little bit more than that, isn't it?

It's even more than the 640 kB we all know we'll ever need 🙂.

And another hint: Please check your task-manager for any .net appplication. You'll find they use more RAM than the typical app. Although Java apps play in their very own league ...

Share this post


Link to post
Share on other sites

For the IoT "example": Where did you learn that IoT needs to be fast (all the time)? 

BTW: Current hardware is easily fast enough for almost anything, no matter what language used. But of course there are always some exceptions :-).

Share this post


Link to post
Share on other sites

We're all passionate about the things we like (or don't) but always remember, no piece of technology is worth getting irritated over. Or getting others irritated. We're all here to enjoy the same hobby.

  • Like 3
  • Thanks 3

Share this post


Link to post
Share on other sites
4 hours ago, geek504 said:

Yes! Show me the code in these languages to plot a simple line across the screen and you'll see what I mean! (I guess Logo wins first place LOL!)

Kids want to draw lines and circles... not add libraries and access methods with many arguments from complicated objects (that is, after setting the entire window, handles, viewport, etc. etc. etc.)!

This more or less sums up my real reason for being here.  I want my kids to learn to code, and as stated previously, kids NEED graphics to get them interested.  Meanwhile, the reason modern languages need the layers of dependencies and libraries is because the operating system and hardware have gotten so complicated.  Placing a pixel on a screen isn't actually a thing that is allowed.  Instead, you need to use a graphics library in conjunction with a windowing toolkit that runs on your window system which calls the OS to communicate with the graphics hardware's pipeline to put that pixel on the screen.  It's really not the fault of modern languages; the computer is too complicated.

When teaching kids graphics on a modern computer, you have to just hand wave a mountain of boilerplate code and ask them to just trust you that it is needed.  You can't provide them with an explanation why it's needed because the explanation is simply too much for a beginner to take in.  I'm probably among some of the younger members of this forum (got my first computer in 1997, running Windows 3.1), and I dealt with a lot of this hand waving.  It was extremely frustrating, and I don't want my kids to deal with it.  I'd like to show them how to put a pixel on the screen, and when they ask how it works, I want to be able to explain it in less than a minute.  The Commander X16 will give me that, whereas a modern computers won't...no matter which language I use.

  • Like 2

Share this post


Link to post
Share on other sites
1 hour ago, Jestin said:

It's really not the fault of modern languages; the computer is too complicated.

This also brings up another good point... we become slaves to the hardware, i.e. closed systems, proprietary hardware or software, many layers of security (e.g. TPM chip), kernel space vs user space, memory write protection, and being at the mercy of the OS. While all these things were created with security in mind, it is against the hacking spirit (old-school definition of hacker, i.e. MIT hackers during the 70s-80s) much like what Steve Wozniak wanted in his dream computer (Apple I/II)... direct memory access, and direct video ram access, many expansion slots, crashing the computer with memory corruption, writing tight code with prodigious assembly language skills, etc. We want a simple hardware that is entirely open and at the mercy of the hacker! The computer is our playground to explore and create havoc! Good havoc!

And lastly... I would like to be able to fix my own computer when it blows a fuse or capacitor or what-not. I don't want to spend lots of money for a hardware and then the manufacturer will no longer fix "vintage" products. Just heat up my soldering iron and have a go!

Hmm... a not-so-important issue is that I also want my computer to survive an EMF blast or some apocalyptic event that will take us back to the stone-age... I want my car with its old fashioned carburator, and my 65C02 computer running when that day comes... maybe I am asking for too much!

Edited by geek504
  • Like 2

Share this post


Link to post
Share on other sites
9 hours ago, geek504 said:

I seriously thought about Logo too! I first learned BASIC on a TRS-80 and then when the school got brand new Apple ]['s they changed the class to Terrapin Logo. While pleasing to the eyes, it didn't do much else... I think today's kids can absorb Logo pretty fast and be bored in about a month or so...

The Turtles enable imagining what is going on in the program, but as long as it's a proper Logo, it's not limited to the Turtle graphics, it's a full featured programming language and can be used to teach a range of CS concepts. See Brian Harvey's Symbolic Computing page for a focus on natural language processing, at:
https://people.eecs.berkeley.edu/~bh/v1-toc2.html

Edited by BruceMcF
  • Like 1

Share this post


Link to post
Share on other sites
24 minutes ago, BruceMcF said:

The Turtles enable imagining what is going on in the program, but as long as it's a proper Logo, it's not limited to the Turtle graphics, it's a full featured programming language and can be used to teach a range of CS concepts. See Brian Harvey's Symbolic Computing page for a focus on natural language processing, at:
https://people.eecs.berkeley.edu/~bh/v1-toc2.html

Thanks Bruce for pointing out that Logo is also a proper programming language... I guess I never got to that part in grade school... BASIC was my defacto go to language at that time. Looking at the grammar style, it reminds me very much of my days using LISP to do some AI work in college... machine-learning using genetic algorithms. I remember that I did not enjoy LISP at all even though I dabbled with Clojure a few years ago. I will try showing the kids LOGO during one of my free presentation and see their reaction! At least its got graphics LOL!

  • Like 1

Share this post


Link to post
Share on other sites
1 hour ago, geek504 said:

Looking at the grammar style, it reminds me very much of my days using LISP to do some AI work in college... machine-learning using genetic algorithms....

That's because it's a dialect of Lisp ... in addition to the Turtle Graphics, it's got a more friendly syntax, without requiring parentheses for everything and with infix arithmetic instead of prefix.

Studying things that are fun is always a good approach to having people enjoy a language rather than having it leave a bad taste in their mouth.

Logo might be able to IMPLEMENT genetic algorithms for machine learning, ...
... but people are more likely to associate the unpleasantness with the problem of machine learning and not with the language they used on the problem, if they have first used Logo to write a simple text adventure game.

Share this post


Link to post
Share on other sites

Reviving an old thread here, but I'm rather newish to the site, so...

In any case, BASIC was my first programming language, used it on the C-64, Apple 2 series, a little gwbasic on DOS, then didn't touch it for a long time after I started using UNIX and other UNIX like OSes.

Then, one day, in the late 90s, I discovered 'yabasic'.  A cross-platform structured BASIC interpreter with simple graphics capabilities.  It is well documented, doesn't require any emulation, and being BASIC, is easy to work with. Don't need an IDE, any text editor will do.  No, I'm not going to write any serious applications in it, but it does allow you to do a lot of fun programming projects with it.  I've only used it on *nix systems, but on Windows, you just name your file with a .yab extension and it will execute with a double-click of the file's icon.

If you start to run into the limits of functionality or speed of yabasic, move on to FreeBASIC.

 

Edited by Michael Parson
fix the yabasic URL

Share this post


Link to post
Share on other sites
1 hour ago, TomXP411 said:

I don't know why your link didn't work, but some Google-Fu turns up this URL:

http://www.yabasic.de/

Also, X-11 BASIC is worth looking at

http://x11-basic.sourceforge.net/

 

Yeah, I made it an https link, he's not got any SSL/TLS on there, so, that didn't work, went back and fixed the earlier post.

I've played with X11 BASIC a little, didn't find it until years later when it popped up in the Android Play store.  Nice that you can write/test your code on Linux then copy it to your phone/tablet and run it there as well. 

There's also SmallBASIC, which I first used on the Palm Pilot many years ago, which also has an Android version.  With SmallBASIC, you can tie the IDE on your Linux system to the app on your Android device and send the files over the network, directly into the app.

For that classic line-numbered basic feel, there's Bywater BASIC and bas, and several others I've tried.

I keep coming back to yabasic though.

Share this post


Link to post
Share on other sites
On 8/27/2020 at 6:11 PM, geek504 said:

I teach a small group of children the programming language Scratch and ScratchJr. While it is easy, cute, and simple, I don't quite like it. I want to be able to teach the kids more about the computer architecture in general. The 6502 is a perfect choice for that IMHO. I can teach everything there is to know using an Apple ][, C64, or X16, but that means using BASIC.

Question: Should I teach C64 BASIC, X16 BASIC (similar but better "hardware"), or GW-BASIC (A very solid BASIC using the awesome PC-BASIC emulator)?

What are the pros and cons and what are your thoughts? Maybe even ditch BASIC altogether? Is it a waste of time to teach an "obsolete" language?

Using Microsoft BASIC in 2021 would be criminal.  GW Basic I don't know. BBC Basic is the best of the retro BASICs by a long way and keeps the immediacy but its screen editing on the BBC Micro is pretty non intuitive.  Ideally you want something which resembles a proper programming language, has screen editing facilities of some sort, has commands which are explicit about what they do for graphics elements  "CIRCLE" "SPRITE" and so on and still has the ability to be used interactively.

If at all possible you want to keep away from state machines and repaint type designs like Windows and so on.

 

Share this post


Link to post
Share on other sites
On 9/2/2020 at 4:20 AM, BruceMcF said:

DoNext: INX : INX : JMP (COLD,X) ; 13 cycles, including JMP NextOp at end of primitives.

... with updating the instruction pointer deferred until calling high level calls or executing branches.

 

Fine as long as you limit your words to 256 bytes (slightly less in practice). There's still a bottleneck because you've got one 8 bit stack, so there's a big hit on enter/exit.

Share this post


Link to post
Share on other sites
6 hours ago, desertfish said:

LOGO ?

No, horrible. Turtle Graphics in the right scenario is fine, but Logo is horrible. Looks like a LISP clone designed by an alcoholic.

  • Haha 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

Please review our Terms of Use