andyl
Posts: 265
Joined: Tue Jan 10, 2012 11:05 am

Re: BASIC - more harmful than useful?

Tue Jan 24, 2012 5:31 pm

Wooloomooloo said:


libreuniverse said:


When you learn a free system, it's yours practically forever.


...aaaaand that's where you're wrong, right there. More like for 24 hours or a few days, weeks maybe.

Dunno, maybe other folks have it differently, but every single time I have to do the simplest thing in, say, Linux I have to look it up - and the next time, look it up again. And again. And again. Sure, if it would be something I'd be doing day in and day out, all day every day, it would stick - for a while. At some point in the past, I was involved in routinely manipulating stuff with awk - today, I have trouble remembering what exactly it does.

And it's the same with everything else - I can look it up and understand it just fine for the moment, but since it's casual stuff I won't use for a while I forget the details in a week, tops. And no, I'm not old enough to be senile yet, thank you. It's just the exact same thing me and my every single colleague did back at the university too - apart the ones who were flat cheating - "upload" in 72 hours tops, take exam, wipe thoroughly, lather, rinse, repeat.

I have to say, it kinda takes fun / motivation out learning anything casual at all - which is why I'm adamantly against _any_ user interface I can't look at and pick up more or less instantly (like, say, a CLI). I just can't afford to keep heavily investing time in learning lots of arcane, arbitrary and obscure stuff before using it (out of need), knowing full well that the "investment" is actually a throwaway, and the next thing I'm having a problem with I'll be doing it all over again, with something else.

Sorry for the rant, I guess it's not really on topic. Not really worth pursuing. It just pushed a button...

*puts on flame-retardant hat, walks away*


I think that is because you haven't internalised the language.  When you use a language (and a CLI is a bit like learning a language) in a concentrated enough burst you will remember it - and TBH you don't really need to know much to be effective using a *nix shell (maybe about a dozen commands at most). This is exactly the same kind of learning that people will be doing when they start programming.

Also your rant isn't really applicable as for Linux there are many good GUI solutions which are open source.

SohoStar
Posts: 2
Joined: Thu Jan 19, 2012 8:30 pm
Contact: Website

Re: BASIC - more harmful than useful?

Tue Jan 24, 2012 5:55 pm

Programming Language is a lot like downhill skiing. It depends what you learn on that flavors you forever. I haven't done Basic in years, even meeting and dealing with Drs Kurtz and Keminy at Dartmouth and developing a "Basic" Teaching System. The issue at that time was to find a vehicle that could be used to communicate a number of "foreign to Humans" problem analysis and automaton concepts. But one of the huge benefits to Basic is the implementation size, and interpreted nature.

So if the RaspberryPi is an educational tool, educational languages should be chosen that most closely resemble the thought process in applying processing capabilities to human problem solving. I'm not sure that Basic is that language.

These days, I wish I had started with Smalltalk. It would have cut out a huge amount of time, "wrapped around the axle".

User avatar
DavidS
Posts: 4334
Joined: Thu Dec 15, 2011 6:39 am
Location: USA
Contact: Website

Re: BASIC - more harmful than useful?

Tue Jan 24, 2012 6:22 pm

libreuniverse said:


When I was learning programming, I wanted to share everything. I"d never even heard of the Free Software movement, I only knew that BASIC source was everywhere, and that was a good thing. I really wanted to make a Free DOS system, which people later did. But although 16-bit programming and BASIC allowed you to get deep into the workings, 16-bit programming is often less friendly for novice-level tasks, and DOS isn"t helping. (Brown"s interrupt list could.)

I spent a lot of time finding ways to get around the memory limitations using files. Sadly, arrays were just too costly, so I had to implement those. None of that was easier than using a GNU/Linux system. Batch programming was fun, but not as much fun as Bash scripting. GNU/Linux is made for scripting. But more importantly:

"As people reach their teenage years, some of them are going to be fascinated by computers. They are going want to learn everything about what is going on inside that computer. They are going to want to learn how does this program work. If they are using non-free software, the teacher has to tell them, “Sorry, you can't learn that, I can"t learn that. It"s a secret. Nobody is allowed to learn that.” Non-free software prohibits education. But with free software, the teacher can say, “Go ahead. Here's the source code for this program. Read it. You can learn. And then, now that you have read the source code, try making a change, try making a small change in this program."

If you want to attack the friendliness of GNU/Linux, I can"t fight you on that. I know DOS feels easier to use, even if you hit a wall ten times faster. And it takes longer to "get" Bash, but when you learn a proprietary system, it"s really good while it"s supported. When you learn a free system, it's yours practically forever. Those DOS skills, not much use for them now. Bash/Bourne skills have been useful for decades before, and decades after DOS. And 32-bit programming, though it isolates you from the machine more, makes beginner tasks so much easier. I was never going to code support for extended/expanded memory, I really had to wait.

BASIC, incidentally, really could have taken a page from Python when it comes to libraries. I was bewildered by BASIC libraries, no matter how much extension they offered. In Python, for what it"s worth, you get the most BASIC way to do libraries that could possibly be useful. If I"d had that in BASIC I could have done much more, including with hardware. But if the libraries aren't free, you can"t share them, and programs that can"t be shared really hurt the spirit of BASIC, in my biased opinion. Like with early HTML, you could almost always "View source." Something to consider. But I think teaching dependence on proprietary vendors is impractical, and sells the student short. Other than that, nothing against RISC OS.


I would agree that Linux is much friendlier than DOS, with DOS you have to play with segments, do direct Hardware access and other things that require a significant knowledge of the machine. This is because DOS is a bit to simple, it does not abstract the Hardware enough.  I would note though that I did most of my DOS stuff in 32-Bit Flat Real Mode (as soon as I had a 386).  Also the limitations that you seem to have run into with BASIC seem to be the limits of DOS not the limits of BASIC.

I still maintain that Linux is much more complicated to program WELL for than many of the Open Source and Shared Source alternatives.

I will not try to convince you of BASIC, though I will include the quick example of using a library in BBC BASIC V (the BASIC Included in the Shared Source Risc OS):

LIBRARY "MyLibrary"

PROCMyLibProcedure(param0, Param1, parametc)
RPi = The best ARM based RISC OS computer around
More than 95% of posts made from RISC OS on RPi 1B/1B+ computers. Most of the rest from RISC OS on RPi 2B/3B/3B+ computers

kizzie33
Posts: 1
Joined: Tue Jan 24, 2012 11:15 pm

Re: BASIC - more harmful than useful?

Tue Jan 24, 2012 11:26 pm

I say go lower, go to Assembly. I'm 18 now, assembly was the first thing i learnt he i was 12. Now modern languages are good but without knowing the underling functionality, no ones really sure of what they are writing, and what it does. I'm in a class of 20, some started coding earlier and others later then me, but only I learnt assembly. And I'm the only one who really understand's whats happening in the code, and that helps me write it. I understand what a pointer is because i correctly understand how memory address work, and that variables use a double pointer method (not user if thats the correct name). The people around me only see, int/char, or even, god forbid, Dim (yes, vb is the standard) and at beast know that some of the RAM or swap is used to store it.

I say bring back Assembly!

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 23867
Joined: Sat Jul 30, 2011 7:41 pm

Re: BASIC - more harmful than useful?

Tue Jan 24, 2012 11:42 pm

kizzie33 said:


I say go lower, go to Assembly. I'm 18 now, assembly was the first thing i learnt he i was 12. Now modern languages are good but without knowing the underling functionality, no ones really sure of what they are writing, and what it does. I'm in a class of 20, some started coding earlier and others later then me, but only I learnt assembly. And I'm the only one who really understand's whats happening in the code, and that helps me write it. I understand what a pointer is because i correctly understand how memory address work, and that variables use a double pointer method (not user if thats the correct name). The people around me only see, int/char, or even, god forbid, Dim (yes, vb is the standard) and at beast know that some of the RAM or swap is used to store it.

I say bring back Assembly!


Assembly would put off more beginners than a high level language, which is a bad thing when you are trying to attract people in to the programming world in the first place. I have no objection to teaching it, but not for first principles. Especially Arm assembler, which isn't easy compared to the 8 bit stuff of earlier years.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I think it’s wrong that only one company makes the game Monopoly.” – Steven Wright

User avatar
DavidS
Posts: 4334
Joined: Thu Dec 15, 2011 6:39 am
Location: USA
Contact: Website

Re: BASIC - more harmful than useful?

Wed Jan 25, 2012 1:12 am

JamesH said:


kizzie33 said:


I say go lower, go to Assembly. I'm 18 now, assembly was the first thing i learnt he i was 12. Now modern languages are good but without knowing the underling functionality, no ones really sure of what they are writing, and what it does. I'm in a class of 20, some started coding earlier and others later then me, but only I learnt assembly. And I'm the only one who really understand's whats happening in the code, and that helps me write it. I understand what a pointer is because i correctly understand how memory address work, and that variables use a double pointer method (not user if thats the correct name). The people around me only see, int/char, or even, god forbid, Dim (yes, vb is the standard) and at beast know that some of the RAM or swap is used to store it.

I say bring back Assembly!


Assembly would put off more beginners than a high level language, which is a bad thing when you are trying to attract people in to the programming world in the first place. I have no objection to teaching it, but not for first principles. Especially Arm assembler, which isn't easy compared to the 8 bit stuff of earlier years.



I have to agree with kizzie33 on this one.  The ideal language for any beginner between 6 years and 12 years of age is assembly.  they are old enough to have the interest to learn the flow, and are still young enough not to have the per-conceptions that assembly must be difficult.  And ARM assembly is very much easier than 6502, 65816, 6809, 680x0, or x86 assembly.

For people under 6 years of age BASIC is ideal.
RPi = The best ARM based RISC OS computer around
More than 95% of posts made from RISC OS on RPi 1B/1B+ computers. Most of the rest from RISC OS on RPi 2B/3B/3B+ computers

libreuniverse
Posts: 15
Joined: Mon Jan 23, 2012 7:30 am

Re: BASIC - more harmful than useful?

Wed Jan 25, 2012 7:02 am

DavidS said:


Also the limitations that you seem to have run into with BASIC seem to be the limits of DOS not the limits of BASIC.



Partially, but only partially. The thing is, I am almost exclusively interested in languages that lend themselves to being taught. That doesn't mean they have to be "teaching languages" per se, it means I have to be able to teach them to beginners.

The only versions of BASIC I'm interested in teaching happen to be 16-bit. I've tried a slew of 32-bit and even 64-bit BASIC interpreters and compilers, I used BASIC for a quarter of a century and spent years looking for something (anything) newer, that felt (in all ways, if possible) like that fun, carefree, friendly experience.

Not that BASIC was always fun and carefree. When I was 9, I had some real stumpers "Why won't it work? I'll just have to keep trying to find it until it does…" with simple loops and juggled values in variables. (I don't recall if we can blame this on GOTO… I was doing pretty standard looping, not hellish My-First-RPG pseudo-branching.) Python could have helped, but some things still can't be matched for simplicity in BASIC. These "My language is higher than yours" types know nothing about what it's capable of.

Only modern BASIC retains almost none of the feel of classic BASIC. Even in this century, it was worth trying to push QBASIC (accept NO imitations, they're all cheap and forever half-complete, call them Zeno's BASIC) to its limits, but the fly-by-night we-can-do-anything-but-we-choose-to-make-the-wheels-square-because-C-is versions of BASIC all get it wrong because the authors (like many in this thread) don't quite grasp what made BASIC great for most people. They implement BASIC the way Sarah Palin implements the modern, professional woman: with minor, borrowed technical experience but not half a lick of sense.

You think they have sense? Imagine supporting inline assembly, JMP commands and all, and then seriously debating the merits of dropping GOTO. The mind reels. It's all about paying homage to once-great ideas, without ever knowing the meaning or purpose behind them. Dijkstra started a cult, and they come out in droves to save the unwashed coders from GOTO, even when everyone's given it up for DO… LOOP and WHILE… WEND, actual branching subroutines (Not good enough! Global variables are impure!) and even given up BASIC for other languages. It's not intellectual, it's idolatry. When Dijkstra comes back soon in the dark last days of the internet, I think he'll be smiting his followers before he turns his wrath on us. I've got my OO stake ready, we'll see who Breaks in 100 first.

It's possible to use QBASIC in an emulator, but it's not really possible to add to or share it. What's left of the QBASIC community doesn't even grasp the importance of a license that allows a future. In a the SOPA like world we already live in, they believe that they'll be able to share QB 1.1 forever, even though "abandonware" is an "I believe in fairies" kind of concept, especially when dealing with Microsoft, and worse, when they finally start to create a real alternative, they spend a year promising it will be in the Public Domain or GPL/BSD, then bait-and-switch to the same terms that prevent QB 1.1 from being run outside an emulator!

FreeBASIC is not the BASIC of the 21st century because it bait-and-switches friendliness. You can do HALF of what QB did, but if you want more you can always start doing BASIC the Dijkstra way: no such thing! That was the point of his Structured Inquisition, to DO AWAY with BASIC, not reform it, right? FreeBASIC reforms BASIC by doing away with it, and what you get is basi-C (or "Basically C.")

QB64 is not the BASIC of the 21st century because when they author wants to pull the plug, he can or will. Preserving decades of history: You're doing it wrong. I don't trust people who lie to their fans about licensing for a year anyway. "Hey, kid, you like BASIC? The first one's freeware."

So what is the BASIC of the 21st century? Python. I know, I basically dedicated years to finding it. What qualifies it? Compromise, and a LOT of details:

* Ubiquitous (already on more systems than QB64 or FB ever can/will be found on.)

* Interactive environment (base)

* Interactive environment (several 3rd party IDE's, some aimed at schoolchildren.)

* Easy handling of super-flexible data types (Duck Type is Typed, also)

* OO features that are neither mandatory nor bolted on as an afterthought (from C.)

* Easier (Beginner Friendly!) handling of libraries than BASIC offers (the only way you can achieve "all-purpose" in this century)

* Not just a teaching language, people actually use it to get things done

* Not just a BASIC syntax with a lot of planning ahead, great for prototyping

I don't know any modern BASIC that does this. It's not that it can't be done in 32 bit code, but no one has, and no one will.

I loved SCREEN 12 and SCREEN 0 in particular. Pygame doesn't make it easy without some boilerplate for "SCREEN 12." As said, a wrapper could fix that.

But I spent years white-knuckled with grit teeth over the remaining BASIC options. I wrote a cool text-mode wiki that no one gave a crap about. And then I finally found a modern BASIC. But it was named before anyone could think to put "BASIC" in the name. It's as close as another modern dialect, to get closer you have to go back to Microsoft or trust the new QB64 monopoly. Sorry, I don't have that kind of faith. After watching QB die for 10 years, it will take a lot more to see the same games clone it, just for it to die again.

But BASIC is not harmful. Hoping too hard for its revival is bad for your health, but using it and sharing it is not. And if loving BASIC is a crime, I'm happy to defile Dijkstra's footstool with it. I won't make you use Python but I will tell you it's my favorite BASIC dialect these days.

Try not to hold GNU/Linux up to the same "do as I say, not as I do" criteria the zealots hold BASIC to. BASIC wasn't perfect, neither is free software, but at least the handcuffs are optional. (Hey, that's what I liked about BASIC, too…)

paul stump
Posts: 1
Joined: Thu Jan 19, 2012 7:23 am

Re: BASIC - more harmful than useful?

Wed Jan 25, 2012 12:09 pm

Greetings!

I started back in the golden 80´s by playing with my friend´s Commodore 64. Then one evening he started to show some programming with Basic. It was easy to learn and it gave me the oppoturnity to get the basic way of thinking how proramming works.

Years passed, had some children. One day my son asked "what´s that?" pointing my Commodore 64.

I gave him the computer, disk station, cables and my old diskettes. And the manual. Explained some simple examples and how they work. He took the first steps, started walking and then running, two weeks after I gave him the C64, he had passed my skills.

Then QBasic... Java... Assembly... And now, two years later,  he is 11 years old, doing C++ and microcontrollers and electronics... I think he has found his way

There is no way I can think Basic harmful. It has not the same possibilities than other languages may have, but I think children will move on to another language when the time is right and if it is needed. Just to make the first steps easy basic is one solution.

(Looking forward to give my son his Raspberry Pi as a birthday present. Don´t tell him...)

User avatar
DavidS
Posts: 4334
Joined: Thu Dec 15, 2011 6:39 am
Location: USA
Contact: Website

Re: BASIC - more harmful than useful?

Wed Jan 25, 2012 4:56 pm

@libreuniverse:

As to QB, it is a very good implementation of BASIC (though limited by 16-bit segments).

You did say that you have not been able to find a modern BASIC that fully Captures the feel of QB; Have you tried QB64 in the last year?  QB64 is as close to identical to QB as can be for a purely compiled language.  It even has a run option.  The only things that are lacking from QB64 are; TRON, TROFF (and there menu equivalents), and the immediate mode.  QB64 has an IDE that is almost identical to QB including hiding SUBs accessed through the SUBs menu (under the view menu just like QB).
RPi = The best ARM based RISC OS computer around
More than 95% of posts made from RISC OS on RPi 1B/1B+ computers. Most of the rest from RISC OS on RPi 2B/3B/3B+ computers

libreuniverse
Posts: 15
Joined: Mon Jan 23, 2012 7:30 am

Re: BASIC - more harmful than useful?

Thu Jan 26, 2012 6:37 am

I have no interest in QB64. Like I said, the community spent years hoping that Microsoft would release the source code so that QBASIC could live, and after years of watching it get less and less useful, they insisted on making QB64 just as locked-in. If anything happens to Galeon, QB64 meets the same fate as the original: dying, unsalvageable, tied to one sort of OS (or emulation,) and pointlessly.

I don't do monopolies. I also don't trust people that say they're going to release something as free software for year, then change their mind. The community says it's no one's business but the developer's what license he uses. No one's business but his and those he lied to. I'm not going to rewrite/entrust all the BASIC programs I ever wrote to a language that could become obsolete overnight at the drop of Galleon's hat. No thanks, people that lie about their licensing are a liability to anyone that uses their works, I'd rather be stuck with Yabasic than rely on a perpetual insult.

User avatar
DavidS
Posts: 4334
Joined: Thu Dec 15, 2011 6:39 am
Location: USA
Contact: Website

Re: BASIC - more harmful than useful?

Thu Jan 26, 2012 7:55 am

I do agree with keeping away form monopolies.  I do thank you as I had not previously read the License for QB64, though it does appearthat you are correct about the possibility of QB64 leaving us if one decision is changed .  I had not previously noticed this, otherwise I would not have suggested it.  Maybe some one somewhere will eventually either modify one of the existing open source compilers and write a similar IDE or, write a new open source compiler from scratch.

Since I am currently researching this myself (with the goal of ARM, x86(16 and 32bit), 68K, 65816 target and host CPUs and as many Operating Systems as both host and target as possible), for the primary reason that once you add pointers and inline assembly I like QB style code much better than FreeBASIC, BBC BASIC, BCX, MoonRock, XBASIC, etc.

To the point; what keywords and operators would you see as important for an initial release of a usable BASIC compiler/interpreter (interpreter being important for debugging), and how much do you think it would be reasonable to leave out of, or otherwise modify the IDE?
RPi = The best ARM based RISC OS computer around
More than 95% of posts made from RISC OS on RPi 1B/1B+ computers. Most of the rest from RISC OS on RPi 2B/3B/3B+ computers

xenomech
Posts: 1
Joined: Thu Jan 26, 2012 8:45 am

Re: BASIC - more harmful than useful?

Thu Jan 26, 2012 7:59 pm

libreuniverse said:


Google, for example, was originally written in Java but it was too crashy so it got redone in Python. But I know I can find plenty of people to tell me Java is always better, because it is, using criteria that matter to them.


I agree with your overall point, but I felt compelled to tell you that this story isn't true at all. (I used to be an engineer at Google.) Google's web search was originally written (partially) in Python, not Java. It was eventually converted to C++. No part of it has ever been Java.

There are other Google products that use Java, but none were converted from Java to Python. (I can think of several that were converted from Python to Java, however.)

That said, your point is sound: different goals have different "best practices".

libreuniverse
Posts: 15
Joined: Mon Jan 23, 2012 7:30 am

Re: BASIC - more harmful than useful?

Fri Jan 27, 2012 12:05 am

DavidS said:


To the point; what keywords and operators would you see as important for an initial release of a usable BASIC compiler/interpreter (interpreter being important for debugging), and how much do you think it would be reasonable to leave out of, or otherwise modify the IDE?



That"s a tricky and extensive question, I can answer with a fairly comprehensive list of commands for non-graphics:ABS AND APPEND AS ASC BINARY CHR$
CLOSE CLS COLOR COMMAND$ COS CSRLIN DATE$
DIM DO ELSE END EOF ERR ERROR
EXIT FOR FREEFILE GET GOSUB GOTO IF
INPUT$ INSTR INT LCASE$ LEFT$ LEN LINE
INPUT LOC LOCATE LOF LOOP LTRIM$ MID$
MOD NEXT NOT OPEN OR PCOPY POS
PRINT PUT RANDOMIZE REDIM REM RESUME RETURN
RIGHT$ RND RTRIM$ SGN SHELL SIN SLEEP
SOUND SPACE$ SQR STEP STR$ STRING SYSTEM
TAN THEN TIME$ TIMER TO UCASE$ UNTIL
VAL VIEW WHILE WIDTH

That"s enough to do virtually everything I did with BASIC. A getmouse(x,y,c) routine is nice, too. I realize that doesn"t fully answer your question, but hopefully it starts to. That"s no list I quickly searched for online, it"s carefully processed out of the closest thing to a book I ever wrote, minus the graphics commands.

xenomech said:


I agree with your overall point, but I felt compelled to tell you that this story isn"t true at all. (I used to be an engineer at Google.) Google"s web search was originally written (partially) in Python, not Java. It was eventually converted to C++. No part of it has ever been Java.


Well, I won"t tell you that you"re wrong, only that I was just looking at "In the Plex," a book about Google that starts with the early days when the logo was done in GIMP and a server rack was built out of legos. I wasn"t actually there, so the book could be wrong. (It"s even possible I misread that part.) But you can"t deny it"s a fun story, and I appreciate that you didn"t miss the validity of the point.

User avatar
DavidS
Posts: 4334
Joined: Thu Dec 15, 2011 6:39 am
Location: USA
Contact: Website

Re: BASIC - more harmful than useful?

Fri Jan 27, 2012 6:40 am

libreuniverse said:


That"s a tricky and extensive question, I can answer with a fairly comprehensive list of commands for non-graphics:ABS AND APPEND AS ASC BINARY CHR$
CLOSE CLS COLOR COMMAND$ COS CSRLIN DATE$
DIM DO ELSE END EOF ERR ERROR
EXIT FOR FREEFILE GET GOSUB GOTO IF
INPUT$ INSTR INT LCASE$ LEFT$ LEN LINE
INPUT LOC LOCATE LOF LOOP LTRIM$ MID$
MOD NEXT NOT OPEN OR PCOPY POS
PRINT PUT RANDOMIZE REDIM REM RESUME RETURN
RIGHT$ RND RTRIM$ SGN SHELL SIN SLEEP
SOUND SPACE$ SQR STEP STR$ STRING SYSTEM
TAN THEN TIME$ TIMER TO UCASE$ UNTIL
VAL VIEW WHILE WIDTH

That"s enough to do virtually everything I did with BASIC. A getmouse(x,y,c) routine is nice, too. I realize that doesn"t fully answer your question, but hopefully it starts to. That"s no list I quickly searched for online, it"s carefully processed out of the closest thing to a book I ever wrote, minus the graphics commands.


I thank you for your input.  I would say that your list is well thought out, though giving it some thought I would add:

SUB, FUNCTION, BYVAL, STRING, BYTE, INTEGER, LONG, SINGLE, DOUBLE, PEEK, POKE, TYPE, XOR, SELECT, CASE, WEND (you did list WHILE), TO, COMMAND$, DEFINT, DEFLNG, DEFSNG

And a couple of compiler directives:

'$INCLUDE:

'$CHECKING:

As well as possibly a couple that did not exist in QB:

PTR, POKEW, PEEKW, POKEL, POKEL, CDECL

The PEEK and POKE variants being as a mnemonic for teaching POINTERS.

And for simplicity I would add the directives:

'$IFDEF:

'$IFNDEF:

'$ENDEF:

I would remove from your list:

GOTO, GOSUB

I see no reason not to use the same operators as QB.

I once again thank you for your input, of course these are all excluding graphics, mouse, file io, and sound, for which I would use the QB style keywords, excepting sound (the QB stuff would be there with extensions).

Thank you very much.  Your input is a great help in what should be complete before I release a Pre-Pre-Alpha version (the double pre is intentional) of my BASIC compiler.  Once i do get that far I fully intend to release it under the MIT license, or a very similar license.

Libuniverse:

Could I once again ask for your feedback on the modified list I provided here?

Anyone (that does not mind BASIC and is familiar with QB):

Could I ask for your feedback on the above listed keywords?
RPi = The best ARM based RISC OS computer around
More than 95% of posts made from RISC OS on RPi 1B/1B+ computers. Most of the rest from RISC OS on RPi 2B/3B/3B+ computers

User avatar
riffraff
Posts: 307
Joined: Tue Sep 27, 2011 3:17 am
Location: Newnan, Georgia, US

Re: BASIC - more harmful than useful?

Fri Jan 27, 2012 8:05 am

@libreuniverse

+1

All it takes is one academia nut in the barrel to spoil the whole bunch.

It's more productive to learn what you need as you go to achieve a specific goal.

We waste too much time trying to teach kids everything rather than showing them the ropes and how to pursue what knowledge they need themselves.

But you've gotta start with BASIC. That's not optional. The language is endemic. It's not a coders paradise, it's not he language you want students wallowing in, but it is everywhere.

When I was 19, algebra became simple when I was having to calculate screen positions in TRS-80 Color BASIC.

Trig became second nature for a while when I was writing a calendar program for the private academy where my sister-in-law taught. Moon phases and the day Easter falls are a fairly complex bit of math and several holidays are dependent on them. I found then that it was much easier to test all that math in Excel before committing it to code... oops BASIC syntax. You cant get away from it.

Chris.Rowland
Posts: 239
Joined: Thu Jan 12, 2012 5:45 pm

Re: BASIC - more harmful than useful?

Fri Jan 27, 2012 10:37 pm

My first language was Algol 60, then Fortran, ratfor, Basic, Assembler (Z80, 6402, DG Nova, 80186 some AMD DSP etc), C, VB, VB6, C++ (if there's no alternative) C# and WPF. There's also been some Pascal and Delphi.  That's in the course of being involved in software since 1967.  And I've a vague memory of writing a Forth compiler - in ZX81 Basic.

In a perfect world the first command I'd teach would be the comment:

REM Print a message continuously

...

Define what you are going to do and how

then do it.

That way, 10 years later, when someone has to maintain the code they don't have to spend a week working out why it's doing what it is.  I speak from experience here.

However...

The really important thing for kids is to get their interest.  If you can get them wanting to do things with computers that's the most important thing. Once they want to learn your problem will be keeping up.

That's when you can suggest that there may be a better way of doing the same thing than cutting and pasting code.

The reviled GOTO has the advantage that it does one thing  - an unconditional jump.  While is more complex because it does three things; it's a comparison then a jump or a loop.  For the first lesson using If and goto makes sense, then introduce while because it describes what you are actually doing.  Even if your dialect of Basic doesn't have while - and I don't know of a modern version that doesn't - you can introduce the concept and get them to describe it in comments.

Getting hung up in worrying about what language to teach is IMHO a mistake.  The important thing to get across are the concepts, they are language independent. But even more important is to find a way to generate the enthusiasm and need to learn.

Chris

pvgb
Posts: 51
Joined: Sat Oct 15, 2011 9:53 pm

Re: BASIC - more harmful than useful?

Sat Jan 28, 2012 1:12 pm

We are all so tied into what language to teach that we never seem to stop and think *how* to teach.

Traditionally we start with a few key words, practice with them, give a few more key words, practice, rinse and repeat.

Is this really the best way to do it ?

Suggestion : How about we teach testing/debugging first - get the idea of the structure across in a "not a blank piece of paper" way.

Suggestions ? Comments ? ( Could we do it in Basic even ? )

User avatar
Chromatix
Posts: 430
Joined: Mon Jan 02, 2012 7:00 pm
Location: Helsinki

Re: BASIC - more harmful than useful?

Sat Jan 28, 2012 5:58 pm

I would suggest interleaving teaching keywords and planning skills.  Planning is a crucial skill, but you can't plan if you don't know what you have to work with.  You don't need many keywords to come up with a real example that needs basic planning to solve efficiently - consider Pong.

You have three objects on screen - two bats and a ball.  What data do you need for each of these objects?  How do you control the bats - and is one of them handled by the computer rather than a player?  Where does the ball start?  What affects it's movement?  Should you draw the top and bottom walls which the ball will bounce off?  When does the round/game end, and how does this affect the main control loop?  How do you reward the winner?  How exactly do you draw and animate the bats and ball?

These are simple questions that are in themselves simple to answer, especially if you remember the real version of the game, but the need to ask them should be emphasised all the same.  Meanwhile, the game is so simple that a good coder would be able to manipulate a mockup to accommodate and demonstrate several possible answers to each question in realtime.  Also, when writing their own versions, students would not have to write a lot of code and would therefore find it easy to keep track of.

A similar process can be used to deal with successively more complex games, such as Snake and Breakout (considering that Arkanoid is basically Breakout on steroids), or with more practical problems which could tie in with lessons from other subjects.  Lots of Flash games (eg. http://k2xl.com/) are based on very simple concepts which should translate well to exercises to cement basic planning skills.
The key to knowledge is not to rely on people to teach you it.

hippy
Posts: 6068
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: BASIC - more harmful than useful?

Sat Jan 28, 2012 6:47 pm

DavidS said:

Anyone (that does not mind BASIC and is familiar with QB):
Could I ask for your feedback on the above listed keywords?


Not sure if in QB but INKEY$, HEX$ and BIN$ are useful to have around and also some DELAY or similar.

Doogle
Posts: 16
Joined: Sun Jan 29, 2012 5:55 am

Re: BASIC - more harmful than useful?

Sun Jan 29, 2012 7:04 am

On the subject of Basic Statements / Functions, my contribution:

ARRAY, PRESERVE, LBOUND, UBOUND, SPLIT, JOIN, FILTER (everyone loves Arrays)

Perhaps a Data Type of BOOLEAN should be included

I didn't see the LOG, ATN and FORMAT functions mentioned

Also (IMHO), it's useful having functions to cast variables from one type to another: CINT, CLNG, CSNG, CDBL, CSTR, CBOOL

If the HEX Function is to be included perhaps there should be the reverse ( e.g. &H'xxxxxxxx')

For file handling are RANDOM, ACCESS and SEEK required?

PRIVATE and PUBLIC for defining the scope of variables and the STATIC statement is also useful for preserving values in Subroutines / Functions between calls.

BTW and for what it's worth, I go along with the 'it's not harmful' opinion although, without wishing to go off topic, I'd like to see kids being taught Assembler as a starting point. Being able to manipulate data and instructions at the lowest level brings an understanding of what's actually going on inside the processor, an insight into how the Computer works and to some extent, the roll of the Operating System. (a bit like teaching Latin which gave students a good basic understanding of modern languages). 'Hello World' is not necessarily trivial in an Assembler.

Can't wait to get my hands on one of these devices !!

User avatar
DavidS
Posts: 4334
Joined: Thu Dec 15, 2011 6:39 am
Location: USA
Contact: Website

Re: BASIC - more harmful than useful?

Wed Feb 01, 2012 6:47 pm

Doogle said:


On the subject of Basic Statements / Functions, my contribution:

ARRAY, PRESERVE, LBOUND, UBOUND, SPLIT, JOIN, FILTER (everyone loves Arrays)

Perhaps a Data Type of BOOLEAN should be included

I didn't see the LOG, ATN and FORMAT functions mentioned

Also (IMHO), it's useful having functions to cast variables from one type to another: CINT, CLNG, CSNG, CDBL, CSTR, CBOOL

If the HEX Function is to be included perhaps there should be the reverse ( e.g. &H'xxxxxxxx')

For file handling are RANDOM, ACCESS and SEEK required?

PRIVATE and PUBIC for defining the scope of variables and the STATIC statement is also useful for preserving values in Subroutines / Functions between calls.



Ok I can definitely see the need for explicite type casting, I have never liked BOOLEAN/BOOL in BASIC as BASIC does not differientiat between logical and bitwize operators.

As to the array operators I think it would be better to stck with DIM, NEW, and FREE, it is difficult to do a good job at implementing dynamic arrays in a compiled language, and bounds checking is a convention that I have always believed should be the domain of the programmer, not the language (though simple bounds checking on an array/vector based on the initial declaration is quite doable, and the option [enabled by default, since this is BASIC] already exists in my compiler).

To the file ops yes these are needed, though I chose to explicitily not list the file operations above (they are library functions, that are an extension of the language), though there should be (at minimum):

OPEN#, CLOSE#, RANDOM, SEEK#, BINARY, READ [file spec],  WRITE [file spec], PRINT#, PUT#, KILL

And while talking about IO some KeyBoard:

INKEY$, GETKEY$,  INPUT

As well as some Graphics (at minimum):

SCREEN, GET, PUT, DRAW, LINE, PSET, CIRCLE, GCUR

As well as a bit of mouse:

MHIDE, MSHOW, MOUSEX, MOUSEY, MOUSEBTN, MSETCUR
RPi = The best ARM based RISC OS computer around
More than 95% of posts made from RISC OS on RPi 1B/1B+ computers. Most of the rest from RISC OS on RPi 2B/3B/3B+ computers

Ancient Brit
Posts: 3
Joined: Sun Mar 04, 2012 10:41 am

Re: BASIC - more harmful than useful?

Mon Mar 05, 2012 3:48 pm

The raw Raspi with Python looks like being a wonderful add on for computer buffs. However it is aimed at the 'young' education market presumably with a case and full instruction set.

Having bought a Beeb and followed the BBC computer literacy program as a complete computer newbie my suggestion would be that Raspi should have an old Beeb built into it. The old Beeb did it's job.  From the work involved Acorn became established and RiscOS and the ARM chip evolved. It was just overwhelmed by Apple and Microsoft in the world mass market. Note however the ARM chip dominates in fitness for purpose. Where would we be without it ?

An 84 year old computer hobbiest born out of that the 80's BBC initiative would love to see the Raspi take over where the old Beeb left off. Revive the memories of BeeBug and Acorn User, Programs produced in print for the novice to type in. Simple Basic coding to do wonderful things. one line programs what could be simpler ? Who knows one day this O.A.P could get the hang of Assembly and be become a coder among the 'Elite'.

panzerboy
Posts: 2
Joined: Sun Jan 22, 2012 2:55 am

Re: BASIC - more harmful than useful?

Thu Oct 18, 2012 9:23 pm

deechster wrote:...
Many companies continue to use the Pick Multi-valued database for its speed and flexibility. Part of that flexibility is the ease of development BASIC affords. Personally, I use an open version of Multi-valued database called OpenQM. I hope I will be able to run on the R-Pi. It is maintained by an UK company Ladybridge Systems. For more on Pick see http://en.wikipedia.org/wiki/P.....ing_system More on OpenQM see http://www.openqm.com.
...
OpenQM announced for the Rasberry Pi http://groups.google.com/forum/#!topic/ ... Qv7O-fSZ78
and
http://www.openqm.com/cgi/lbscgi.exe?T0 ... 3x3laww2hp
Considering we used to run R83 Pick on a 512Mb XT with a 10 MB drive a lean multivalue database should be a goof fit for the RasbPi

psutton
Posts: 172
Joined: Thu Jan 12, 2012 10:45 pm
Location: Devon
Contact: Website

Re: BASIC - more harmful than useful?

Sat Oct 20, 2012 10:20 am

deechster wrote:BASIC is still alive in many forms. I use it professionally everyday in the form of PICK BASIC. There are many other forms that have advanced considerably. BASIC was my first language back in the day. First on TRS-80 then on the Kaypro II. I did eventually move on to many other languages including Turbo Pascal, xBase (dBase III and its descendants) and in college they trained me as an IBM COBOL programmer. Luckily that didn't stick. My first real job out of college was at a Printing company implementing there first company wide software package written in Pick BASIC.

Many companies continue to use the Pick Multi-valued database for its speed and flexibility. Part of that flexibility is the ease of development BASIC affords. Personally, I use an open version of Multi-valued database called OpenQM. I hope I will be able to run on the R-Pi. It is maintained by an UK company Ladybridge Systems. For more on Pick see http://en.wikipedia.org/wiki/P.....ing_system More on OpenQM see http://www.openqm.com.

Anyways there advantages and disadvantages to every language. They are different tools used to solve different problems in multiple situations. Learning how to use one tool doesn't preclude you from learning how to use another.

I agree, I think one of the biggest skills you can have is to be able to choose the right too for the job, be it a programming language, or engineering tools or simple a chair, ladder it has to be suitable for what you are using it for. You need steel toe boots for on a building site, for example.

ladybridge
Posts: 1
Joined: Mon Oct 29, 2012 5:29 pm

Re: BASIC - more harmful than useful?

Mon Oct 29, 2012 5:35 pm

I have dived into this thread somewhat late in its life and unfortunately don't have the time to read all of the 450 previous postings in detail so apologies if some of this has been said before.

My perspective on this is with regard to the recently announced port of the OpenQM multivalue database package to the Raspberry Pi, specifically intended as a teaching aid but available to other users just as it is on other platforms.

Why do we use Basic as our development language?

The history of multivalue database products goes back a long way. Some view this as implying that it is antiquated technology that has no place in today's IT world. This is definitely not true. The better way to look at it is that it is a technology that has stood the test of time. Looking back at recent history outside the multivalue world, there have been several development languages that have been pushed as the latest and greatest way to develop only to fall by the wayside in just a few years.

The Basic language used by multivalue products is not the original Basic of the 1960's. Just like Visual Basic (which few people would say is "wrong"), multivalue Basic has moved on by removing aspects that are irrelevant (e.g. line numbering) and adding features that are related to the database processing role of the language. There have been several campaigns over the years to change the name of the language to get away from any erroneous implication that it is in any way a "toy" programming language but all of these have died.

The variant used by OpenQM, QMBasic, includes object oriented programming integrated into the language, however, OOP is not a panacea for all ills. It is instead something in the programmer's toolbox that has its place in solving certain problems but equally is cumbersome to use in some other situations.

QMBasic, like other variants of the multivalue Basic language, includes data manipulation statements that can do in a single line what may take dozens on lines in other langauges. One of the things that has ensured that this language has persisted is that development times are far shorter than alternative environments. A figure of as much as ten times faster has been quoted when viewed over the entire project life cycle. Partially as a result of this, multivalue products tend to be delivered on time and on budget. It is also worth emphasising that multivalue is not an obscure environment but is the basis of many major systems. Most of the world's banks use multivalue. It is widely used in healthcare systems, retail systems and many other industries.

Returning to our move to launch OpenQM into an educational environment, Basic was historically used as a teaching language because of its simplicity and, even with the advanced features of the multivalue world, this simplicity is retained. Actually, the choice of language should be unimportant. Teaching programming skills should be mostly about developing a logical approach to problem solving, not the implementation language. Any programmer worthy of the title should have no major issues learning a new language, transfering the same analytical skills forward.

The core OpenQM product is a character based "green screen" system with several approaches to provision of a GUI front end, most notably via web browsers. We have deliberately not put emphasis on these in the publicity of the Raspberry Pi release as we feel it is more important to concentrate on the database structures than development of the front end. It is likely that we will ultimately include one or more web interfaces in the Raspberry Pi package, possibly including interfaces from other languages that are available on this device.


Martin Phillips, Ladybridge Systems

Return to “Staffroom, classroom and projects”