View Single Post
Old 10 August 2015, 16:03   #205
Registered User

Dunny's Avatar
Join Date: Aug 2006
Location: Scunthorpe/United Kingdom
Posts: 986
Originally Posted by Megol View Post
The problems with most BASIC systems are: line numbering (actually a forced form of labels), limited datatypes, limited support for structured programming, limited naming of variables (often limited to an a-z character followed by a 0-9 character followed by a type indicator), static allocation of resources etc.
Gonna have to jump in here and say that you've totally missed the point of BASIC. It was never intended to be used for production code, it was never intended to be as fast as a good compiler and it doesn't need to have any of the more powerful features that the more professional languages have.

It was intended to get the absolute beginner into programming, with an eye to moving up to more complex systems later when they reached proficiency.

Many people make the mistake of saying things like "C is perfect for the beginner" or "Assembly is so simple anyone could pick it up" or other such phrases - when what they're actually saying is that because they're proficient in such a language they believe that someone who has never even looked at code before could do as well as they have.

That's not to say that a beginner couldn't start off with C or Python or Perl or whatever - they can. But BASIC makes it easier, by a huge margin.

Line numbers are not there to "enforce labels" - they are there to reinforce how a computer does its job - logically, one instruction at a time in sequence. The list of lines, being numbered and in sequence, helps the beginner grasp what order things are going to be done in. This is preferable to C/Pascal et al because they often do things in a non-obvious order what with having entry points halfway through a source file or whatever.

Limited datatypes is a conscious decision to simplify things - when you don't even know what a variable is you certainly can't be worrying about how many bytes it takes, what the range is, whether or not it's signed... You have enough on your plate as it is when some letters can be numbers and some can be strings of other letters!

Limited variable naming tends to be a limitation of the BASIC's environment such as memory space available etc. Even the old 8bits allowed you to name things with long names, even if some of them restricted string variable names to one letter and a $ character suffix! These days though, I don't know of many BASICs at all that restrict variable name lengths.

Static allocation isn't really a problem at the beginner level, and nor is support for structured programming or code flow. It's enough to know that you can use GOTO to jump around, GOSUB to enter a subroutine - moving onto procedures and function definitions is quite advanced when you're still getting to grips with the fact that your code can branch if a decision is made

There are many BASICs out there now (and have been since the days of the Amiga and before even that) which promise that the user can use them to write complex applications and boast many of the features of their lower-level peers, but they themselves are to blame for many of BASIC's failings - they don't encourage a user to move on and learn a better system.

If a user has learnt sufficient BASIC to be able to write complex systems and games then they really shouldn't be using a BASIC to do it - they're good enough coders to be able to start with something like C or learn Asm. BASIC is for beginners, and for its part in their development it does its job admirably.

TL;DR - BASIC is great for teaching people to code from the ground up, but no more than that; you're not meant to stay with BASIC forever.

Dunny is offline  
Page generated in 0.03815 seconds with 10 queries