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

Re: BASIC - more harmful than useful?

Thu Jan 24, 2013 2:52 pm

DavidS wrote:@ruwin:
Sorry about the delay, I have been working on the USB in RISC OS, and got myself distracted. I will try to get my responce posted later today (it is 06:09 am here).

Yes I accept the library in the second example becaus simular library functions are used in the BASIC version. I do not know how long it has been since you looked at the BASIC standards, though I have the hard copy of the BASIC standard (old one [1984 printing]) and any input, output, and the standard Math and String lib functions, etc are considered to be Library functions in BASIC.

I recommend the examples from the WIMP tutorial becouse except for those that use File IO most of them do not use any library functions (not even PRINT which is defined as a library function in the BASIC standard), though call the OS directly.
You are referring to a 'standard' BASIC from the 80's? Really? Why? Surely things have improved since then?

Is there even a recent BASIC standard? The last one Wikipedia reference is from 1994...

Python of course, doesn't have an 'official' standard but is, to all intents and purposes, standard over all the platforms that it runs on (notwithstanding differences between Python 3 and earlier versions)
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I own the world’s worst thesaurus. Not only is it awful, it’s awful."

User avatar
abishur
Posts: 4477
Joined: Thu Jul 28, 2011 4:10 am
Location: USA
Contact: Website

Re: BASIC - more harmful than useful?

Thu Jan 24, 2013 3:15 pm

ooo three moderator posts in a row, sorry, it just sometimes happens that we all find a subject we want to throw our two cents/pence into :-P

I've said it before on this thread, and I'm sure I'll say it again the next time this gets revived.

There is no such thing as a programming language which absolutely should not be taught. Even the most outdated programming language can be used to teach an individual good programming techniques. Indeed, starting them off on something older, might actually go a ways into preventing the rampant program creep that has because the de facto standard in programming with the advent of smart phones and windows vista (okay, okay it was going on before vista, but I feel like that's when it jumped up exponentially).

Now as for java hiding stuff behind standard class types and the turning off of kids to programming as a result. Java was one of the first languages I picked up and I certainly wasn't turned off by it. More importantly, Java was originally the only programming language you could use on the android OS, and remains one of the top languages yet it has not hampered kids learning it to write apps. To be certain some kids might have been turned off by it, but some kids are going to be turned off for any language you choose. So respectfully the argument that "[if you try to teach] a young kid a language that hides so much behind "Standard" class types, and you will turn them off to programming" has hard evidence that this isn't the case.
Dear forum: Play nice ;-)

User avatar
redhawk
Posts: 3465
Joined: Sun Mar 04, 2012 2:13 pm
Location: ::1

Re: BASIC - more harmful than useful?

Thu Jan 24, 2013 4:06 pm

There is no such thing as a programming language which absolutely should not be taught.
I beg to differ Prolog is definitely one of the most demented programming languages I've ever encountered and should be avoided unless you're bored or exceptionally clever.

Richard S.

User avatar
abishur
Posts: 4477
Joined: Thu Jul 28, 2011 4:10 am
Location: USA
Contact: Website

Re: BASIC - more harmful than useful?

Thu Jan 24, 2013 4:07 pm

redhawk wrote:
There is no such thing as a programming language which absolutely should not be taught.
I beg to differ Prolog is definitely one of the most demented programming languages I've ever encountered and should be avoided unless you're bored or exceptionally clever.

Richard S.
ha ha, I think that bored and clever would describe most kids but I get your point ;-)
Dear forum: Play nice ;-)

User avatar
rurwin
Forum Moderator
Forum Moderator
Posts: 4258
Joined: Mon Jan 09, 2012 3:16 pm
Contact: Website

Re: BASIC - more harmful than useful?

Thu Jan 24, 2013 4:14 pm

I have heard from a non-computing friend that did a post-graduate degree that included Prolog, that the people who had never been exposed to programming before found Prolog very easy. The people who knew how to program in some other language found it very difficult.

I must admit that when we were taught it (in about one lecture,) I didn't understand a word of it. Thank goodness there wasn't a lab exercise on it.

PaulCheffus
Posts: 381
Joined: Tue May 29, 2012 2:51 pm
Location: Lincolnshire UK

Re: BASIC - more harmful than useful?

Thu Jan 24, 2013 4:38 pm

rurwin wrote:I have heard from a non-computing friend that did a post-graduate degree that included Prolog, that the people who had never been exposed to programming before found Prolog very easy. The people who knew how to program in some other language found it very difficult.

I must admit that when we were taught it (in about one lecture,) I didn't understand a word of it. Thank goodness there wasn't a lab exercise on it.
Hi

Gofer is very similar in that respect. I had to write a program in it to compress an image as part of my degree.

Other students who had never programmed before grasped the concept a lot quicker than me but I got there in the end.

Cheers

Paul
Procrastination - The Thief of Time.

User avatar
danpeirce
Posts: 100
Joined: Thu May 10, 2012 8:32 am
Location: Richmond & Surrey BC Canada
Contact: Website

Re: BASIC - more harmful than useful?

Thu Jan 24, 2013 4:52 pm

DavidS wrote:@danpeirce:

I am aware of the general university level oposition to BASIC, this was even the case when I first began my CS studies at university (beginning at Baylor in fall 1990). And while I will never accept a degree (despite many universities attempting to talk me into it) I continue my studies (as CS is still an evolvng feild), unfortunately this aditude has become worse with time (except in UCBerkley where they are bginning to see structured BASIC).

Yes it is needed to teach the Professors the skill before they can teach it. Though as we do begin to get this into Primary Schools the universities will also need to reevaluate there views, and question what programming language you teach a very young child. For now it is up to the parents/gardians to teach there children these skills.
Beyond a doubt universities continually review and evaluate. It is a big collaborative effort. That hardly means they will come to the same conclusions as you have.

-rst-
Posts: 1316
Joined: Thu Nov 01, 2012 12:12 pm
Location: Dublin, Ireland

Re: BASIC - more harmful than useful?

Thu Jan 24, 2013 4:54 pm

Prolog seemed to be a perfect choice for a bus time-table planning system back in the day ...at least for the logic parts of it. Having learned some basics of Prolog in the uni, in my first real job (student intern) I was put to debug such a system. The 'character based windowing system' on top of MS-DOS was definitely not that suitable in Prolog - let me introduce you, tadaa: Turbo Prolog :shock:

More on the topic: Just today I once again had to help a junior colleague to debug an issue in Java (JSP) code - once again it reinforced my opinion, that some low-level structured programming would do you good in helping to understand why your high-level standard-library-ready-made ADTs fail to work for you :roll:

In my circles, the 'basic rots your brain' started circulating around the introduction of Visual Basic - the ultimate tool to write spaghetti code, hiding bits of code here and there behind the UI elements (yes, you could see the code as a 'full' listing if you realised). Easy to draft up a prototype, but hard to get the proper full system finalised.
http://raspberrycompote.blogspot.com/ - Low-level graphics and 'Coding Gold Dust'

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

Re: BASIC - more harmful than useful?

Thu Jan 24, 2013 5:07 pm

rurwin wrote:I have heard from a non-computing friend that did a post-graduate degree that included Prolog, that the people who had never been exposed to programming before found Prolog very easy. The people who knew how to program in some other language found it very difficult.

I must admit that when we were taught it (in about one lecture,) I didn't understand a word of it. Thank goodness there wasn't a lab exercise on it.
I probably agree. The only way I could understand Prolog was to try and figure out what it was doing under the skin in a procedural way. Not the right way to do it!
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I own the world’s worst thesaurus. Not only is it awful, it’s awful."

User avatar
danpeirce
Posts: 100
Joined: Thu May 10, 2012 8:32 am
Location: Richmond & Surrey BC Canada
Contact: Website

Re: BASIC - more harmful than useful?

Thu Jan 24, 2013 5:26 pm

DavidS wrote:Its has been years since I had given Python a serious look. And if it considers types that require large classes to manipulate to be intrinsic I will never give it another look, this makes it at least as bad as JAVA. Try teaching a young kid a language that hides so much behind "Standard" class types, and you will turn them off to programming, good luck you are going to need it with the kids that you teach.
While others have already commented on this post it appears to me that in here is the root of why you think Python is difficult for young people and not acceptable to yourself. I think the premise here is false. The concepts of introducing new user defined classes is not a topic for any beginner before they have grasped the more basic concepts. Python can be used without introducing new classes.
Python variables are all objects. This is not necessarily going to be problematic for a raw beginner but does require an adjustment in thinking for someone who has some experience in BASIC, C or Pascal.

Ravenous
Posts: 1956
Joined: Fri Feb 24, 2012 1:01 pm
Location: UK

Re: BASIC - more harmful than useful?

Thu Jan 24, 2013 5:52 pm

Oh my gentle jeesus I just realised this thread has been going since December 2011 !

And we still haven't decided if BASIC is considered harmful :lol:

Ask n programmers how to get beginners started and you will get n^2 answers.

tufty
Posts: 1456
Joined: Sun Sep 11, 2011 2:32 pm

Re: BASIC - more harmful than useful?

Thu Jan 24, 2013 8:51 pm

Ravenous wrote:Ask n programmers how to get beginners started and you will get n^2 answers.
In O(n!) time at best

gritz
Posts: 449
Joined: Sat Jan 28, 2012 2:33 am

Re: BASIC - more harmful than useful?

Thu Jan 24, 2013 9:43 pm

:lol: The sensible conclusion would be that asking programmers is a_bad_idea.

techpaul
Posts: 1512
Joined: Sat Jul 14, 2012 6:40 pm
Location: Reading, UK
Contact: Website

Re: BASIC - more harmful than useful?

Thu Jan 24, 2013 9:51 pm

danpeirce wrote:
DavidS wrote:Its has been years since I had given Python a serious look. And if it considers types that require large classes to manipulate to be intrinsic I will never give it another look, this makes it at least as bad as JAVA. Try teaching a young kid a language that hides so much behind "Standard" class types, and you will turn them off to programming, good luck you are going to need it with the kids that you teach.
While others have already commented on this post it appears to me that in here is the root of why you think Python is difficult for young people and not acceptable to yourself. I think the premise here is false. The concepts of introducing new user defined classes is not a topic for any beginner before they have grasped the more basic concepts. Python can be used without introducing new classes.
Python variables are all objects. This is not necessarily going to be problematic for a raw beginner but does require an adjustment in thinking for someone who has some experience in BASIC, C or Pascal.
I am aware of how they teach Python (and other languages) at GCSE and A level Computing at schools and the early levels does not touch classes, you look at variables being numbers, strings, list, tuples... Once you get the basics of assignments, comparisons and loop control type constructs then they get into classes later.

Visual Basic eventually got dropped as acceptable a few years ago, they are trying to get rid of Pascal. No longer use Python2 and just use Python3.

Other languages are also used
Just another techie on the net - For GPIO boards see http:///www.facebook.com/pcservicesreading
or http://www.pcserviceselectronics.co.uk/pi/

pygmy_giant
Posts: 1562
Joined: Sun Mar 04, 2012 12:49 am

Re: BASIC - more harmful than useful?

Thu Jan 24, 2013 9:59 pm

Hands up anyone who started programming using BASIC (meeeee...!)

Did it do us any harm?

techpaul
Posts: 1512
Joined: Sat Jul 14, 2012 6:40 pm
Location: Reading, UK
Contact: Website

Re: BASIC - more harmful than useful?

Thu Jan 24, 2013 10:20 pm

pygmy_giant wrote:Hands up anyone who started programming using BASIC (meeeee...!)

Did it do us any harm?
In those days there was not much easily available, so comparing good and bad then was not possible as there was less choice at that level of system. Also quite a lot of commercial stuff was written in Basic at that time.

These days BASIC even VB is raraley seen accept as legacy maintenance.

There are more choices these days and a lot of languages are C like and similar and have ability to progess to OOP/classes using the same language to do practicals.

Also all those languages are relevant to higfher levels of education and work
Just another techie on the net - For GPIO boards see http:///www.facebook.com/pcservicesreading
or http://www.pcserviceselectronics.co.uk/pi/

User avatar
rurwin
Forum Moderator
Forum Moderator
Posts: 4258
Joined: Mon Jan 09, 2012 3:16 pm
Contact: Website

Re: BASIC - more harmful than useful?

Thu Jan 24, 2013 10:46 pm

pybmy_giant wrote:Did it do us any harm?
I'd give a cautious "yes" to that. At the time I was learning BASIC nobody knew any different, but then modularisation, structured programming and information hiding became required methodologies. We had to learn them, and it was not as easy as it might have been had we learned to program like that from the start. There are still too many global variables in a great many programs; there are still too many cases where the implementation details of modules are intrinsic to the way they are used. Then came event-driven programming, Document-View and object orientation, which required a quantum shift in the way the programmer even thought about an implementation.

Re-implementing those BASIC programs took me back to my BBC Micro days, but not in a good way. I found myself looking at a line of code like

Code: Select all

MODE 27
and thinking, "why is that not a named constant or even a string? Is the programmer supposed to remember the extents and bit-depth of thirty-odd modes?" I looked at code with REPEAT loops closed with UNTIL FALSE in an IF statement, and UNTIL TRUE elsewhere, and wondered how that distorts a student's understanding of structured programming. Yes it is the equivalent of BREAK and CONTINUE, but there is a conceptual difference. I looked at this

Code: Select all

SYS "Wimp_Initialise",200,&4B534154,"MyApp"
and wondered how anyone could think that was a reasonable thing to put in a new-user tutorial. It was that tone more than anything else that horrified me about the tutorial as a whole; it assumed the whole mindset as it was in the 1980's when we did not know any better -- spaghetti code, magic numbers, obscure "clever" techniques, the whole works -- and yet it was published in 2009. The author's approach to programming was literally stuck 30 years in the past.

I have no strong feelings about using BASIC to teach programming, so long as it is done in a modern manner and teaches techniques that are not counter-productive. It is possible to use modern techniques in any language -- I've used OOP techniques in FORTH, which did not even have structures, let alone objects built-in -- and it is trivial to write good, modern, maintainable BASIC code that will teach students to produce code the way they will be required to in industry. But if those tutorials are indicative of the way BASIC will be taught then it will damage the students' education and I am against it.

techpaul
Posts: 1512
Joined: Sat Jul 14, 2012 6:40 pm
Location: Reading, UK
Contact: Website

Re: BASIC - more harmful than useful?

Thu Jan 24, 2013 11:08 pm

pygmy_giant wrote:Hands up anyone who started programming using BASIC (meeeee...!)

Did it do us any harm?
Well it does my head in when I have to look at the few customers still using variants of BASIC to understand why systems dont work and their bad coding habits, let alone one case of copy and paste, bit manipulation of 32 bit value by converting to a string and doing MID() of the string for EACH bit. There were 5 different patterns as functions done with a copy and paste then edit, not even a general function.
Just another techie on the net - For GPIO boards see http:///www.facebook.com/pcservicesreading
or http://www.pcserviceselectronics.co.uk/pi/

User avatar
redhawk
Posts: 3465
Joined: Sun Mar 04, 2012 2:13 pm
Location: ::1

Re: BASIC - more harmful than useful?

Thu Jan 24, 2013 11:36 pm

pygmy_giant wrote:Hands up anyone who started programming using BASIC (meeeee...!)

Did it do us any harm?
I think most people who started computers in the 80s began with BASIC because that was standard at the time with home computers.
I started coding using a Commodore 64 (Microsoft BASIC) my first program I wrote played a different musical note with the keyboard.
It's logic consisted mostly of reading keys and GOTO statements, I'm sure most programmers would retch at the though of GOTO only looping. :lol:
Then I later moved into 6510 assembly coding (MOS6502) which was quite interesting since you realise just how limited the processor was, it also inspires you to learn dirty tricks to get the job don.

Does BASIC harm programming skills?? - not really it's a good tool for teaching beginner's the concept of programming and logic but as a language for doing serious stuff it's lame.

Most of my programming is in PASCAL with embedded 80x86 assembly code, I can code is C as well but it's not my favourite language.
As for Intel 32 bit protected mode assembly coding erm I think I'll pass :)

Richard S.

pygmy_giant
Posts: 1562
Joined: Sun Mar 04, 2012 12:49 am

Re: BASIC - more harmful than useful?

Fri Jan 25, 2013 12:46 am

A lot of the complaints in this thread are that BASIC is er, basic.

Well - duh.

"BASIC - more harmful than useful?" - No.

"BASIC - the best programming language ever?" - No - its er, basic.

Despite that alot of its features are echoed in other languages - many skills learned from using BASIC are transferrable.

The fact that so much blather on this website is devoted to slagging it off shows how significant it is and how much of a debt alot of us owe to it for giving us a springboard into other languages.
Last edited by pygmy_giant on Fri Jan 25, 2013 1:09 am, edited 1 time in total.

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 25, 2013 1:05 am

rurwin wrote:Here's a combination of two: The "one-line" multi-tasking app and opening a basic window.

Code: Select all

import Tkinter

def noise(widget):
	widget.bell()
	widget.after(1000, noise, widget)

root = Tkinter.Tk()
root.title('Demo')
root.after(1000, noise, root)
root.mainloop()
I am reminded of Doctor Johnson. He was once walking with a friend in a part of London where the houses overhung the narrow street, when they observed a couple of women leaning out of the upstairs windows of opposite houses, throwing insults and kitchen implements at each other. "They will never agree," observed the good doctor, "as they are arguing from different premises."

I see the code on the Opening Windows chapter and am horrified at the thought of teaching kids the bit-mangling and pointer maths necessary to get a simple window on the screen. Whereas you see me using a standard, universally accessible library to render it down to the above code as hiding stuff they need to know. And to be honest, that's an argument I am never going to win because there is no screen handling at all in the Linux kernel, much less windows handling. At it's root, putting a window on the screen is done by Xlib, it's still a library, it's still in user-space, and nobody ever uses it because it is too low level.
That is not equilivelent it uses Tk, you can do that from BBC BASIC also, that is a library, BASIC does it with direct system calls.
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
DavidS
Posts: 4334
Joined: Thu Dec 15, 2011 6:39 am
Location: USA
Contact: Website

Re: BASIC - more harmful than useful?

Fri Jan 25, 2013 1:13 am

Ravenous wrote:Oh my gentle jeesus I just realised this thread has been going since December 2011 !

And we still haven't decided if BASIC is considered harmful :lol:

Ask n programmers how to get beginners started and you will get n^2 answers.
Yes this does seem to be the trouble :-)
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
DavidS
Posts: 4334
Joined: Thu Dec 15, 2011 6:39 am
Location: USA
Contact: Website

Re: BASIC - more harmful than useful?

Fri Jan 25, 2013 1:17 am

danpeirce wrote:
DavidS wrote:Its has been years since I had given Python a serious look. And if it considers types that require large classes to manipulate to be intrinsic I will never give it another look, this makes it at least as bad as JAVA. Try teaching a young kid a language that hides so much behind "Standard" class types, and you will turn them off to programming, good luck you are going to need it with the kids that you teach.
While others have already commented on this post it appears to me that in here is the root of why you think Python is difficult for young people and not acceptable to yourself. I think the premise here is false. The concepts of introducing new user defined classes is not a topic for any beginner before they have grasped the more basic concepts. Python can be used without introducing new classes.
Python variables are all objects. This is not necessarily going to be problematic for a raw beginner but does require an adjustment in thinking for someone who has some experience in BASIC, C or Pascal.
It is not about introducing implementation of classes that I speak. I whas speaking of giving the example that does a lot of hidde stuff that a young child would imediately devide is doing a lot that is not shown (in this case by the class implementations that are standard to the language) and they would immediately either want a more complete explination or be turned off. Experience in teaching young people to program has shown me that.
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

pygmy_giant
Posts: 1562
Joined: Sun Mar 04, 2012 12:49 am

Re: BASIC - more harmful than useful?

Fri Jan 25, 2013 1:19 am

Read chapter 7 of the CAS Educational Manual:

http://downloads.raspberrypi.org/Raspbe ... Manual.pdf

p170

;)

User avatar
danpeirce
Posts: 100
Joined: Thu May 10, 2012 8:32 am
Location: Richmond & Surrey BC Canada
Contact: Website

Re: BASIC - more harmful than useful?

Fri Jan 25, 2013 1:42 am

DavidS wrote: It is not about introducing implementation of classes that I speak. I whas speaking of giving the example that does a lot of hidde stuff that a young child would imediately devide is doing a lot that is not shown (in this case by the class implementations that are standard to the language) and they would immediately either want a more complete explination or be turned off. Experience in teaching young people to program has shown me that.
One merely needs to explain that one strategy in dealing with complexity is to take a complex problem and divide it into a number of less complex problems.

For example to design a Raspberry Pi board the electronics engineer does not want to design each and every part. He/she might do a board layout that will make use of existing parts that can be ordered. This is actually quite important if one is to get a product to market at a reasonable cost and do a design in a reasonable period of time.

In software the same need to keep complexity in line occurs. In modern programming preexisting modules are used to help keep the costs involved in developing new software more reasonable. Over time techniques have been devised to help make programs more modular for this reason. The complexity of each module must be kept within reason or it becomes impossible to fix bugs in the module without introducing more bugs.

In my experience in teaching I never am told I am hiding too much.
"in this case by the class implementations that are standard to the language"
Hold on. Implementations that are standard to the language are part of the language. It is actually not clear what you are complaining about here.
Last edited by danpeirce on Fri Jan 25, 2013 2:05 am, edited 3 times in total.

Return to “Staffroom, classroom and projects”