User avatar
johnbeetem
Posts: 945
Joined: Mon Oct 17, 2011 11:18 pm
Location: The Mountains
Contact: Website

Re: BASIC - more harmful than useful?

Mon Dec 12, 2011 7:27 pm

Quote from obarthelemy on December 12, 2011, 18:01
I agree in theory, I disagree in practice. For the same reason we don't teach kid several spoken tongues at the same time, actually.

I heard of a baby whose parents though it would be great for him to be multi-lingual. So the father spoke English, the mother spoke French, grandma spoke German, etc. When the babe reached speaking age, he spoke his own language, combining words from all the languages he had heard. He naturally assumed everyone in the world spoke a different language.

It's got to be true -- the story predates the Internet.

dattaway
Posts: 20
Joined: Tue Nov 15, 2011 11:41 pm

Re: BASIC - more harmful than useful?

Mon Dec 12, 2011 7:28 pm

"More harmful" to me is what crashes and burns the most. I believe that's why I have learned to avoid apps that use an OO compiler.

liam collins
Posts: 17
Joined: Sat Oct 29, 2011 5:06 pm

Re: BASIC - more harmful than useful?

Mon Dec 12, 2011 7:31 pm

Quote from jamesh on December 12, 2011, 17:34
Sod all these languages. Let's put Prolog on it. That'll sort the men from the boys.

Real men program in Assembler and don't eat quiche! :D

"If you can't do it in Assembler then you just can't do it!" - RJM.

I really do miss programming in Assembler (seriously)... :( I started as a real-time 8080 coder writing firmware for modems and moved to MC68xxx series before ending up as a IBM 360/370 systems programmer. Now I'm a boring storage architect/performance engineer...

Stuff BASIC, teach kids ARM Assembler!!! :)

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

Re: BASIC - more harmful than useful?

Mon Dec 12, 2011 7:55 pm

Quote from mkopack on December 12, 2011, 19:27
Then C++/Java for OO
For one, almost terminally crippled, implementation of OO ;)

There's a "wink" smiley there, but I really mean it. The C++/Java strongly typed, class-based model of OO is fundamentally restrictive. Sure, it's useful in certain cases, but then so's COBOL. I say that as someone who's made a living programming C++ professionally for a significant part of the last 20 years.

If you want to teach "OO" properly, you start with smalltalk.

Simon

Bakul Shah
Posts: 321
Joined: Sun Sep 25, 2011 1:25 am

Re: BASIC - more harmful than useful?

Mon Dec 12, 2011 9:04 pm

Quote from johnbeetem on December 12, 2011, 19:27
Quote from obarthelemy on December 12, 2011, 18:01
I agree in theory, I disagree in practice. For the same reason we don't teach kid several spoken tongues at the same time, actually.

I heard of a baby whose parents though it would be great for him to be multi-lingual. So the father spoke English, the mother spoke French, grandma spoke German, etc. When the babe reached speaking age, he spoke his own language, combining words from all the languages he had heard. He naturally assumed everyone in the world spoke a different language.

It's got to be true -- the story predates the Internet.


Actually bilingual kids are generally better at languages among other things. According to a recent study they are better at attention and cognitive control than monolinguals (there are even suggestions bilinguals are better protected against Alzheimers because of these skills). They may have a smaller vocabulary in each language but know more words cumulatively than their monolingual peers. Bilingual kids know early on to try the alternative language word if they feel adults are not understanding them! They learn early that a concept can be expressed in multiple ways.

If people speak one language to their kids it is because the vast majority of people marry someone who has the same mother tongue! Even with parents speaking different languages, usually one parent as a primary caregiver ends up spending most time with the kid.

The relevance here is that learning two programming languages from the start will actually make them more comfortable and adept with PLs, not less. Teach a low as well as a high level language.

spock
Posts: 208
Joined: Sun Oct 02, 2011 10:33 am

Re: BASIC - more harmful than useful?

Tue Dec 13, 2011 12:37 am

so which two languages would be an ideal match? i would say python and C. :)

obarthelemy
Posts: 1399
Joined: Tue Aug 09, 2011 10:53 pm

Re: BASIC - more harmful than useful?

Tue Dec 13, 2011 12:50 am

I'd vote for assembly. It's really fun to be working at the lowest possible level.

jibbits
Posts: 1
Joined: Tue Dec 13, 2011 1:04 am

Re: BASIC - more harmful than useful?

Tue Dec 13, 2011 1:19 am

Nahhhh... go with Jovial if you want a real programming language. Just kidding.

Sssh dammit!

BASIC is best kept away from the young+intelligent. It's important that the younguns be made to think everything is complex, academic, reeking of committees, requiring certification and buried in levels of abstraction.

I quite like Objective-C 1.0 and C due to their simplicity+power. But honestly think BASIC+C would have been a much more efficient route for many modern tasks. It is just well... not fashionable. Let's keep it that way, shall we?

User avatar
johnbeetem
Posts: 945
Joined: Mon Oct 17, 2011 11:18 pm
Location: The Mountains
Contact: Website

Re: BASIC - more harmful than useful?

Tue Dec 13, 2011 1:30 am

My vote for first programming language is Pascal, with second language being the favorite of the instructor.

As an undergrad, I took a data structures course where we had the choice of writing assignments in Fortran IV, MIX assembly language, or Algol (no recursion allowed). Once I learned PDP-11 ASM, it was my language of choice for practically everything I wrote (much better string and structure handling than Fortran by far!) Pascal showed up in my junior (IIRC) year and I thought it was grossly unfair that students could now write data structure programs using records and recursion. I mean really -- in Pascal those programs practically write themselves. When I took those courses, I had to work.

Pascal was created to teach good programming practices, and it still does IMO.

SeanD
Posts: 121
Joined: Wed Sep 21, 2011 12:25 am
Contact: Website

Re: BASIC - more harmful than useful?

Tue Dec 13, 2011 1:56 am

I have been reading this thread with interest as it appears to bring out some interesting ideas and emotions.

Personally I do not agree with the gladoscc's (the OP) statement but I am not saying it is wrong. My own personal journey started with BASIC on an Apple ][ and then on a ZX81 and RML 380Z. For me it was a gateway language. It was limited and I needed to do more, and given the RAM constraints we had that meant machine code, and I mean machine code not assembler as it was not until the 380Z got an upgrade that I could run a decent ASM so I used a coding sheet and did it the hard way.

As has been said above the dreaded GOTO statement sets you up for JMP which when you were trying to pack code got used a lot (well probably tied with JNZ) anyway in the land of 8 bit assembler the world you were able to learn very quickly, get what felt like powerful results and really get a good grip on how the system you were working on actually worked. When I learnt C it was a kind of natural abstraction above what I already knew. I understood why you had to do certain things because I knew what was having to go on under the covers and I was glad that the compiler was doing all the hard work for me but I still looked to optimise my code. That made me a better C programmer and helped kick start my career.

I do worry that people these days to do not get adequate chances to get down low with the hardware. It is why I am such a fan of the RPi as I believe even though it has a very modern architecture in a similar way to the Arduino the fact that most people will run it without a case and will ask fairly fundamental "what if" and "how do I" type questions that we will get a generation who understand the depths a long time before they hit college, which is far too late. Yes they will need to learn OO if they want a career but none of the best guys I know in the industry are pure OO, all of the good ones have something procedural in their backgrounds, and for a chunk of them it was BASIC.

deechster
Posts: 10
Joined: Tue Nov 29, 2011 9:35 pm

Re: BASIC - more harmful than useful?

Tue Dec 13, 2011 2:52 am

After BASIC the second language I learned was Pascal. I found it rather hard at first but after I got used to having to declare and type all my variables I found it was much more usable. Learning C after Pascal was fairly easy. In my mind C was just terse Pascal although I tended to write very Pascal like C. I never did much with C, fussing with string buffers was more work and required careful memory management. For me it was just easier, cleaner and more readable to me to write it in Pascal.

Now days I would say Pascal/Lazarus/Delphi is still a powerful alternative for developing high performance compiled applications. Recently I have started learning Python and found it elegant and flexible as an interpreted and interactive language.

For beginners Python, and to a lesser degree BASIC, are good tools and can take a student a long way to understanding programming. Python because of its standardization (relatively few flavors of syntactically different implementations of Python as opposed to BASIC) and large collection of standard libraries is awesome compared to what I could do with BASIC back when I started programming. Had Python and all of its libraries been available as my first language when I started, I cannot begin to imagine the incredible things I would have been inspired to do with it.

To teach the deeper and lower level computing concepts, stacks, heap, and linked lists, complex data structures, objects, and memory management, I would start with Pascal and then move to C/C++. Between Python and C/C++ there are very few problems that could not be solved and very few platforms where the solution could not be ported to.

At some point however, taking a dip into an Assembler should be required for two reasons. 1.) To show how the computer hardware, CPU and memory, works near it's lowest level. 2.) Both how much Assembly code and how little Assembly Code are required to do a comparable things in a higher level language.

For example, it was shocking to me how much Assembly it takes to print a line of text on screen. Equally shocking was how similar it was to do simple things like define a variable, assign and manipulate the value of the variable. Doing some Assembly gives one an instant appreciation of the entire computer and what a nice thing it is to have higher level languages to abstract us away from the highly machine specific operations of a CPU.

For me, I think Python to Pascal/Lazarus/Delphi to C/C++ with a side trip into Assembly would be nice progression for learning how to program.

Bakul Shah
Posts: 321
Joined: Sun Sep 25, 2011 1:25 am

Re: BASIC - more harmful than useful?

Tue Dec 13, 2011 3:23 am

I'd pick:
1. ARM assembly -- just enough to get comfortable with the instruction set, some details of the cpu arch. how interrupts work, how to poke some IO device and so on.
2. C -- because of 1, you already know how to make sense of cc -S output. With that you can gain an understanding of the cost of various language constructs, compilation, optimization etc. You will be able to write low level code as well start gaining experience with data structures.
3. Scheme. Even if you later end up not using Scheme professionally you'd have learnt valuable thinking/programming/prototyping skills.

I wouldn't teach C++/Python/Java/Ruby because those you can pick up anywhere (and on your own once you know C & Scheme) and because I believe that object oriented programming is not the way forward (perhaps Actor languages or Functional).

But if you have a local (or even remote) mentor willing to teach you, pick the language they suggest as they can teach you their "native" language very well! And once you know a language or two well it is pretty easy to pick up new ones.

willrandship
Posts: 51
Joined: Tue Sep 13, 2011 5:08 pm

Re: BASIC - more harmful than useful?

Tue Dec 13, 2011 3:48 am

BASIC is an unecessary step, and overcomplicates future language learning. Learning python allows for BASIC-like structure, and easily transitions into higher programming concepts, for example. BASIC was great for its time, but it's not that time anymore :D

I also agree with Bakul Shah.

tomo
Posts: 19
Joined: Mon Dec 12, 2011 12:50 pm

Re: BASIC - more harmful than useful?

Tue Dec 13, 2011 8:31 am

Quote from willrandship on December 13, 2011, 03:48
BASIC /.../ overcomplicates future language learning.

But... why exactly? No, really, why exactly? And... are we talking here about the BASICs of the 80' with mandatory line numbers and gosubs or some kind of an object capable Visual Basic incarnation... or....? If it actually comes down to personal syntax preferences, I'm sure It would be unfair to limit ourselves just to discussing syntax peculiarities of Visual Basic... or BASIC for that matter...

BASIC is still an useful tool that does the job. Many jobs. Of course, not every job. I wouldn't want to do most things I do everydays in BASIC. And thank God I don't have to! But we are talking about the children making their first steps into computers and not the more experienced children learning to program real-world applications, right? Because, I hardly imagine a better way to demotivate young children than throwing them fresh into C, compilers or forcing them to fight through endless levels of abstraction...

BarryK
Posts: 36
Joined: Thu Dec 08, 2011 12:47 am
Contact: Website

Re: BASIC - more harmful than useful?

Tue Dec 13, 2011 10:02 am

In Puppy Linux, we have many applications written in Bash/Ash, including GUI apps -- in particular we use 'gtkdialog' to create quite sophisticated GUIs.

Regarding compiled applications, our officially supported compiler is 'BaCon'. This a BASIC compiler, well, a translator to C then runs gcc. BaCon started life as a structured BASIC similar to Microsoft's QuickBASIC, but now has many extensions. We have created many commandline and GUI apps with BaCon.

I consider Bash/Ash and BaCon to be excellent starting points for any young person or newcomer to programming.

Bash/Ash is the essential glue in Unix/Linux, it has been there forever and will stay there forever -- an invaluable tool to master, and quite easy if taught right.

Structured BASIC, especially with the HUG (High-level Universal Graphics) extensions, is an excellent first language I think. Practically, it compiles to very compact code, even the HUG does not need a huge library and small executables can be created.

BaCon home:
http://www.basic-converter.org/

My BaCon intro pages:
http://bkhome.org/bacon/

Regarding 'gtkdialog', this is a superb tool to create GUIs for any scripting language. In 2011 there has been a new maintainer and an incredible burst of development:
http://code.google.com/p/gtkdialog/
http://murga-linux.com/puppy/v.....hp?t=69188

liam collins
Posts: 17
Joined: Sat Oct 29, 2011 5:06 pm

Re: BASIC - more harmful than useful?

Tue Dec 13, 2011 2:50 pm

Quote from johnbeetem on December 13, 2011, 01:30
My vote for first programming language is Pascal, with second language being the favorite of the instructor.


I never did like PASCAL due to all of its limitations and inconstancies (why couldn't I have a variable number of arguments in my procedures when the inbuilt ones did???). After starting work I stumbled across Modular/2, Wirth's second attempt at structure programming language, and that was wonderful. All the inconstancies gone, structure code, good modular functionality... shame it never took off as a big commercial programming tool.

My vote would be Assembler and Modular/2 - I'm not a fan of OOPs, partially because I come from a MASCOT background (modular code) and find the concepts of inheritance and polymorphism annoying - The number of times I've had the 'main() not found' error in Java because I declared "void main(String args)" Ahhh!!! I believe it's not a good starting point to bury a newbie programmer in even more abstract concepts and subtle error messages than is needed (stares directly at the Java compiler, which I know isn't a good implementation of OOPs)

Another thing that may need some thought is that, when starting to get past the coding basics, people hit the steep learning curve (vertical cliff) of learning to program in a GUI and finding the millions of API calls required to produce some thing more complex than "hello world"

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

Re: BASIC - more harmful than useful?

Tue Dec 13, 2011 6:39 pm

Quote from tomo on December 13, 2011, 08:31
Quote from willrandship on December 13, 2011, 03:48
BASIC /.../ overcomplicates future language learning.

But... why exactly? No, really, why exactly? And... are we talking here about the BASICs of the 80' with mandatory line numbers and gosubs or some kind of an object capable Visual Basic incarnation... or....? If it actually comes down to personal syntax preferences, I'm sure It would be unfair to limit ourselves just to discussing syntax peculiarities of Visual Basic... or BASIC for that matter...
For me, it's nothing at all to do with syntax, and everything to do with expressibility. BASIC is not expressive, it's rigid, it pushes the programmer into a single way of approaching poblems. Even later dialects, with event handling and "object orientation" bolted on are poor excuses for programming languages (see also object oriented cobol). BASIC was a bad idea (or rather, a good idea badly implemented) in the first place and there now are a multitude of vastly better languages filling the niche BASIC aimed for - it's time to let it die. If it won't die, take it out the back of the shed and give it 2 shotgun shells to the back of the head.

liamfraser280
Posts: 354
Joined: Tue Oct 04, 2011 6:53 pm
Contact: Website

Re: BASIC - more harmful than useful?

Tue Dec 13, 2011 8:17 pm

I think the key thing is to move on from BASIC fairly soon after the initial basics have been taught so the programmer doesn't get too comfortable with bad habits. I started on visual basic when I was about 10, and I just messed around and googled things untill I was able to do them. Then after a while my dad taught me C# when Visual Studio went .net and pointed out all of my bad habits. From then I've been very mindful of my programming practice and want to do it the neatest and best way possible. Then recently I've started to play with C: strings as char arrays, pointers - EWW!

User avatar
johnbeetem
Posts: 945
Joined: Mon Oct 17, 2011 11:18 pm
Location: The Mountains
Contact: Website

Re: BASIC - more harmful than useful?

Tue Dec 13, 2011 8:47 pm

Quote from liamfraser280 on December 13, 2011, 20:17
Then recently I've started to play with C: strings as char arrays, pointers - EWW!

I had the luxury of learning C after mastering PDP-11 assembly language. The PDP-11 had a significant influence on C, especially addressing modes. After lots of string processing in PDP-11 ASM, C strings are easy. I always recommend thinking of C as a portable assembly language. While it uses high-level language notations, C is not really a high-level language since the run-time model is low-level.

liamfraser280
Posts: 354
Joined: Tue Oct 04, 2011 6:53 pm
Contact: Website

Re: BASIC - more harmful than useful?

Tue Dec 13, 2011 9:44 pm

It's just different to what I'm used to. I'm sure after assemler C is a luxury. Handling memory is a bit confusing, as well as what exactly a pointer is and pointer arithmetic - but if you spend a bit of time on it you can get your head around it :). Thats my view anyway, coming from an easy managed language. What took me 10 minutes in C# took 3 days in C :P, and a lot more code. To be fair i'd never used C before though so that's not much of a valid comparison.

tomo
Posts: 19
Joined: Mon Dec 12, 2011 12:50 pm

Re: BASIC - more harmful than useful?

Tue Dec 13, 2011 9:46 pm

Quote from tufty
and there now are a multitude of vastly better languages filling the niche BASIC aimed for - it's time to let it die. If it won't die, take it out the back of the shed and give it 2 shotgun shells to the back of the head.

And you've got me straight into my heart with these evil words, need I say more...? But, thankfully, we know it's just you being evil and not some specific programming language threatening to destroy the world :-)

Quote from liamfraser280 on December 13, 2011, 20:17
I think the key thing is to move on from BASIC fairly soon after the initial basics have been taught so the programmer doesn't get too comfortable with bad habits.

Well, the point is that we always get "bad" habits, no matter the language. And they often become "bad" after we change the language. If you switch to Java from C, you are already full of bad habits. Even if you switch to Java from C#, you are full of some "bad habits". And vice versa. That's why people have to think when they change the environment. They can't just switch the words and keep making sentences as they have before (in the broadest sense possible). Holding on to this "best habit" dilemma, we can easily end up comparing oranges to apples, pretending it doesn't matter just because it's some "higher science", "cause" or something.

In my opinion, the least rigid languages are also the worst in the sense of encouraging developing bad habits. Take, yes, JavaScript! As a language It's a marvelous little gem, powerful as hell (unless for those using it just to blink a text on their site)! It's also pretty much the closest thing to being flexible and not rigid as you can get. And exactly in this flexibility is hidden a trap. A potentially death trap. By not allowing you just to do "anything", but to do it in hundreds of different ways... it's pretty much like giving you a machine gun without the manual and letting you accidentally blow your foot or the head off.

User avatar
Jongoleur
Posts: 1179
Joined: Thu Aug 11, 2011 12:47 pm
Location: O'erlooking the sea, and all those effin windfarms...

Re: BASIC - more harmful than useful?

Tue Dec 13, 2011 10:58 pm

Dijkstra has a lot to answer for...

*nods*

I'd agree he was right about BASIC in terms of the old convoluted, GOTO-ridden wormfarms of the early years, but from the early 80s onwards, block structuring and sane looping and decision structures (all to be found in BBC BASIC) mean that modern BASICS are no better or worse than any other languages for introducing beginners to programming methodologies.

There are other reasons why BASIC may not be entirely applicable to gaining and maintaining the attention of young programmers but its not a bad language for starting to learn to code with, if you don't want flashy graphics.

In the end, the programming language selected may well depend on the comfort zone of the person providing support and advice to a learner.
I'm just a bouncer, splatterers do it with more force.....

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

Re: BASIC - more harmful than useful?

Wed Dec 14, 2011 8:02 am

Quote from Jongoleur on December 13, 2011, 22:58
from the early 80s onwards, block structuring and sane looping and decision structures (all to be found in BBC BASIC) mean that modern BASICS are no better or worse than any other languages for introducing beginners to programming methodologies.
This is a fair point, and, modulo more advanced concepts like automatic iterators (which are a sin anyway) and the basics of functional programming, BASIC is reasonably well equipped with control structures. Well, it's more or less sane, anyway. However, I would argue that programming only starts with control structures and the "other 50%" is data structures.

The vast majority even of "modern" BASICs don't provide any significant data structures beyond String/Number/Array. No linked lists, no stacks, no queues, hashes, nada. Not only are these structures lacking, the fact that, in most cases, there are no user-defined structures[1] allowed makes implementing such structures difficult (at best).[2]

If you want to go on to do OO, you need to know about data structures, because that's a significant part of what OO is - indeed, if you look at C++'s implementation[3], it boils down largely to "structs and function pointers". Database manipulation - that would be data structures again. Indeed, almost any significant programming task requires (or is made significantly less complex by) a decent set of data structures.

Code and data go hand in hand. Deliberately restricting the choice of data structures to "items that can fit in one word of memory, and arrays of those items" made sense *only* when the logical "next step" was going to a language that's "close to the metal" (in 1964, that was assembler, in most cases). Most programmers these days will never touch assembler, and stay within the comfort zone where 99.9% of the useful, complex, data structures they need are built into the runtime.

You can't teach programming without teaching data structures, and you need to teach the two alongside each other.

BASIC is crippled. It doesn't "encourage bad practices", it is a bad practice in of itself. There is nothing BASIC can do that can't be done better (and usually in a manner that's more concise and readable) by other languages. Python is the first to spring to mind, but it's far from being the only one.
C'mon old boy! Let's go for a walk.

<click>

<blam><blam>

You know it makes sense.

Simon

[1] VB, for all its sins, does actually allow one to define structures. The syntax is unintuitive, but that's unimportant - it lets you do it. VB is probably the best of a bad lot, though it pains me to say so.
[2] Still with VB, this article has a piece of example code on how to do a linked list. Well, more or less. http://www.codeproject.com/KB/.....basic.aspx
[3] Which, the astute reader may have noticed, I'm not overly fond of.

tomo
Posts: 19
Joined: Mon Dec 12, 2011 12:50 pm

Re: BASIC - more harmful than useful?

Wed Dec 14, 2011 9:04 am

Quote from tufty on December 14...

While I agree that there are other o.k. alternatives to BASIC in this case, I don't really agree with the idea that throwing all the unnecesarry bloat - which one might use or benefit from when writing a business or scientific or any other real-life application - at children taking the first steps in programming, is a "good habit" or necessary. I don't even think children should stay with one language through·out their education time.... I think it's bad. Very bad! They should learn that different (!) languages exist and that each of them is better or worst for something.

I do think that children (i.e. the future programmers) should initially get some touch of being closer to the hardware and the way computers actually work... and I don't think that throwing them fresh into assembler is a good motivation.

If the only point would be to teach the children something that is useful, trendy and convenient for writing user applications, is widely used and makes money, I would teach them Java. It's ubiquitous and does the job damn well! This by its own makes this "academic" discussion of "right" and "wrong" and "this" and "that" pretty pointless. But good Java programmers (with OO, structures, linked lists and all that) don't necessary make good system programmers, compiler programmers, embedded or even web programmers. By going that way, we soon end up teaching the "Microsoft Word" of computer programming, rejecting everything below as "obsolete", uninteresting and unnecessary to know... Doesn't that mean that the whole point of the Raspberry Pi and the proper computer education was badly missed again?

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

Re: BASIC - more harmful than useful?

Wed Dec 14, 2011 10:28 am

Quote from tufty on December 14, 2011, 08:02
The vast majority even of "modern" BASICs don't provide any significant data structures beyond String/Number/Array. No linked lists, no stacks, no queues, hashes, nada.

I don't recall C ever having linked lists, stacks, queues, hashes, etc as intrinsic data types, not even dynamic strings for that matter. Likewise for other popular languages, perhaps even C++ but I'm not familiar with C++.

Not only are these structures lacking, the fact that, in most cases, there are no user-defined structures[1] allowed makes implementing such structures difficult (at best).[2]

I've not run into problems of user defined types or lack of data structures in Basic programs I create. Yes, there are Basic variants inferior to others; the simple answer is not to use the inferior variants.

Of more practical concern is whether the more credible variants of Basic are available for Linux and particularly ARM or non-X86 architectures.

Return to “Staffroom, classroom and projects”