Why Teach Programming With BASIC?
chromatic writes "To answer the perennial question 'How can we teach kids how to program?', we created a web-based programming environment. As we began to write lessons and examples, we surprised ourselves. Modern languages may be powerful and useful for writing real programs, but BASIC and Logo are great languages for demonstrating the joy of programming."
There is still the theory that once you teach someone basic it becomes impossible to teach them programming. /running and ducking...
Sig Battery depleted. Reverting to safe mode.
I learned to program pretty much with Applesoft BASIC and a Franklin Ace 1000 manual
Now I'm teaching my mom (!) to program in Python using the Hello World book.
Honestly, I wish Python were around when I was learning. Trying to squeeze a new instruction between line 11 and line 12 kinda sucked sometimes. (Then again, I wish a lot of things were around...)
10 print "hello"
20 goto 10
This is why we can't have nice things.
John
...They GOSUB and don't RETURN.
Logo is an educational language. With the addition of Turtle Graphics, it's a great way to show a student how to deconstruct a task into components and instruct the machine to perform that task. Wanna draw a hexagon? Pen down, move a bit, turn 60 degrees, rinse and repeat.
BASIC means Beginner's All-purpose Symbolic Instruction Code. It, too, was an educational language. Of course, since so many learned it early on, it turned out to be useful to evolve it into things like VB Script, VBA, and now VB.NET, so you can do everything from web page scripting to writing spreadsheet macros to building sophisticated desktop applications with some form of BASIC.
So why is it any surprise that languages created for teaching purposes are good for teaching programming?
despite their limitations and age, procedural languages are a better way to teach kids (or anyone)how to think logically about the steps required to make a computer do something they want it to do.
It worked for me in 1971 on a teletype at Cory School in SJ connected to a Stanford mainframe -which I had to feed my 'saved' paper tapes to
and it will work just as well today on whatever BASIC emulators (or even VB.NET god forbid) that are available today on PCs, pads or whatever.
Although Java is probably better for middle/high school, I do believe that Basic or Logo are better for those younger who have not yet learned how to deconstruct a desired outcome into a bunch of logical steps.
-I'm just sayin'
I learned Basic on a Commodore VIC-20 in 1978. I think it is a terrible choice for learning to program. I suggest newbies learn Scheme, a very simple language that will lead you as far down the rabbit hole as you are willing to go. If you are more interested in electronics you should learn C, particularly on the nice small embedded development boards that are available.
an ill wind that blows no good
I personally started with Logo and assembly language, but only because it was what was available in school (Logo) and on my DOS 2.0 floppy (DEBUG).
Looking back, BASIC may have been the most available language available on ROM at that time, so that's what folks used (despite that it supposedly 'mutilates the mind beyond recovery' according to Dijkstra http://en.wikiquote.org/wiki/Edsger_Dijkstra ).
I think now, javascript would have that advantage since it comes with the browser (and firefox is particular has got good debugging support for javascript).
"Here, son, let's look at this Wordpress site that hasn't been updated in 18 months. Now, this is called 'SQL Injection' and 'Cross-site Scripting.'"
Nothing better than learning by example...
While high-level abstractions like .NET and Java are splendid modern tools, nothing teaches you the fundamentals of how a computer thinks and works like a line-by-line BASIC program. Two reasons off-hand:
a) The leap to assembly language is natural and easily understood.
b) The leap in the reverse direction, to functional languages, is mostly a simple matter of wrapping blocks in headers and return statements.
If you start in a language with these two attributes, you're already 1 - 2 years into a collegiate computer science degree.
BASIC helps to teach logical though process, critical in both programming, and in business analytics. I learned BASIC on an Apple IIE back in the 80s and a C64. That knowledge went dormant, until about 10 years ago when I began using Access, Crystal, SQL (and derivatives) and now SPSS.
Wow, this "story" is a really blatant advertisement for a commercial website.
No, BASIC is not a good language for much of any purpose, including education. Especially not the archaic type of BASIC they're using. Computer science really has progressed in the last four decades. Personally, I'd recommend Python as a starting language - it's easy to learn enough to do simple things, it's a well designed language that teaches good habits, and it's a "real" language that you won't outgrow as soon as you start writing anything beyond toy programs. But if you want a language designed specifically as a learning tool, there are lots of those that are a lot more modern and let you do a lot more than this company's offering: Processing, Alice, etc.
"I'm too busy to research this and form an educated opinion, but I do have time to tell everyone my uninformed opinion."
I think Python is a better contemporary choice now (and I learned on structured BASIC - QuickBASIC)
There is noting inherently complex with OO, unless you already have a head full of linear or procedural programming that you need to get rid of.
A nice, stripped-down OO language - I'd sugest parts of java if it was a free language - would be a good start. Even a graphical interface, although they are undeniable useless for real programming, would be useful for starting off.
Prediction for end of Universe #42: Fencepost error in Quantum_bogosort.cpp
BASIC? Really? In 2010 someone is making products with BASIC?!?!?! This has to be for legacy supp... wait you say it isn't? WHAT THE FUCK!!!
Please do your students a favor and use Python.
Those of us who were kids in the 80s and grew up playing on microcomputers with BASIC have a very distinct property:
We grew up together with computers.
When we were kids, computers were simple, single-tasking, small memories, and it was easy for a youngster to understand the entire system. As we got older, systems got more complicated, and so did our ability to understand them.
Today's kids start with computers that are already large systems with complex operating systems, millions of times more memory than we have *disk* when we started, that are difficult to understand at a low level. I think this puts them at a loss. Every child should be able to play with and learn on an Apple II, C64, or similar small system. Of course realistically that won't happen. So emulated "systems" with simple programming languages may indeed be a good idea for today's kids.
Teach them math and language skills. These are the fundamentals of programming and it is a waste of time to teach programming until these foundations are in place.
Pretty cool little Commodore 64 emulator but the peek, poke, and sys commands have yet to be implemented. Luckily the GOTO command was implemented. The Java and OOP Nazis have been trying to kill GOTO for years and I am glad to see that it is still alive and well for future generations of programmers to enjoy.
If you are new to basic try this little program...
10 ? 'HELLO WORLD'
20 GOTO 10
1 NEW
Dear FBI, please stop by sometime later this week. As you can see, I am at home at 7:12pm CST. Thanks!
FTFY
"Going to war without the French is like going deer hunting without your accordion." ~General Norman Schwarzkopf
loop while( true )
screen.print( "Hello World" );
Prediction for end of Universe #42: Fencepost error in Quantum_bogosort.cpp
I might, if there were a simple, cross-platform, one-click-install download bundle for all of the major operating systems which included pygame and a decent IDE, and even then I'd target motivated 13 year olds as the youngest users.
If I were trying to teach motivated ten year olds in person, I might choose Python/pygame as well.
That's not our goal, though. We're trying to help motivated eight year olds discover the joy of programming as a means of using computers as creative tools, not to produce millions of practical programmers.
how to invest, a novice's guide
the correct question would be...
how do we get our kids interested in learning how to program?
and the answer to that would be...
tell them they're not allowed to do it.
Sounds to me like he should only be allowed to teach eunuchs.
Error: While is a word reserved for future use.
:)
Looks like that is on the to be implemented list as well, but GOTO works
"It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration."
- Edsger W.Dijkstra
There might be hope for subjects that started using "gosub" without ever using "goto" but I have never seen anyone having done that.
But then again IMHO today's html/javascript is one form of modern spaghetti code too so maybe BASIC should be taught because of that.
You can teach people logic statements and procedures and about objects, even - with ENGLISH.
In my grade 8 class, there were no computers except the ones at the University I was by then programming with punch cards using stolen student accounts. But the math teacher asked us to write out our procedure for tying our shoes - in precise, motion-by-motion detail so another student could do it exactly the same way as we did, without help. Most people required over a page, and it was a revelation how excruciating it was. Later, in CompSci 501, I learned about logic statements and predicates and the wonderful Lewis Carrol problems ( 1: All my turtles that are not green are old....) All English.
"Computer Programming" on the other hand, is about making computers do things for you. By hook or by crook, by object or procedure, just get 'er done. I completely agree with the language snobs and detest BASIC. And I do most of my programming in it because you can make Excel about 10X more useful with just a little VBA here and there.
Learning Python or Java is just great if you plan to be a professional programmer one day, those languages can solve very large problems without the codebase becoming unmanageable. If your problem is getting a bunch of kids excited about what computers can do, you have no choice but to use whichever language will produce results with the greatest WOW factor with the shortest learning time.
That cuts out ALL verbose languages, languages that demand typing. The "Hello world" program should be one statement long.
Notice that doesn't chop out Perl or Python. But also notice that at kid-levels, those languages can only take screen input and produce text output. That was cool for me in the 1970's but I think today you'll get better results with something that can go graphical right away. (This also just cut out your original BASIC).
So, if your school has MS-Office on every machine, well, as a FLOSS fan I hate you, but you're crazy if you don't leverage the presence of VBA. You can show them what cool stuff a computer can do with Excel alone, show them some formulas in action and all that. (This, by the way, keeps them from thinking of "computer programming" as necessarily procedural right there - clearly, you are instructing the computer, but you are NOT using a procedure, just setting up conditions for behaviour of the cell objects!)
Then show them procedural programming by modifying the spreadsheet with VBA. This can lead quickly to manipulating the Excel data structure, which is a huge collection of objects with properties and methods. Many can manipulate charts in pretty ways, or turn Excel into "graph paper" with coloured cells in funny shapes, like ASCII art. You can take it all the way to them inventing their own objects in VBA.
AND: It will be useful in a job, even if they only learn to write 10-liners. Bonus.
No,
10 print "fuck you ";
20 goto 10
At Radioshack, Sears, Wards, and anywhere hobby computers were sold.
I might, if there were a simple, cross-platform, one-click-install download bundle for all of the major operating systems which included pygame and a decent IDE, and even then I'd target motivated 13 year olds as the youngest users.
You can run Python directly in the browser - no need for installs at all. In fact one of the motivations for getting CPython working in JavaScript was for things like this. (Note: It doesn't work perfectly yet, but all the hard work is already done.)
For a basic IDE, that demo includes Skywriter. Integrating some additional features like load/save etc. would make it very usable I think.
Regarding pygame: It would be possible to get something like that working in the browser, targeting an HTML canvas element. See this demo for C++ code written against SDL, compiled into JavaScript and an SDL implementation that targets a canvas.
When teaching students how to program (which is entirely different from teaching them computer science), you should begin with the most fundamental concepts: talk about raw memory and opcodes. Discuss briefly how these instructions are actually interpreted and implemented (how a half-adder works is fascinating, even if most people never have to build one in real life).
Once your students understand how to make computers do basic things with raw instructions, teach them jumps, conditionals, loops, and even subroutines. After that, introduce higher-level languages and compilers, and demonstrate that the compiler merely automates what your students have already been doing. From there, teach progressively higher-level constructs, including second-order function references, data structures, and so on. Object-orientation falls out naturally once you get to structures and function pointers.
If you follow this approach, your students will have an understanding of the entire abstraction hierarchy, which is not only of immensely practical value, but also underscores the principle that nothing in this field is "magical". You can always pierce an abstraction, and even more importantly, erect new abstractions where appropriate. The most common flaw I find in programmers is the inability or unwillingness to build new abstractions. The only way we make progress in this field is by the old reductionist approach of breaking a hard problem into smaller parts and attacking each individually. When you teach your students how to do that by demonstrating the power of abstraction, you make them better programmers.
Programmers shown UML, Java class graphs, and so on right away become too familiar with that level of abstraction. They think of lower levels as some kind of magic and don't realize they can and should build their own levels on top of what they're given. The result is often incoherent, rambling, brittle, and ugly code. Don't let that happen.
Perhaps the reason we start at a higher level than BASIC is because we want the kids to get in there and start going first. A hello world program is pretty exciting. But if it takes you a shit ton of time to make it happen you aren't going to capture the attentions. A simple program should be simple. I know I found the underlying structure and commands a hell of a lot more interesting once I saw what their higher level counter-parts could do.
The answer to "Why teach programming with BASIC?" depends on which language called BASIC you mean, and the answers vary from "You don't know better" to "You want to teach them how to write quick one-off VBA macros, not to program" to "You passionately hate your students."
Assuming that you want to teach them to program, use a language that incorporates some modern language features and gives them room to grow, but has enough in terms of training wheels that they aren't distracted or frustrated by unnecessary trivia. Python, Ruby, maybe C#.
Am I part of the core demographic for Swedish Fish?
*peeks at the comment*
*finds nothing to poke*
Check your premises.
I learned to program in BASIC, on an Apple ][+, back in the early 80's when I was 10 or 11. I loved it, but I started wondering how programs like word processors could access a large document in RAM, and work with files bigger than available memory, and other mysteries...which led me to learn C (with a classic Borland C compiler) at 15, and eventually to a CS degree.
In my case, BASIC (and I did LOGO too) didn't ruin me, it made me more curious and moved me into the more complex languages. When I got to college, data structures class was a piece of cake, as I'd already done linked lists and other structures while learning C, and I could easily deal with pointers and pointer arithmetic, multiple indirection, function pointers, and more. I feel a debt of gratitude to the humble BASIC language.
Just a couple weeks ago, I started teaching my son Apple BASIC from a web-based Apple BASIC emulator, hoping that he'll be as excited about programming as I was.
Gee, you might think that name stood for something... I heard about it many many years ago. Some programmer wrote it to be easy for newbs to learn to program with... Now what was it...
Oh yes, I remember now! Basic!
Sarcasm aside, Basic is an acronym for Beginners All-purpose Symbolic Instruction Code, and yes, it was written to be used in teaching newcomers how to program, so it's absolutely no surprise that some people have found it useful for that purpose. (It's about as surprising as finding out that snakes slither...)
When i first saw Scratch, included with the XO, got stunned on how powerful it was, and how visual and intuitivel could be for the children. Not sure if there is a web based implementation, but is open, available for all platforms, and maybe more important, already included in a computer meant for children (not sure how much it count in the rest of the world, but in my country almost all school chidren have it).
10 INPUT "Who is poster?";A$
20 IF A$="plover" PRINT $A;" is a jerk" else 30
30 PRINT A$;" is not a jerk"
There are literally millions of programmers that cut their teeth on little 16K machines with basic in ROM. It stopped nobody from going on to OO languages. Dykstra was wrong.
--
BMO
C# forces one to think in OOP terms - you can't write a hello world app without "class" in it. Now learning OOP is definitely the important part, but it's not the one that should come first - before that, one has to understand the basic blocks of algorithms. Conditionals, loops, recursion - that kind of thing. A language that lets you deal with those without bringing any unnecessary stuff into picture is the language you want to use for teaching programming. BASIC is one such language. C# is not.
I suspect a lot of people, maybe not Dykstra, would point to the failure of Lisps to take hold in the marketplace as evidence that Basic has corrupted minds.
Don't blame me, I voted for Baltar.
Kids are Kids. They should play. The more they play the better. They can learn basic first, then the others.
While i personally always would use an opamp at work to build a precision measurement amplifier, if i had a kid i would start to teach them electronics by building a simple amplifier using one transistor or two.
I've got a big soft spot for pascal. I started wtih basic, and then LOGO (home computer had basic, then logo in school as a kid), but Pascal was the first useful language that actually taught me about data types, functions, and later, object oriented programming (TPv6).
Its easy to read, not prone to bugs like using = when you mean == (in C), and fast enough to get useful stuff done.
Problem with programming these days is that to get anything useful done you're buried under a hundred layers of toolkits and abstraction from what is actually going on.
Give kids an old PC with a copy of DOS, turbo pascal and some basic instructions on VGA mode 0x13 and you can write fun stuff pretty quickly.
I run: Windows, OS X, Linux, FreeBSD. Just because you have a hammer, doesn't mean everything is a nail.
However the statement that "Programmers who've learnt BASIC tend to be harder to retrain in a modern object oriented language" requires statistical study.
Is C# "a modern object oriented language"? If so, then there's a dialect of BASIC that requires little or no retraining because it's functionally equivalent to C#, just with different syntax. It's called Visual Basic, and it's part of Microsoft Visual Studio Express.
I run: Windows, OS X, Linux, FreeBSD. Just because you have a hammer, doesn't mean everything is a nail.
uh... cd 20h = 0xcd 0x20, i mean.
I run: Windows, OS X, Linux, FreeBSD. Just because you have a hammer, doesn't mean everything is a nail.
0x19 was more fun.
Or, you know, there's actual emulators such as AppleWin for the ][ series
How did the author of AppleWin get the right to redistribute the Apple IIe's copyrighted ROM?
I thought he was making fun of reporters when they try to talk about computers.
Duct tape, XML, democracy: Not doing the job? Use more.
1) no type declarations
- it gets in the way of learning how to do stuff
2) interactive command line
- you need to be able to see the variables and change them
- edit run debug is part of the learning process we don't want them separated yet
3) persistent environment
- being able to interact with the variable and program set is part of the learning process
Suitable base types: basic, logo, lisp, matlab/octave
I would really suggest Matlab/Octave for high school math.
For those that hate basic because of the lack of structure, use COMAL. Similar substitutions may be made for the other languages.
(smash (1351))
>> Problem with programming these days is that to get anything useful done you're buried under a hundred layers of toolkits and abstraction from what is actually going on.
Line numbers and gosub/goto s haven't been used since the mid80s.
Ever program with a VBA object model, using Intellisense prompting? Name a better, more complete, and useful IDE environment...
Count curly brackets all you want. Regard semicolons as essential. But you can't craft code that reads like simple English in any other language. Well named objects only make BASIC better.
BASIC is like the O'Reilly cover that was chosen for it: A big friendly St. Bernard or a language.
If you haven't built dozens of useful, maintainable, systems quickly, with small teams, maybe you should keep an open mind...?
"Knowing everything doesn't help..."
The Java and OOP Nazis have been trying to kill GOTO for years
It depends on what kind of Nazis. C# still has it, for one, even though it came long after Java (and is otherwise similar).
Excellent.
Why is it so surprising that a language that was designed to teach programming principles (BASIC) acheived it's goal?
This reminds me of the joke about the programmer who died in the shower: "the shampoo bottle said lather, rinse, repeat".
They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance. - Terry Pratchett
Certainly those of us who write code needed this vocational education, but it is shortsighted or arrogant to think everyone else does.
Granted most will not think of it as a programming environment. But it has all that is needed.
http://www.gnu.org/software/octave/
If then, else for ....
It has all the fundamentals.
It allows you to plot all those high school math functions.
It has a persistent environment/cut-and-paste commands for debugging and looking at your state space.
And it is free to all, so great for the education system.
No, it probably means that most people think procedurally instead of functionally. And while that's just a guess, I'd be willing to bet a case of beer on it.
It also probably means that most everyday problems are procedural/imperative. I'd be willing to bet a case of beer on that, too.
The beatings in academia that people get over the head with functional programming turns off a lot of people. Emphasis on functional programming in academia seems like mental masturbation instead of getting shit done. Kinda like what goes on between pure and applied science and math factions.
"Lisp is superior to everything" - oh hell no. That's like saying a hammer is superior to a screwdriver.
There is space in the toolbox for all kinds of tools. Not everything is a nail. If a problem can be solved easier in a procedural/imperative language, then use that. Similarly, if a problem can be solved easier in a functional language, by all means, use Lisp.
But don't tie your brain in knots trying to fit the problem (or the way you think) into the language.
That's just stupid and masochistic.
--
BMO
Lisp failed for the same reason that HP stack based calculators failed: Most people don't think that way.
When our name is on the back of your car, we're behind you all the way!
I worked for 11 years writing payroll applications in a version of basic. It powered a significant number of payroll systems in the UK and probably accounts for most people's wage slips even today. Now I write web sites in ASP, running VBScript. BASIC lives and will always have a place.
Pro Coffee Drinker
But snakes are better. Kidding aside. Python is based on ABC which was an educational language just the same.
But... the future refused to change.
I bet awk would be a good first language. You can do interesting things almost immediately with it and when you delve deeper you start getting the rudiments of C syntax which leads to a good many of other languages. Plus it gets you thinking about regular expressions. Then you can go on to C++, Java or ruby for OOP.
That was the turning point of my life--I went from negative zero to positive zero.
Just saying...
Employee Of the Month - Cyberdyne Systems Corporation - September 1997
Seems that every time BASIC gets mentioned on slashdot, everybody jumps to the conclusion that nothing has changed since GW-BASIC.
I was programming, professionally, with BASIC, in the early eighties. Never used a GOTO, or a line number, once.
Might also be worth mentioning that BASIC commands are also used in spreadsheets, and other applications.
C# forces one to think in OOP terms - you can't write a hello world app without "class" in it.
It amazes me how people think you're doing OOP just because you're forced to do procedural programming in a class the few times you have to do it.
who learned AppleBASIC, and COBOL, and FORTRAN, I feel the best 'beginner' language is still TurboPASCAL. It's basic enough for teaching concepts, and powerful enough to do advanced techniques before graduating to C++ or Java. If you want a language that's actually used professionally, there's always VisualBASIC, which again can teach you the basic concepts which you can then build upon.
Nothing to see here but us trolls...move along...
As the owner of an HP calc, I have to say that what you say is not really the problem. The problem is and was inertia in the way math is taught. This inertia has led to "one way or the highway" with recommendation by HS math teachers everywhere for the TI-30 and its descendants.
Couple that with the *much* lower price point of the TI-30 compared to the HP "equivalent" (the 10 and the 15), the choice for a HS student to pick the TI-30 style calc is a no-brainer. The love affair with TI then extends into higher education.
Thus, millions of people never *ever* consider RPN. It has led to a stranglehold on the academic market by TI over the decades.
It took me to be out of school to even think of going to HP.
Personally, I won't go back to algebraic calcs. I even use a HP48 simulator on my desktop instead of the regular calculators that come with Gnome, KDE, or Windows.
HP has come up with algebraic calcs over the years. They are always inferior.
YMMV.
--
BMO
You're not "doing OOP" when you're writing a hello world app in C#, of course. But you still get all the extra syntactic and semantic baggage that comes with C# being an OOP-centric language. And when you're teaching someone to code, you have to either explain it, or ignore it - the latter not being a particularly good education technique. It's like teaching basic arithmetic on equations, telling your students to "ignore that X thing for the moment".
loop while( true )
screen.print( "Hello World" );
GRrr!! I typed Screen.print and it just gave me a stupid error! I hate this language!!!1!
"I like to lick butts!" by MobileTatsu-NJG (#32700246) (Score:5, Informative)
My first* programming language was Visual Basic 6. For those who don't know, it used "OOP-lite"--you never had to define your own classes, but you had to use some objects (controls/widgets, for instance). I remember following a short tutorial and teaching myself from there. It wasn't awful for me to learn UI design, basic code blocks, and basic object oriented programming simultaneously by random internet examples and the documentation. (This was back in middle school, and nobody I knew knew how to code so I couldn't ask about it.)
So, I think some level of OOP in a learning language is fine. C# is probably too much. Python in an interpreter might be about right. One thing VB6 encouraged me to do was start my own projects and learn through them. If I was using a simpler but less powerful language I wouldn't have cared enough to get very far.
*I had experimented with MS-DOS batch programming a little bit, including some rudimentary If's and GoTo's. No loops or functions, almost no variables. I'm not sure how much I learned before starting VB6 anymore.
Why C? Because it allows the easy introduction of the mechanisms for expressions, evaluation of expressions, and looping constructs. Then when appropriate theory is taught, objects can be introduced using two of the most common metaphors by branching to Objective-C and C++.
Remember that C is dead simple as a language. Most of the perceived complexity is in the use of the optional libraries. When in a post introduction phase you need say, regular expression evaluation, or something like sparse arrays to match the theory you teach alongside the practical course (catch a theme here?) you have several well designed libraries to invoke. Want an advanced course in generative algorithms? Well, C++ templates can be a very powerful tool. The "C" family of languages covers basic applications level programming to constructs that allow code very close to the hardware.
Post learning C you have the tools to learn other languages without much headache. I love APL, but as a first language its a nightmare (unless you are an engineering, physics or math major and won't program regularly in the real world, then it's a perfect language! Unless you're in the US Financial industry where IBM sold APL and it still is going strong.)... And Dartmouth Basic is the basic to avoid, similarly RPG, and FORTRAN are right out along with COBOL. Each has a place (somewhere far away I hope) in the real world, and except for RPG I've made money on contracts for all of them. But as a beginning language they establish bad patterns of behavior and expectations. Where "C" falls down is that it takes a competent instructor. But I can write a bad program in any language.
Modern "Basic" languages are not "BASIC" as it was from Dartmouth and don't have a lot of the failings or foibles. Real Software has RealBasic which is an awesome cross platform tool, so write once execute a real self contained program on Linux, Mac OS X or Windows xxx. It has Classes and inheritance and mechanisms for interfaces. It has properties for the classes. It is not remotely related to Dartmouth Basic except in the use of Basic as part of the name. I'd recommend it if they'd actually fix bugs posted _for years_ by multiple people to the support forums. It is a nice product for user interfaces, and I still use it when cross platform UI is an issue. But write the backends in C++ sometimes as custom plug-ins. But it is not my first choice for teaching the intro comp sci folks. It is overly complex for a newbie. It requires an instructor that could separate issues from teaching.
Again C to start, object models in Objective-C and/or C++ then complex subjects from there as needed.
- Tjp
I am in wallow with my inner money grubbing capitalistic pig. ... Oink!
Get the kids Apple ][s so they can learn good programming:
* Use RAM and disk sparingly
* Integrate BASIC with assembly
* Write simple drivers and disk routines
* Learn telecommunications from the bit level
* Learn how spaghetti code sucks the life out of you
Logo, BASIC and assembly provide all the fun a kid needs. Well, maybe not all... but a good start to learning CS from the ground up.
Futurist Traditionalism
I originally learned to programming on a Commodore 64 using BASIC. My second language was Logo on the C64. I have since programmed in over a dozen languages, and I don't think starting with BASIC harmed me. It's just a matter of learning that there are alternatives in the newer languages.
I do think that Logo is a better starting language than BASIC, since it has things like user defined functions and better list handling.
Who is poster? plover
plover is a jerk
plover is not a jerk
10 print "hello"
20 goto 10
This is why we can't have nice things.
Oh, that's small potatoes. What we'd do is take all the computers in the lab and write music for them. These were IBM model 25's, monitor and disk drives in the same box. So we'd turn the screen contrast and brightness down to nothing to make them look like they're off while the countdown timer is running in the background. Fifteen minutes into the next class, the computers in the back row start playing the William Tell Overture in unison. We lost our nice things right after that.
Kwisatz Haderach
Sell the spice to CHOAM
This Mahdi took Shaddam's Throne
My first* programming language was Visual Basic 6. For those who don't know, it used "OOP-lite"--you never had to define your own classes
Actually, VB6 did have classes (class modules is what it called them). It didn't have inheritance, but it did have interfaces, and you could use delegation (manually coded) to simulate it. Most importantly, it had true OO polymorphism. So it was technically an OOP language.
On an unrelated note, one nasty thing about learning on VB (or Delphi, or a similar RAD environment) is that it lets one write really nasty code - the "magic button" syndrome is often acquired at that stage - while the output looks conspicuously like a "real program". It's quite easy to fall into the trap of thinking that you already know quite enough for real-world programming. For those who can avoid it, yeah, it's a good introduction to component-oriented / "lego bricks" development.
well, it's been a few years.
Insert an "end" or "stop" in there after the if statement. :-P
--
BMO
So the *BEGINNER'S* All-purpose Symbolic Instruction Code, and a language created exclusively for educational use are great languages for demonstrating and teaching kids how to program? What a shocker. You "surprised" yourselves how/why? By having ridiculous notions that "any idiot" knows how to teach kids better than the experts who set out in the 60's and 70's to EXPRESSLY do just that ?
You've been suckered by language-purists, people who spend so long arguing about WHICH programming language to write something in that I could have written something in ten languages before they come to any conclusions whatsoever. BASIC is *wonderful* for teaching programming. I know, I've done it, from class-mates back in the 80's to modern-day kids nearly 30 years later. And yet my ENTIRE intake year for university sat through a whole year of Java lectures from a qualified professional and still didn't understand what half the statements they were using actually DID, while I didn't attend a single lecture and passed the course just by emailing in the assignments from home 30 mins before they were due. That's not to make me a genius, I was just taught properly, encouraged to learn, and started with simple tools - I wasn't forced to learn, by rote, a complex tool that requires deep understanding to know what it's actually doing. I started on something I *could* understand and progressed in steps. BASIC didn't corrupt me, it was a stepping stone that I outgrew.
When you teach a child to write, you don't teach a 2-year-old quill-calligraphy, or demand their first piece in iambic pentameter. You give them a crayon. If it hits the paper 3 times out of 10 you congratulate them. Then you progress to more advanced things as the need requires. But guess what? If you think that's the last time you'll ever write anything with a crayon, you're wrong. If you're still submitting your CV (resume) in orange crayon aged 30, you have a problem (the same as someone routinely programming important code in BASIC at the same level of experience). But neither should you go and hunt down a quill and parchment to scribble the note that says you're out of toilet roll.
Some people can't understand that BASIC is *excellent* for teaching. It was *designed* that way, and beats 99% of mainstream languages for that. But if your company is still running exclusively off it in 2010, it's a bit like sending out invoices in crayon. However, even in a modern office, sometimes you just need a tool for a small, simple job and sometimes BASIC works fine there (in the same way that scribbling "pay the caterers" in crayon on a post-it is perfectly acceptable as an aide-memoire). There are schools that, without a bit of BASIC, or shell-script, or DOS batch file, etc. wouldn't be filing their accounts, or importing the new student-intake data each year, I know that. When the job is once-a-year, with changing requirements, with specific needs, with various "mental hacks" that have to be applied anyway (i.e. "we need to drop column X this year if column Y is less than 20 because that old law no longer applies"), and needs to be done quickly it can happen in any language you like.
I have taught BASIC only a year or so ago, to a top-class prep-school student, in a single one-to-one session, in a single afternoon. That was from *zero* programming knowledge (but a keen mind), exclusively on paper and the next day they were writing (working) games and hadn't required a single extra tool, library, download, reference or command-lookup - we ran them through QBASIC to see them in action but they worked perfectly. I have also spent several HOURS trying to clean up a single function written by a top-class MSc CS-student that had only ever been exposed to Java in order to find out WHICH of the several dozen syntax errors, scoping errors, operator-precedence errors, etc. was actually the main cause of their function returning junk. I could have taught them a whole programming language AND done the same job quicker than I could teach them to d
No, it's a worthwhile comment. He could have phrased it more diplomatically but it is a useful thing to know.
C, C++, C#, Java, Ruby, Python, assembly... - these languages and all others are tools. They go in the toolbox and are brought out as needed. Each does something better than the others.
Were I to write a VM I would use C as well. A good way to think of C is "user friendly assembly". This is an excellent language to use for an interpreter. For a VM you want SPEED. So you need something with as little baggage as possible. It must be fast, and C has that going for it. After primary compilation it creates asm files. So why not go straight to assembly? A VM is complex. For something huge and complex ASM is a little too fine grained. You want C. So C was used. Best tool for the job.
Writing a gigantic user space application? C may not be your best bet. A lot of those types of programs spend a lot of time just sitting there waiting for input. You may not need anything that optimized. A big fat high level object oriented language can be a better pick. That's where Java/C# shine. You can do a lot with the fat libraries that go along for the ride. The UI creation is simple. Lots of bang for the buck.
Match tool to task and you'll make better software.
Weaselmancer
rediculous.
...but I question the merits of a language that doesn't implement FOR or WHILE. Loops are a pretty important part of a language, and having to implement them using GOTO is stupid.
BeauHD. Worst editor since kdawson.
everyone wants to raise their kids the way they were raised. The way they were raised was the best way simply because its the only way they know and as far as they are concerned, they were raised just fine.
Although in this case it should be easier to rate which one is better, i'd go for whatever language is easy for the childs age, they will eventually learn to detach the logic from the code after a few languages unless you are worried that learning another language will cause them to lose interest so hook them up on any language/system with a lot of visuals.
I think there's a lot of benefit gained from learning how the underlying guts of things work.
For one, understanding the underlying guts can help a lot in understanding why something is failing in a mysterious way.
For two, it would be a serious problem if the art of implementing the lower-level guts of a system stopped improving. The attitude of "It's already done, why mess with it?" means that we'll end up systems which don't reach their full potential because nobody is trying to improve the bare-metal.
I think it really helps to use an interpreted language with an "immediate" mode (just type a statement and it is executed on the spot) if you're trying to get non-programmers interested in programming. The first two languages I learned (back in 1976 or thereabouts) were BASIC and FORTRAN. Of the two, BASIC was easier to pick up and (quite frankly) more fun, precisely because it was more interactive.
These days most of my "real work" is done in C/C++ and Python. I would argue that today, Python is a reasonable first language. It is simple enough that someone can easily learn the fundamentals and make it "do something"; yet it is also powerful and expressive enough to build complex real-world production systems with.
My favorite was
10 dim x = 1,000 ... and make sure you save it under work3.bas or something so it gets mistakenly run. The joys of being immature at highschool. The good old days.
20 if x= x mod 2
30 sound 30,20.15
40 color 45,20
50 print "I am super GAY!"
60 else
70 sound 40,20,35
80 color 55,15
90 print "No really I am GAY!"
100 goto 10
http://saveie6.com/
First programming language I ever learned was BBC Basic on an Acorn Archimedes computer. A fantastic language which was easy to pick up and start working with.
I feel very, very fortunate that I caught the tail end of the time where easy programming environments were bundled with computers, since learning those concepts at an early age is what has allowed me to learn the other languages I do now.
Surely it must be harder for this generation to really start programming, at least on the desktop, without such accessible environments?
I don't think people realize there is more to Logo than turtle graphics. It is essentially a dialect of LISP and has very powerful list processing and array features. And using property lists you can build data structures from it.
People have built binary trees and small personal database apps from Logo. While the data structure support isn't as powerful and flexible as what you find in C, Java or JavaScript, it is sufficient for a teaching language.
I think a Logo and/or BASIC for iOS and Android might be just the ticket to getting kids involved in programming. Fiddling around with turtle graphics on a mobile device in quiet boredom seems like something today's kids might actually do. (how long can you play Angry Birds before you need a break)
“Common sense is not so common.” — Voltaire
With classic screen-editor BASIC, you can just type in PRINT "1+1=";1+1 and immediately see the results. Once you've entered in a program, you can interactively do things like A=3:GOSUB1000 and try out a sub-portion of their code.
This sort of interactivity is completely lost in programming languages that have an edit/compile/run cycle, to the detriment of stark newbies getting to play around with the language and just "try stuff".
Lisp is my main development language. It and some of the other dynamic languages of today do keep that interactive prompt for the user, letting newbies play and letting seasoned developers test/debug very quickly. When it comes to being beginner-friendly, I think this interactivity with the language environment is the most important aspect, and it doesn't have to be tied to just "simple" beginner languages.
I think Ruby fits that bill better than BASIC. Starts out without needing the baggage, but when you're ready for structured programming and objects, it's all right there.
And you avoid learning GOTO. I don't care how easy it makes initial learning, it's building bad habits that you're going to spend years killing.
Don't thank God, thank a doctor!
Agreed, but I think Python is even better for that purpose - less things to deal with. And it has a decent turtle graphics library, which is a very good learning aid.
I started with BASIC, like a lot of hackers from my generation. Learned LOGO as well, then on to 6502 ASM, Pascal, 8086 ASM, all on my Apple //e! BASIC gives immediate feedback, and so it good for the beginner. I think starting someone on OOP or other advanced concepts from the beginning is a mistake, since students need a rudimentary understanding of basic programming concepts first, which BASIC and LOGO do very well. I guess I'm saying you can't understand the real power of modern OOP languages without doing it "the hard way" first.
Nitewing '98
Everything works...in theory.
I was one of those poor ruined youths deluded by BASIC.
Better to go with Python or Perl, imo. Not PHP...no need for that.
expandfairuse.org
Massive javascript attack. Also https by default.
You are being MICROattacked, from various angles, in a SOFT manner.
Ruby is a terrible language to teach programming, there is so much stuff that needs to be used responsibly. While the language is nice to read, monkey patching and other stuff should not be an option for someone learning programming basics.
For teaching general programming in my opinion is the best language by far. The 'Zen' structure provides consistency when learning the language. The only thing i don’t like about python is the using indenting instead of end or ;.
The problem with C++ is that it has to run in a slow interpreter, which adds overhead and makes things slow.
Ur doin it rong.
I think you proved my point eloquently.
John
In my 20+ year career as a software engineer I made the most money writing Visual Basic code. Of course it was more professionally rewarding to do C, C++, ObjC, Java, etc... But, I definately got paid the most for VB applications in the financial sector. Funny, because I probably spent a lot more time mastering the other languages and their development tools than I did learning BASIC and VB.
I hunted down a pile of Commodore and Atari 8-bit systems in order to teach LOGO and BASIC programming to my two sons. The languages are immediate and responsive with a direct response to user input in a way far long lost in 'modern' development environments like Visual Studio 2010. The clear syntax of these two languages gives a child an easy path to comprehension that one command like: LEFT 34 makes something happen on the screen that you can immediately view.
The old "Hello World" sample application can be completed in 2 or less lines long in these languages. C++, C#, F#, VB.NET, etc... all fail to deliver such an accessible learning path, and that is why they fail to surpass 25+ year-old systems.
I believe that this approach has been a success. This year my eldest asked for the Flash development environment for Christmas...
You had me at 10. :)
(Not mine, I'd give credit for this one, but can't remember who came up with it...)
"Slow down, Cowboy! It has been 3 years, 7 months and 26 days since you last successfully posted a comment."
And you avoid learning GOTO. I don't care how easy it makes initial learning, it's building bad habits that you're going to spend years killing.
Now what's wrong with goto? It's a perfectly valid statement when used appropriately, just like any other statement. What's wrong is this old dogma that tell young people to not think for themselves and instead just repeat what everyone else says.
Agreed. Based on bitter experience much of the "OOP" I have seen over the years has just been "COBOL in drag". I even tried to tried to teach a class on it where I was working and with in 15 min. my manager, who considered himself to be an OO programmer shut me down. He didn't get it when I started talking about leveraging patterns, aggregation, base class calls, MVC, among other things.
This pretty much undermined my position as a team lead and senior staff at the place. I left about 6 months later.
putting the 'B' in LGBTQ+
Clearly, he provided his own buggy handler for the 'out of shampoo' exception. If he had simply failed back to the OS, he'd be alive today. 'MOOOOOMMMMM!!!!....'
I found a free HP48GX thang for the iPad recently -- made my day. Now I have two hardware versions, a 48 and a 48GX, a 48 emulation on my Mac desktop, and a 48GX in my iPad. I feel... "covered." :)
I keep HP 12Cs around in about the same places, too. That thing does an awesome job with loans and the like.
I've fallen off your lawn, and I can't get up.
I have been teaching my daughter to program over the past couple of years. Logo and turtle graphics were certainly good to start with. But there is *nothing* in BASIC that is easier/better/clearer/friendlier than Python with Idle. Ditch BASIC. Start your kids on Python. Go get the "Hello, World!" book by Sande and Sande.
Yes, I did my first programs in BASIC -- on an ASR33 with an acoustic coupler modem. This was *hot* stuff at the time. (The MITS 8800 and the ability to solder together your own computer was still three years down the road.) Stored my programs on punched paper tape. I loved it at the time, but sheesh already, let's move on.
Python treats whitespace as syntax.
Yes, and that's one of its stronger side. Using whitespace to delimit blocks of code is very natural to someone with no programming background.
That was demonstrated to be absolutely stupid 30 years ago.
It was?
At least the FORTRAN fucks had an excuse with punchcards
The way FORTRAN used significant whitespace has nothing in common with the way Python uses it, except for the fact that it's significant.
No offense, but take a breath
Judging by the overall tone of your post, you should really take your own advice.
I'd agree that interpreted languages (with BASIC and Logo being examples) are great for programming. The edit/compile/run cycle causes too much friction, discouraging kids from experimenting.
But having taught hundreds of kids programming, there's a huge difference between BASIC and Logo. Logo is a simple but powerful language that teaches kids how to express what they want to a computer. BASIC is a complicated but limited language that mainly confuses kids and teaches them loads of incorrect beliefs that make it hard for them to eventually learn to express themselves clearly. Certainly starting with BASIC can be recovered from (Dykstra was being overly dramatic) but I would advocate doing that to anyone on purpose.
Of the introductory languages that I've taught, I think that Logo was the best introduction, because it's the simplest, most natural syntax, with the ability to easily generate graphics that engage students. And while most people don't notice, Logo is a fully expressive programming language.
For comparable, but more modern languages that are good for introducing kids to programming, there is Scratch (http://scratch.mit.edu/), which is friendly and interpreted and visual. Also free and open source.
Reading the ClubCompy web site, they built something that is intended to be simple for kids to experiment, with no install, and thus is a "computer" interpreted in JavaScript. This seems like a nice idea. No real connection to BASIC or Logo, other than they want to achieve the simplicity and openness to experimentation that those languages represent. After giving it a look over, I like the fact that their language based on LOGO, but am not thrilled that they added LINE NUMBERS. I can't believe that it's a good idea to make kids learn about line numbers, with all of the associated complexity, rather than to use a simple text editor. The only reason that line numbers ever made sense is that back in the era when BASIC was invented, you couldn't assume a text editor, or even the ability to move a cursor on the screen (remember working on printing terminals?). But I think that limitation no longer applies. So while I like their goal quite a bit, I have a feeling that they would have been better off sticking with an existing simple language, such as python, lua, or even Logo.
Enable 3D printed prosthetics!
What do kids want? That's the first question, because you cannot teach children something they do not want to learn. For reference, see schools. If you want your child to WANT to learn, give him something he likes.
Now what do kids like? In general, at least in my experience, this can be summed up in a few key parameters:
1. They like things that affect their world. They like to see that what they do has some impact on the world around them. Ever been in a train where some child keeps pressing that "stop at next station" button at every single damn station because he loves to see how the train reacts to it? How it makes the train stop (even though it's more an indirect result of them pressing it)? Kids like to see that their world acknowledges their existance.
2. Kids like to show off. When they do something, they want to show that they've done it. That's one of the reasons kids like to draw, they can take that sheet of paper and show it around to everyone who wants (or doesn't want) to take a look. Later they might build something out of Lego or other things we give them to "build stuff" and we'll get to see what they built. So think twice before you buy your kid that Lego box, you'll have to admire the result!
3. Kids like the idea that they've done something by themselves. If you ever gave your kids some model kits, you know what I mean. They want that sense of accomplishment, that they have completed something and that they have done some "good work".
What I would hence suggest is not to "bore" your kids with programming languages that do not produce anything that affects their environment, anything they can carry around and show to unsuspecting relatives or anything you couldn't have done better. Especially when you're a programmer, your child will have a hard time stepping out of your shadow.
My suggestion, as radical as it may sound, to introduce kids to programming and computers in general, is microcontrollers. They are the perfect combination of everything above and has a few additional goodies: They give them something that will affect their world, provided they learn enough about them to, say, create some blinking leds or control servos with them, it gives them something they can carry around and it offers them manageable projects that scale well when their skill increases.
And besides programming, you teach your kids something about electronics, and once they learned the basics they can even start to create their own projects that actually have a goal they set themselves (important for kids, they are very hard to motivate for some abstract "learning goal"), and even small projects give them a great sense of accomplishment.
You can even program most of those Cs in C these days, though I would actually suggest (radical that I am) that they start with assembler. Odd as it may sound, I think kids would have an easier start with it, since they're not set in procedural and OOP thinking as we are, and in general C assembler is easy enough and straightforward enough without the baggage that weighs down i386 assemblers (there's rather little to take into consideration with Cs, they have very small capabilities). That way kids also learn automatically the foundation of programming, why there is a stack and what it does.
Yes, that will take them much longer to become OOP programmers. But kids have something we grown ups usually do not have in such extreme quantities: Time. When you start your child at age 10 with Cs, they have a decade before they have to be "productive". That's plenty of time for them to switch over to OOP and "higher level" languages later, and they will have a fairly easy transition, considering that Cs and assembler will have taught them a very important skill: Being observant to detail.
We used to have a Bill of Rights. Now, with the rights gone, all we have left is the bill.
The smartest programmers I've met are the ones who know their low-level stuff. Until you understand the nuts and bolts you're just a part-swapping-monkey.
Yes, and that's one of its stronger side. Using whitespace to delimit blocks of code is very natural to someone with no programming background.
...yes and no. Yes, it does help that it visually looks close to what it should...
But a tab is different than a space, and that's going to confuse some newbies.
Don't thank God, thank a doctor!
Ruby is a terrible language to teach programming, there is so much stuff that needs to be used responsibly.
In what way is it different than any other language?
Basic has GOTO. Java has ==. C and C++ have pointers, pointer arithmetic, memory allocation, etc, on top of goto and similar == problems.
monkey patching and other stuff should not be an option for someone learning programming basics.
Practically, it isn't. Someone learning programming basics likely wouldn't run into monkey patching.
Don't thank God, thank a doctor!
I actually did think for myself when I rejected GOTO. I actually went back and read the "GOTO considered harmful" essay.
Can you provide an example of when goto is appropriate -- in particular, when it's appropriate to use a goto rather than actually structured programming, or even a safer option like break, return, or throw?
Don't thank God, thank a doctor!
I think the fact that high school maths teachers are recommending calculators at all points to what's wrong with maths teaching, but maybe that's just me.
Every bloody emperor has his hand up history's skirt [Peter Hammill/VdGG]
But a tab is different than a space, and that's going to confuse some newbies.
Personally I think they made a mistake in that regard, and should have outright prohibited a mix of tabs and spaces for indentation within a single file. In practice, though, it's not a big deal - everyone sane just uses spaces anyway, and most (all?) Python IDEs are configured that way out of the box. There's simply no way you can easily insert a tab in the middle of the code there.
I actually did think for myself when I rejected GOTO.
Did you reject GOTO as a way to forever avoid writing anything in assembly?
I actually went back and read the "GOTO considered harmful" essay.
Yeah, Dijkstra was *pissed* that Wirth changed the title. -- You know, because it misrepresents the content of the letter. (letter with original title)
Can you provide an example of when goto is appropriate -- in particular, when it's appropriate to use a goto rather than actually structured programming, or even a safer option like break, return, or throw?
Why, Yes, I can. How about an example from the Linux kernel which is very well defended by Linus Torvalds? Good enough for you?
Required reading for internet skeptics
I don't have my dog eared copy with me...
(but Newfies are big, smart, friendly, and loyal dogs!)
"Knowing everything doesn't help..."
One, to avoid repeating cleanup/logging code when an error occurs within a deeply nested conditional. There are many who disagree with the use (or overuse) of exceptions, especially when used to control normal flow rather than catching true errors.
Two, when you're writing in assembler.
P.S. reading an essay, especially a polemic one, hardly counts as thinking for yourself.
Confucius say, "Find worm in apple - bad. Find half a worm - worse."
I was careful to say "you never had to define your own classes", instead of "VB6 doesn't allow you to define your own classes". I've used class modules (though they suck, compared to other language's classes). By "OOP-lite" I meant the programmer could avoid dealing with most of the complexity of OOP very easily, not that it was entirely absent from the language.
Nasty code was certainly a problem of mine. Some of what I wrote was just awful. I think a whole bunch of that was because I taught myself and had nobody to review my work, which isn't the case in the classroom-style setting of the original question.
10 comefrom 30
20 print "hello"
30 rem this line is for compatiblity with different comefrom implementations
If all you have is a hammer everything looks like a nail.
Maybe it was just a really really big bottle?
Confucius say, "Find worm in apple - bad. Find half a worm - worse."
No, it probably means that most people think procedurally instead of functionally.
Most people learn to program procedurally instead of functionally or logically. Actually, now it's shifted to OOP and hybrid languages with functional features. Funny how once upon a time OOP was in the same boat as functional, logic, stack or array-based languages. Goes to show that people can change how they think about programming. Actually, it's funny how people used to write in machine code, without any higher level abstractions.
It also probably means that most everyday problems are procedural/imperative.
Or it means that there is more than one way to solve most everyday problems.
Kinda like what goes on between pure and applied science and math factions.
Wait, so applied science doesn't utilize math or theoretical science?
"Lisp is superior to everything" - oh hell no. That's like saying a hammer is superior to a screwdriver.
Right, but it's interesting how many languages have been influenced by Lisp. Including the imperative and OO languages of today. Most languages are now hybrids with features initially found in Lisp. For example, It was funny when Sun bragged about Java being a garbage collected language. The first Lisp implementation had that in 1960. For that matter Smalltalk had everything Java had and more in the 70s.
I mean, after having them spend a couple of months:
only the most brave, geeky, girlfriend-less boys will be ready to join us....
Why can't
BASIC, you are fucked. It's not like that since I was interested in BASIC as a kid and did pretty well at it too. Then I moved on to C/C++/Java/Python/Perl and all that and I can code well. I think that it has even helped me to understand some languages like assembly more.
http://archeleus.com/blog
If within 15 minutes of teaching OOP you're already discussing patterns, aggregation, base class calls and MVC, you're probably moving too fast. Okay, perhaps not base class calls, which are pretty fundamental.
All those concepts follow only after you discover that OOP isn't a magical bullet either, and can get you in just as big a mess as procedural code. COBOL has structured methods and patterns, so does OOP, but that doesn't mean you should start out teaching those before teaching what those methods and patterns actually apply to.
I'm assuming this was "OOP for beginners".
Slashdot social media options: AIM, ICQ, Yahoo, Jabber and Mobile Text. Why no MySpace?
Yes, and that's one of its stronger side. Using whitespace to delimit blocks of code is very natural to someone with no programming background.
...yes and no. Yes, it does help that it visually looks close to what it should...
But a tab is different than a space, and that's going to confuse some newbies.
Which, IMHO, makes it bad.
Whitespace should be used to make sourcecode easier to read. Forcing a specific way of using whitespace makes it harder as I'm unable to line up things to show relationships or patterns in code.
Should a programming language give you the flexibility to creaty both true beauty and utter shitpiles or should it force mediocrity all the time?
Slashdot social media options: AIM, ICQ, Yahoo, Jabber and Mobile Text. Why no MySpace?
Monkey patching is probably a bad example when i think about it.
The main reason i was thinking of is that there are multiple ways to do the same thing. Some generalized example would be: ... can be use to generate the same resault (where to use each one is not immediately obvious if your witting your first program)
Different syntax for writing blocs one or multiple lines
For/while loops can use *.each, num.times
Procs and lambdas
These make the code readable as English with poor syntax but hide basic coding structure.
Mainly python is a similar language but just so much better for teaching programming, i can see no reason to pick ruby. I prefer ruby as a language because of the choices but they are not beneficial to new programmers
Output:
Who is poster?plover
plover is a jerk
plover is not a jerk
And did you exchange a walk on part in the war for a lead role in a cage? - Pink Floyd.
Surely the important question is whether to edit your BASIC code with vi or emacs?
AT&ROFLMAO
I've taught five groups of 8 to 15 "work experience" kids from local high schools, year 10 to year 12 (15 to 18yo), using http://squeakland.org/ Etoys. Most of them hate computing classes they do in school: learn how to use Office. I tell them the visual language isn't designed for them but kids 6yo and up. Then I teach them the simple car (turtle-like), the car with a connected steering wheel (functional programming), and then the car staying on track by sensing fences in about 40 minutes. Zero programming experience (in most cases) to environment sensing (I call it AI) programming in less than an hour.
One bright kid figured out how to spawn cars and managed to create a race.
Pick a good look at something modern like Gambas. All Basic goodies, in a GUI-friendly package.
Totally disagree. Iearnt basic back in the 80s - Im a Java programmer now, I dont think its hindered me at all.. Infact, i built a framework based around what I learnt back then, which I use in all my projects, and I challange any java programmer to write things as quick as I can nock up using it:
import static basic.Basic.*;
public class HelloWorld {
static{
Object[] pgm = new Object[1000000];
pgm[10]= print("Hello World");
pgm[20]= Goto(10);
run(pgm);
}
}
The thing is, BASIC encourages use of GOTO, rather than being an unusual thing to use when unusual circumstances call for it. If they call for it.
Using goto everywhere creates code that rapidly becomes an unreadable, unmaintainable mess for anyone else trying to follow it.
I run: Windows, OS X, Linux, FreeBSD. Just because you have a hammer, doesn't mean everything is a nail.
State machines in embedded processors? I've actually had to use GOTO recently just for this one thing so that program would fit in memory, using functions would be too wasteful.
Extreme Programming - Redundant Array of Inexpensive Developers
And you avoid learning GOTO.
What the hell is it with the BASIC detractors just making stuff up? BASICS with full structure have been available since 1982. That's 29 years ago. Seriously, loose the mullet and the walkman and join the present day.
SJW n. One who posts facts.
Whitespace is only meaningful when it separates statements (newline) and it structures code (spaces/tab for indentation). Although the Python coding style suggests against lining it, you can line things up to your heart's content.
This is legal Python:
def my_func_params_let_me_show_you_them(
foo = 1,
bar = False,
egg = None,
spam = [][:],
):
pass
When ideas fail, words become very handy.
Yes, I know mutable objects are a no-no as a default parameter; copying doesn't help. I said it was legal python, not good python.
When ideas fail, words become very handy.
Did you reject GOTO as a way to forever avoid writing anything in assembly?
Perhaps. I certainly reject it when I'm not forced to write assembly.
it misrepresents the content of the letter.
I'm not sure how the original title makes it any better.
Good enough for you?
Probably not, but let's see:
they are often more readable than large amounts of indentation.
Solution: Use two spaces to indent.
But I think the most telling bit is this:
That said, I have used exactly two "goto" statements in all the lines of C, ;)
C++, Fortran 95, and (yes) COBOL I've written since leaving BASIC and
Fortran IV behind. In one case, a single "goto" doubled the speed of a
time-critical application; in the other case, "goto" shortens a segment of
code by half and makes the algorithm much clearer. I would not use a goto
willy-nilly for the fun of it -- unless I was entering an obfuscated code
contest
So, I take it back -- there are cases where a goto might be nice. However, they do seem to be about that rare, so I wouldn't want them in an intro to programming any more than I'd want pointers.
Don't thank God, thank a doctor!
One, to avoid repeating cleanup/logging code [c2.com] when an error occurs within a deeply nested conditional. There are many who disagree with the use (or overuse) of exceptions, especially when used to control normal flow rather than catching true errors.
Why is a goto better than an exception in this case? Seems to me that things like break, return, and exceptions are effectively goto, but somewhat more structured and safe.
Two, when you're writing in assembler.
Fair enough.
Don't thank God, thank a doctor!
Yeah, ideologically Python is all wrong and should be terrible. Trouble is, when you actually come to use it, it's great. So religiously you're right, scientifically the post you replied to is right. Evidence beats dogma.
Quidnam Latine loqui modo coepi?
Personally I think they made a mistake in that regard, and should have outright prohibited a mix of tabs and spaces for indentation within a single file. In practice, though, it's not a big deal - everyone sane just uses spaces anyway, and most (all?) Python IDEs are configured that way out of the box. There's simply no way you can easily insert a tab in the middle of the code there.
And Python (optionally) warns you if you mix them anyway. Just teach that as a mandatory option.
Quidnam Latine loqui modo coepi?
So those who are insecure about their masculinity can use Scheme.
Quidnam Latine loqui modo coepi?
And you avoid learning GOTO.
What the hell is it with the BASIC detractors just making stuff up? BASICS with full structure have been available since 1982. That's 29 years ago.
I think it's a little longer than that: the BASIC on the HP3000 had structured programming (and other modern features), in the 1970s.
Editors are for wimps. Real programmers use Hollerith cards.
Quidnam Latine loqui modo coepi?
At my uni, they assume we know no programming to start with and go from high-level to low-level languages. We start with Haskell, then Java, then C++ (and other languages). Couldn't this work for kids? There's nothing intrinsically hard about Haskell, assuming you have no imperative biases, and you learn all the good habits before you get to use a messy language where you can make stupid mistakes.
I think it's a little longer than that: the BASIC on the HP3000 had structured programming (and other modern features), in the 1970s.
OK, I guess he needs to loose the flares and ghetto-blaser, then.
I'm not an expert on BASIC history. I was thinking of BBC basic, which I used a lot. It debuted in '82. It doesn't surprise me much that it wasn't the first BASIC with structure.
SJW n. One who posts facts.
> 10 INPUT "Pick a noun: ",A$ ;" "; B$ ;"'s you!" ;" "; B$ ;"'s you!" ;" "; B$ ;"'s you!"
> 20 INPUT "Pick a verb: ",B$
> 30 CLS
> 40 PRINT "In Soviet Russia, "; A$
> LIST
10 INPUT "Pick a noun: ",A$
20 INPUT "Pick a verb: ",B$
30 CLS
40 PRINT "In Soviet Russia, "; A$
> RUN
Pick a noun: basic
Pick a verb: program
*Post clears screen*
In Soviet Russia, basic program's you!
> 5 REM Not exactly my old light cycle program after watching Tron back then but still fun!
> LIST
5 REM Not exactly my old light cycle program after watching Tron back then but still fun!
10 INPUT "Pick a noun: ",A$
20 INPUT "Pick a verb: ",B$
30 CLS
40 PRINT "In Soviet Russia, "; A$
> _ *blinking*
~~ Behold the flying cow with a rail gun! ~~
And you avoid learning GOTO. I don't care how easy it makes initial learning, it's building bad habits that you're going to spend years killing.
This is a common criticism - that you will spend 'years' killing the 'bad habits' you learned from using GOTO. I don't buy it. When I learned programming (on BASIC, back then, as a kid, that was 'the' language to learn on), and I progressed from GOTO's to subroutines, it didn't take me "years" to undo the "bad habit". On the contrary, the moment that I understood I had a better tool for so many jobs, I immediately started using that instead. Why would a programmer keep using a tool if it's much worse for the job? It just doesn't really happen. As soon as your programs get longer than a few hundred lines, or you want to start re-using code, you need something better than GOTO anyway ... it's really only useful on a very small scale, it is naturally self-limiting in use.
Also, I think GOTO's have one advantage for a learning language aimed at small children: It's easier for a child to learn and understand, as a building block / stepping stone toward more complex things. For some reason, I even remember this learning process (using basic, that was popular then) when I was a small child, on our 48K ZX Spectrum ... GOTO's were easy and obvious, but I recall seeing these weird GOSUB things that seemed more abstract somehow. But, once they were explained to me, it wasn't that bad.
Finally, any good programmer needs to do significant amounts of assembler at some point in his life, and you're gonna be doing lots of JMP's there anyway, and yet nobody considers that 'learning bad habits', because most people agree that learning assembler makes you a better high-level coder too, and there are reasons for that.
The criticisms against GOTO are largely exaggerated.
I have spent probably years cleaning up and maintaining other peoples really bad code. And yet, of all the horrors in the code I had to maintain, I don't recall once ever encountering a "GOTO problem" in the real world, where any programmer had made a big mess because they had learned GOTO's. Never. I've never seen it, and I wonder if anyone here has actually seen this mythical disaster that learning GOTO's supposedly leads to. There are many other bad habits that cause FAR more damage in real-world programming, and yet nobody even cares to teach those in formal Comp Sci or Engineering programs.
The thing is, BASIC encourages use of GOTO, rather than being an unusual thing to use when unusual circumstances call for it.
But that doesn't matter, because programming itself naturally self-limits the use of GOTO. Why? Because they are only 'easy and useful' when your code is on the scale of hundreds of lines. As soon as you start writing "real" programs, with proper code re-use, GOTO's naturally fall flat all on their own and you NEED to use subroutines.
Nobody in the real world naturally encounters large numbers of programs that are only a few hundred lines long. This is something that by definition happens only in schools teaching programming n00bs.
If you are going to spend the rest of your life developing and maintaining several-hundred line programs written by children, then sure. But in the real world, this mythical threat simply does not exist.
Like for so many others, BASIC was what got me into programming when I was young. It was easy to open up a game I just played, change a line and - whoah - it actually showed the change right the next time I started the program, even if it was just replacing a word or a variable to give me two extra lives.
The sheer ease of creating something myself without spending hours reading a wiki or creating a dozen "Hello World" applications was what fascinated me.
Does BASIC teach you things that are no longer used in modern programming? Absolutely. But any reasonably smart person should have no problem adapting and understanding that when moving on to another language, it does not corrupt your ability to work in other environments.
I started with the Psion Organiser II, more or less the world's first PDA. Amazingly, some of the stuff I wrote is still out there :-).
Personally, I think a device like that would be the best for teaching kids how to code, for a number of reasons:
1 - it is portable. You can play with it wherever you are, and playing is what is needed.
2 - it is always on. Resume wherever you left off (this is better nowadays - the Org II was singletasking, so you had to save code before you could do something else)
3 - it is a simple programming environment. OPL (Organiser Programming Language) evolved to add graphics, but at its most basic (pardon the pun) it was a sort of BASIC with touches of Pascal (procedures, subroutines, typed variable declaration) which made a distinction between source code and "translated" code to run.
4 - you could access the built-in flat file databases. It had a simple database mechanism that you could also reach with your programs, so you could mess around with the built-in database function. As a matter of fact, I miss this simple database mechanism in "modern" operating systems and PDAs, TapForms on iPhone is about the closest I got to it..
5 - it had growth stages. Once you got familiar with the device, you could progress to machine code, bit by bit. You could call certain functions, mess around with buffers - lots of stuff to play with once you knew the first principles. And crash recovery was a matter of removing the battery (which also taught you the importance of saving your work on the memory packs).
6 - it had expansion devices. I learned about barcodes because you could plug in a reader to the Organiser. There was a printer, a mag swipe reader - all this stuff taught me about the technologies we still use.
I agree that "modern" computers are too complex for beginners. I built an Apple II, sorry, ][ :-). I got my first PC because I was given one that was broken (so I learned about MFM drives), but I really got into programming (for a while) with the Organiser because I could change the way it worked to suit me, and it was always around. No need to boot, no great battery dependence (one 9V battery lasted for weeks), and it forced me to memorise structures because a 2 line 16 character display is a rather small window (the later 4 line 20 character display was luxury :-).
If there was a way to bring OPL to a platform like Android or the iPhone I think it would do a great deal to get kids going.
By the way, keeping structures in my head turned out to be a good exercise: it made the film "Inception" easy to follow :-).
Insert
The list handling is great if someone teaches you what it's for. I taught myself BASIC and Logo from the Amstrad CPC6128 manual, and later used that manual as a language reference to implement a Logo interpreter in Blitz BASIC on the Amiga - but I didn't bother with the list handling functions, because I couldn't see the point of them. It was only when I was taught SML at university that I realised how powerful they were.
Someone mod the parent up.
XML is like violence. If it doesn't solve the problem, use more.
Lining up the LHS is one thing. How about lining up the RHS? Or components of a statement? Like the below pseudocode?
;
int x = 0;
int furple = 1;
long foo = onevariablename
+ anothervariablename
+ athirdvariablename
How would you do something like that in python?
Oh that's right. Copying and pasting is FAR more efficient. Cause when you find a bug in the original code, there's nothing easier than locating all the spots where you copied and pasted that code to make similar modifications.
XML is like violence. If it doesn't solve the problem, use more.
Just going by your simplest programs, and I know you mentioned this:
Your main function is declared incorrectly (two points - no return value and no parameters).
You didn't include stdio.h
Almost all C compilers will thereby reject even that three-line C source program with at least one and maybe 3 errors (maybe 1 or 2 warnings instead). All those warnings/errors will say different things and point out different lines with different parts of them being the problems (smart ones might know the include is missing, other might just call it an undeclared function, insufficient prototype etc.). You've just scared off any teacher and any kid wanting to learn it. However, the BASIC is syntax-perfect and will execute on any conforming BASIC interpreter. You don't even need the line number. THAT'S why BASIC wins when teaching kids (especially a roomful of kids).
It depends who you're aiming at but this is EXACTLY why C isn't a good language to start with. In BASIC you don't *need* unexplained mysterious boilerplate. You can explain every damn character and every keyword of the language in an afternoon to a bunch of 11-year-olds (or younger). Even they will typo when copying that C down (colons instead of semi-colons, etc.) - hell, they'll typo the BASIC to death too, but to a less degree - and if you are expecting them to copy/paste, that's a bit pointless (it's like saying "You can write French!" by copying/pasting French words into a document).
BASIC can be learned by a 7-year-old. BASIC can be *self-taught* by a 7-year-old under their own attention span, from a book, with no adult help, and no previous experience. I know. I did it. C cannot (I work in schools, trust me). You have to have a bright kid, who knows what they want to do, and is dedicated enough to do it and see it through no matter what, and quite an extensive C reference / referee.
C is also an absolute PIG to get a working IDE / compile environment that the kids can take home to carry on with and it's all just "black-boxing" things that you think are too complex in order to make things simple (think about it - start with simple and get complex, or start with complex and have to force it into a simplification? How do you prefer your computer AI, for example? Starts easy and progressively gets cleverer, or is insanely perfect but deliberately makes huge mistakes - like standing still 99.9% of the time at the beginning of the game?). You don't need to black-box the complex stuff, it's only there for those people who NEED to use it anyway (even the semi-colons in C are pretty unnecessary, really). If you're not going to write programs long enough to include files yet, you don't *need* the inclusion commands, for example, and using them means explaining them or teaching "magic". Every kid in that class will be include'ing stdio.h in every program for the rest of their lives and have no idea why because you *won't* have time to explain every one of the little foibles of tiny programs like that. With that C program, suddenly you're saying "Don't worry about this bit" rather than "This is a complete, valid, perfect, program that will work anywhere."
BASIC was designed to be taught to children. Most people who started programming in my generation did so on BASIC as children. A lot of them taught themselves. There's nothing *wrong* with BASIC for kids. Sure, when they're older, teach what you like - you *can* teach a young adult any language you like and they'll pick it up if they have the vaguest interest. But for *kids*, BASIC wins hands-down every time, still after 40 years. Just don't learn ONLY BASIC. That's the mistake people should berate you for, it's like using a crayon-only for the rest of your life instead of learning to write with a biro - sometimes a crayon will do to jot down a note even today but you shouldn't be writing your CV (resume) with it.
Personally, I did BASIC -> Z80 assembler -> (moved into secondary school) FORTRAN -> PASCAL -> x86 assembler -> lots of others
...at all, in any language? Is this the modern equivalent of a previous century's idea of a good education, something like all kids should learn Latin and Greek?
I find an automobile analogy is called for: If someone wants to learn to drive, do you start by explaining the operation of internal combustion engine? Compression ratios maybe? Many of the problems programmers of a 'certain age' have come from trying to outguess the compiler/interpreter. A programming language should be designed to express the problem you want to solve, not how the particular processor will actually do it. Logo, for example, is a very long way from assembly code, but a useful teaching language.
When the language is designed to have code run primarily in a linear fashion and doesn't (generally) nest the code into more than one layer deep, then a conditional GOTO is just the ticket for flow control. It's not 'harmful' any more than a hammer is 'harmful' - give either to a ten year old boy and he's going to make a mess, but used in proper context neither is particularly bad.
The funny thing is - all the GOTO bashing by the same people that salivate at the opportunity to throw random exceptions in their code, have them bubble up the call stack and get caught three calls up the stack. Guess what folks : that's the most gnarly and evil reincarnation of the GOTO most of us seasoned professionals have ever seen.
As for why BASIC is such a good beginners language - it has nothing to do with any of the above. It's about instant gratification - when newbies don't know the first thing about what makes a computer tick, being able to copy-type a few lines of text from a book and run it, then start tweaking it and seeing what the changes do - THAT is what hooks the new developer and gets his mind working. All this talk about OOP and high level languages - just scares them off. Get the fundamentals (the way, way low level fundamentals like what a variable is, that it holds a value, that the values can be changed and displayed on the screen, that you can do math on the variables) out of the way first - like showing a kid how to hold a hammer, that you only use it to hit nails on the head to drive them into wood, how the nails hold pieces of wood together - and BASIC is perfect for demonstrating those concepts without all the infrastructure surrounding bigger languages.
(And I can't believe I just defended the use of GOTO. Damn.)
Glonoinha the MebiByte Slayer
LOL! love it
XML is like violence. If it doesn't solve the problem, use more.
Can you provide an example of when goto is appropriate -- in particular, when it's appropriate to use a goto rather than actually structured programming, or even a safer option like break, return, or throw?
There are many examples, but my favourite is when program execution is nested so deep that you save a LOT of time by cutting the gordian knot with a well-placed goto intstead of having to roll back hundreds of levels.
Another good reason is to avoid unnecessary indentations. If I had a dime for every time I saw code like
if (testopt("-h")) {
showusage();
}
else {
rest
of
program
here
}
return;
I'd be bloody rich.
Then there's compound tests where combinations of !, && and || give you a headache. Splitting them up and using a goto can make it much clearer.
It's also worth noting that "break" is a scope-limited goto, yet few have issues with it. Possibly because it wasn't invented when the essay against GOTO was written. But nothing prevents you from replacing the break with a goto and a descriptive label, which can often make it much CLEARER what was intended. If the break is kosher, then how can a goto that replaces it not be?
GOTO is basically jmp. Don't learn GOTO, you can never learn assembly.
He was a "team lead" doing a talk about OOP to other professional programmers at this work. I think 15min is plenty time for his audience.
I made the assumption that he was doing a presentation to other programmers at work because I doubt he was doing an OOP presentation to Sales/IT/Admins.
The only real advantage to BASIC is that it allows for some very quick and dirty code to do some VERY VERY basic things. From that perspective, BASIC is better for showing simple concepts such as a "for" loop, or the use of variables. From there, Pascal is a good language to teach programming structure, since it is a bit more obvious about where the beginning and end of each block of code is for loops(begin/ends that are more obvious than {}). C of course has a similar structure to Pascal, but is a bit less verbose, meaning it can be harder to read, and you can miss a } and have problems with tracking down why something is not working properly.
The big issue is in the introduction to programming, and what is the best way to introduce CONCEPTS. Learning how to program when you are 12 or older would be a lot different than learning when you are younger. So, BASIC to teach some simple stuff early on, but then QUICKLY move to either Pascal or C to teach structured programming.
10 PRINT "BILL RULES "
20 GOTO 10
I typed some slight variant of this program into many a TRS-80 on display at Radio Shack as a youngling.
' is not an apostrophe. ` is.
Pretty good is actually pretty bad.
Almost every time I have found endless columns of code, even written in OO languages, it has always been the case that the programmer responsible learned programming with Basic.
In today's programming world it just teaches people bad habits that they carry across a career.
If you want a kid to learn programming on their own, outside of a class, send them to python.org where they even have materials for teaching programming. I don't know if the results will be better beyond starting them off with a modern language still in use, but the results can't be any worse as far as the bad habits of people weaned on Basic tend to go.
understanding goto is essential, so sure it should be taught. it's a pretty understandable concept too. and you should know probably at some point down the career that someone else might modify your delivered product to do goto style jumps.
and nothing wrong with basic, I started with qbasic and some decade old basic books I loaned from the library(this was probably around ~92-93). also what's fantastic about qbasic is the built in help of all commands(some of them could have had better use cases documented there though).
once we managed to copy a c compiler, it changed everything of course. you see, if you do a line drawing algo on a 386 with qbasic and then with c the difference is so obvious that you don't want to go back to basic.
now what happened later to me was that in the university the coding classes focused way too much on late c++ features and the universitys own hastily invented best coding practices, which in all practicality weren't that practical(whilst the advantage I had when moving to paid coding, was that I actually had to use older frankenstein compilers). which is actually a lot of what in my opinion is wrong with how programming is taught, too often inqualified teachers just teach a certain way of doing things, usually because that's in their teaching material and they don't have that "can do" hacker attitude towards it, also, in the case of the university here, too much was put into what the world would be in couple of years, so they taught bleeding edge c++ features that nobody was actually using or which nobody actually has good opinions if they're useful or not - but teaching of the history would have painted them(faculty) as losers, but it's the stories like how basic was first done that inspired me into getting more into programming and computers in general, that CAN DO attitude and then just doing it and providing a real, useful tool.
what basic is fantastic though for is coding on paper with a pen! and then later typing it in or parts of it. it's also quite easy to follow from source. which I guess was nice back when you might not have had your own computer.
world was created 5 seconds before this post as it is.
Goto provides for the natural expression of a state-machine. The most common example of that is in lexical analysis. Look at the output from LEX sometime; it is chock full of gotos. Most lexical analyzers are done the same way. So every time you invoke your compiler, you probably are exercising goto-laden code.
Some of the more dogmatic try to get around it by using a case statement in a loop (with an enumeration or something controlling the current state). But really the internal structure of the code flow there has nothing whatsoever to do with that loop, and artificially imposing that on it just obscures the state machine underneath.
"While "right tool for the job" is a nice sentiment, it is actually one of the easiest things to say for those that know close to nothing and actually have very little knowledge of the available tools"
Either you're a piss poor troll or you're full of a boatload of arrogant crap.
"quite a bit of real world programming done in Lisp"
Compared to languages like C++, C#, Java, Cobol etc the amount of real world coding done in lisp doesn't even register. I'd suggest you take a tour into the real world occasionally. In the meantime I think the lift back up to your ivory tower is waiting...
In practice, though, it's not a big deal - everyone sane just uses spaces anyway
Really? Why? After all, tab is THE indentation character.
Is this about people who are too lazy to change their tab stops complaining?
Well fuck them.
Ummm... make up your mind.
This code would print (if "plover" was input)
plover is a jerk
plover is not a jerk
I agree with your statement however. To submit that if someone learns BASIC their doomed and can never learn anything else is just, well "stupid".
I started out with BASIC and the maligned GOTO style of programming helped ease my transition to assembler. From there I moved on to structured programming in Fortran and COBOL and eventually C, then OOP when C++ and Smalltalk were available.
No knowledge was wasted and I think it's just as hard for someone starting out with Java/Python/Ruby/(your fav HLL) to fully understand what goes on at the level of the bare metal.
Sometimes the light at the end of the tunnel is the headlight of an oncoming train.
Kodu isn't Code.
It's visual programming. It teaches something utterly different. The real brilliance of ClubCompy is the magazine- I fondly remember coding games from magazines, it's how I learned programming.
And they missed the Kickstarter deadline. Which is sad, because they offered something unique.
SJW: a person who perceives an injustice, and while correcting it, commits a greater injustice.
Well, just because the BASIC dialects you know don't do that, doesn't mean they don't exist. Have a look at PowerBASIC, for example. It lets you either do it the good old "structured" way or the OOP way.
It also has tons of other, nifty features, like inline assembler, pointers and all the stuff you'd expect from a full blown compiler.
Again, PowerBASIC gives you the choice. Either you go with the traditional BASIC error handling (On Error Goto) or you can use exception handling (Try/Catch/Finally).
In my opinion a key point which makes BASIC great as a beginner's language is readability. It's more or less plain english and stays away from all that curley bracket/semicolon stuff. An If/End If-block in BASIC is way easier to spot and understand for a beginner than hunting down a closing "}" (or missing ";").
And no, I'm not affiliated with PB in any way, I'm just a happy and satisfied user who often smiles when typical BASIC cliches come up.
I think it's a little longer than that: the BASIC on the HP3000 had structured programming (and other modern features), in the 1970s.
If a tree falls in the woods.... Seriously, are there any real first-person witnesses to a HP3000 with BASIC actually installed? Granted, I came into the MPE game pretty late, but as I recall, getting BASIC running involved a trip to a far away land, climbing to the peak of a mountain to get tape reels blessed by monks, and forging disc platters in the fires of a volcano. I might be forgetting a step, but I remember it wasn't on the machines by default and getting it running wasn't something you'd care to do.
Can you provide an example of when goto is appropriate
Just go and look at C code, such as the Linux Kernel, it is full of gotos. The way it is used there is simply as form to avoid code duplication for cleanup after errors, kind of like a 'finally' or 'throw/catch' in Java. Something like this:
{
fd = open(file);
if (stuff_goes_wrong)
goto close_file;
if (other_stuff_goes_wrong)
goto close_file;
mem = malloc();
if (other_stuff_goes_wrong)
goto free_mem;
free_memory:
free(mem);
close_file:
close(fd);
}
In C++ you could RAII to accomplish the same thing, but in C you don't really have many other options that lead to such nice code.
My kid is interested in learning how to build and program robots. He *needs* to understand how to perform low-level tasks on a computer-driven machine. I don't think he will be "scared away" by the complexity. I see him being fascinated that he knows what is going on at the lowest level. Oh - he also has an electronics set so that he knows what AND, OR, NAND, and NOR circuits look like. I also plan on showing him exactly *how* a machine-language instruction set is implemented in silicon. He can always think at an abstract higher level even though he knows the lowest levels. However, I suspect that solving a problem at a high-level caused by a low-level aberration without understanding the fundamental low-level representation of the higher-level processes would be quite difficult.
[Citation needed].
Seriously, I started programming in BASIC in the mid 1980s and besides the AppleBasic of the Apple ][, I've never encountered a BASIC dialect that encouraged the use of GOTO or lacked the ability to create/use subroutines.
I'd argue that when you want to teach kids programming, the language is actually rather unimportant. It is the API and the IDE that matter. Have something that allows the kids to use graphics easy without a ton of initialization, have an IDE that automatically jumps them to errors in there code and all the little things like that. QBASIC was pretty good in that regard, it even auto-corrected the upper/lower-case when you mixed it in your variable names.
These days I would probably go with Python/Pygame or Processing as they make it easy to get interesting stuff happening. Python has also the advantage that you can do real stuff with it, when you are bored of toying around.
This isn't dissimilar to what I did to the Apple II machines in my 7th grade math and computer classes. (The math room doubled as the "computer room") I loaded all the machines up with a short program that would perform a countdown to get it a few minutes into the next period and then randomly produce a high-pitched beep every 60 to 600 seconds. If I recall correctly, the speaker was internal to the Apple II so the monitors stayed off. There were about sixteen machines in the room so you can imagine the results.
Actually, do you know how to do something like a Peek on a webpage?
"If character #427 on _____.com page is a 1 , then CanaryTest = True"
It would be a form of notification of sites being redacted to snip out the Bad Things.
My first Journal Entry ever, in 8 years! http://slashdot.org/journal/365947/aphelion-scifi-fantasy-horror-poetry-webzine
This is late but...
I really haven't touched BASIC in over 20 years. The last time I did, it was a one-off "security" login for my mom's PC at work using a language called "ASIC - It's almost BASIC" because I wanted to try it out (it's still available on simtel.net if you want to dig it up)
Yes, BASIC can make you do stupid shit. But that's part of the fun of it. But Dykstra was wrong saying it poisons young minds so severely that they are forever ruined. I went on from learning BASIC on a TI to other languages later on. Millions of other kids did too. There really wasn't anything else for kids in the 1980s besides BASIC and Pascal (or typing in games from magazines in Hex, saved to tape, uphill in the snow, both ways). Dykstra's snide remark paints an entire generation of coders with the same broad brush. It's stupid.
--
BMO
Aha!
Commodore 128. End Of Line
You could both draw lines and use built-in Sprites. (What other machine had native Sprites? I still don't know.)
I burnt out because at 12 I was writing racecar games, shoot-em's, and HuntWumpus-LORD crossovers.
I can still write little exercises to diagram problems I am pondering.
Then the minute I looked at C & Java the lights went off and I lost interest in being a pro dev. Today my interests are all about exploring existing apps.
My first Journal Entry ever, in 8 years! http://slashdot.org/journal/365947/aphelion-scifi-fantasy-horror-poetry-webzine
Well, most every day problems being procedural/imperative is akin to saying most every day physics is Newtonian. Very true, but the vexing computing problems of the day relate to scale, concurrency, and parallelism.
Now people are very much single-threaded, so perhaps the program-as-cooking-instructions analogy and procedural languages provide the best entrance point for many. My first language was BASIC from the days of numbered lines and GOTO. It wasn't the language, but what I could do that hooked me.
GOTO is BASIC's version of assembler's JMP command. Tell me how you would write an operating system without JMP?
Free Martian Whores!
Chris Crawford's (of Atari) articles on writing modular BASIC programs in Personal Computer World were the first introduction to design that I read about ... Keep line numbers 10 .. 999 for the high level order of function calls. Keep different blocks of line numbers for the different types of functions with lines 1000 to 2000 to set up page 6/player-missile graphics, 2000-3000 for the titles, 3000-4000 for main-loops and menus, 4000+ for data, and lines 10000+ for auto-renumbering...
10000 ST=PEEK(136)+256*PEEK(137):INPUT S,E,F,I
10010 L=PEEK(ST)+256*PEEK(ST+1):IF L>=S AND L=E THEN A=INT(F/256):B=F-A*256:POKE ST,B:POKE ST+1,A:F=F+I
10020 IF L=E THEN ST=ST+PEEK(ST+2):GOTO 10010
Vintage computer adverts: http://www.vintageadbrowser.com/computers-and-software-ads
Got started with QBASIC when I was a youngin, wrote a rudimentary wireframe 3D renderer that worked at about 1 frame per second, and I've been hooked ever since. I always had problems with these early classes that I would go far beyond the assignment and get marked down for not following the instructions. Like in this Visual Basic class, we had to do this simple matching game, and I made Wheel of Fortune with Simpsons graphics and sound effects. DOH!
Lining up the LHS is one thing. How about lining up the RHS? Or components of a statement? Like the below pseudocode? How would you do something like that in python?
http://pastebin.com/GjvLbhxZ Almost exactly like you did it with your pseudocode. :-)
In almost every instance, if you're using a goto then you're doing it wrong. In all my years of programming in higher level languages, I've used goto at most a handful of times, and only because efficiency outweighed elegance.
What's wrong is this old dogma that tell young people to not think for themselves and instead just repeat what everyone else says.
It's not dogma. It's experience. There is nothing wrong with imparting wisdom to students in an effort to prevent them from making the same mistakes and errors that others before them made. Unless you're doing low level programming that requires the utmost in efficiency, then goto should not be used.
~X~
Goto provides for the natural expression of a state-machine. The most common example of that is in lexical analysis. [...] Some of the more dogmatic try to get around it by using a case statement in a loop (with an enumeration or something controlling the current state). But really the internal structure of the code flow there has nothing whatsoever to do with that loop, and artificially imposing that on it just obscures the state machine underneath.
And now you've just made a case for tail-call elimination, which turns each state into a function, and each state transition into a (syntactic) function call.
Are you adequate?
I was recently forcibly dismounted from my high horse by Douglas Crockford's comment vis. JavaScript: "It's the only language in the world that people think they can use without learning it first." (from memory, I'm lazy).
Ouchie.
I love python myself, and have always thought "those choads puling about whitespace need to *learn* the language first!". . .then went right on to badmouth JS, Perl and Ruby as utter garbage. Of course they are utter garbage in their own ways, as is python. Of course, all of them are possessed of absolutely fantastic features, otherwise they would not inspire love.
In short: you are all a bunch of douchebags and idiots. I know this, because of my long and storied existence as a douchebagging idiot. Come let us reason together. And drink tea. Pop-Tart?
I didn't find any joy in programming until I got to use real languages. Granted this was decades ago, but when I started with BASIC, Logo and Pascal, I found very little interest and certainly very little joy in it. It was clear they were toy languages and served no real purpose... and I was in the third grade or so. It wasn't until I was introduced to ACOS, then C that I found programming to be fun... because you could actually do something useful with it.
One could argue that you can do something useful with BASIC, but it was a chore if you wanted to do anything beyond crappy little programs that printed something on the screen. Paradoxially, perhaps, but batch files are also something that was fun to program.
If someone had wanted to introduce me to programming and get me interested in it BASIC would have been a total put off... it just happens that I was self-motivated and saw the possibilities in it, so found something on my own that would allow me to realize those possibilities. If it was externally directed, you can forget about it.
I would start a kid on PHP or something that's both simple AND useful.
10 INPUT "Who is poster?";A$ 20 IF A$="plover" PRINT $A;" is a jerk" else 30 30 PRINT A$;" is not a jerk"
There are literally millions of programmers that cut their teeth on little 16K machines with basic in ROM. It stopped nobody from going on to OO languages. Dykstra was wrong.
-- BMO
I've met countless people over the years who say they started programming in basic on 16k machines, and NEVER made it to OO languages. For some, they lost interest, but others simply weren't able to make the jump from spaghetti code to structured programming, much less OO.
Havoc Video
10 print "hello" 20 goto 10
This is why we can't have nice things.
So to prove a language is bad you do something dumb. How about: while(1) { echo 'hello'; } Languages aren't dumb they are a set of rules. Both examples are dumb and should be avoid just because you can doesn't make it right or the language bad. Just the programmer.
You aren't allowed to use the knife anymore either. Too many kids are Terrorists!
My first Journal Entry ever, in 8 years! http://slashdot.org/journal/365947/aphelion-scifi-fantasy-horror-poetry-webzine
Don't help him, he wants to bet allowed to sink.
My first Journal Entry ever, in 8 years! http://slashdot.org/journal/365947/aphelion-scifi-fantasy-horror-poetry-webzine
I dunno. Newcomers can be good at being told to ignore stuff in class.
I had grand fun with basic and then the first time I looked at Java the indecipherable cruft whacked me in the head and killed any interest I previously had.
My first Journal Entry ever, in 8 years! http://slashdot.org/journal/365947/aphelion-scifi-fantasy-horror-poetry-webzine
Yeah, for $1000 you can either get a new gaming rig or a credits mention.
My first Journal Entry ever, in 8 years! http://slashdot.org/journal/365947/aphelion-scifi-fantasy-horror-poetry-webzine
Teaching the Basic programming language as an introduction to programming is a step in the right direction but you really have to understand the point of the education system:
Produce a stream of young adults who are effectively brain damaged and in hock up to their eyeballs.
Now, I will freely admit that Basic accomplishes the brain damage goal of pedagogy, but let us not forget our obligation to saddle the zombies with debt that cannot be discharged by bankruptcy. Unless you charge thousands of dollars to turn young people into brain damaged zombies, how can you honestly call it "education"?
Seastead this.
Why poke around to break Ubuntu when an approved upgrade will do it for you?
My first Journal Entry ever, in 8 years! http://slashdot.org/journal/365947/aphelion-scifi-fantasy-horror-poetry-webzine
Javascript
It has a simple syntax, supports a number of paradigms, and practically everyone has an interpreter for it already installed. It also has a simple, robust UI framework in that interpreter.
The most important thing is a GOOD teacher. I don't mean a diploma and memebership in a union. From gradeschool on up to MS, I've had about six good teachers. I've had many instructors that were decent and tech savy. A good teacher will overcome any shortcomings of the books and tools.
It is very similar to Visual Basic with a nice IDE, but it is free (as in beer and as in freedom, under the GPL license), and works with Linux (it is included in major distributions). http://gambas.sourceforge.net/en/main.html You can easily make GUI applications (GTK, Qt) with the visual form designer (so it is motivating) while learning basic programming constructs (if then, while and for loops, ...) Later, you can use to teach more elaborate stuff like connections to databases (MySQL, PostgreSQL).
My high school received a number of HP 48G calculators. They gave three to students to try out and report on its findings. I was lucky to be one of them. I thoroughly enjoyed the RPN style. Since everyone learns A+B=C style, figuring out AB+=C; or more advanced: AB+D*=C versus ABD*+=C, makes you really think about order of operation and what it means. It also forces you to think about how a computer logic with push and pop.
Yes, the HP-48G and HP-48GX were too darn expensive. It wasn't long after that, that HP took a nose dive in my respectability column (consumer computers loaded with crapware and overly expensive printers and ink). I still love the HP-48 series, though.
I don’t think you actually tried that.
Distributed Denial of APK: It takes 15 seconds to reply to him anonymously, but wastes tons of his time if we all do it.
loose the mullet and the walkman
You mean, of course, to take the rubber band off your mullet, but what would unscrewing a walkman case accomplish?
Amazing how a single extranaous letter can completely change the meaning of a sentence.
Free Martian Whores!
Lisp failed [...]
I'm not convinced that that is the case. Various Lisps (Common Lisp, Scheme, specialized dialects used in particular applications, and other varieties) continue in a number of important uses in production environments, continue to be actively developed, and Lisp features continue to be one of major influences on the evolution of many popular languages as areas that have long been noted as Lisp strengths become recognized as important in modern application development.
How, precisely, is that Lisp is supposed to have "failed"?
You are partly right, partly wrong.
Javascript is one of the most used languages in the world, and Javascript is a functional programming language.
It just hides it, most people don't see it at first.
New things are always on the horizon
Actually, no. That is a backward apostrophe used as an opening single-quote mark in typefaces where the ' looks slanted.
E.g. http://ompldr.org/vNnJ2bQ/untitled.png (Apostrophe is the 8th char in; the ` is directly before the lowercase alphabet.)
Distributed Denial of APK: It takes 15 seconds to reply to him anonymously, but wastes tons of his time if we all do it.
You either have never used OO correctly or don't know what you are talking about. Copy and Paste to reuse code is the worst possible idea. You simply spread maintenance work and bugs through out your code base. Good OO lowers line count, maintenance time/cost and bugs. Bad OO like bad anything can be bloated and the ruination of a project. Modern IDEs and documentation tools allow you to find object and discover methods quickly and as you code. (Think CTRL-SPACE). Large systems with many developers cannot be built in the simple way you suggest. Some larger form of design and control is needed. It does not "need" to be OO but, OO can provide the necessary structure.
No sigs in BETA. Beta SUCKS.
I learned Basic on a Commodore VIC-20 in 1978. I think it is a terrible choice for learning to program. I suggest newbies learn Scheme, a very simple language that will lead you as far down the rabbit hole as you are willing to go.
I learned BASIC, approximately in parallel, on the VIC-20, the TI-99/4A, and a Timex-Sinclair 1000 in elementary school in the early 1980s.
I think its a fine language for learning to program as part of learning how computers work; its high-level enough to be accessible, especially to young students, but structured similarly to assembly languages and provides a good vehicle for teaching about how computers work at a basic level.
I think Scheme is a much better language for teaching how to design programs to solve problems, but the features that make it good for this purpose are precisely the features that obscure the low level process.
Since no one else seems to have mentioned it, I'd like to add a vote for the Netlogo agent-based simulation system as an excellent tool for teaching kids programming. It's not open source, but is free and available for most platforms, has excellent graphics, an easy UI builder, and can be extended with Java code if more advanced functionality is required. I use it off and on to prototype simulations for work, and have found it excellent for many purposes. Last summer, my son expressed an interest in learning programming, so I pointed him to the Netlogo site. Soon he was happily working through the hundreds of examples included with the package, and has since developed some pretty fancy simulations for his school science classes. Netlogo encourages such experimentation, and unlike more powerful languages, allows kids to quickly build useful programs that include fancy stuff like graphical displays, charts and graphs, and complex GUIs without having to do a lot of low-level programming. Take a look....this is NOT the simple logo we all remember from decades ago.
True; I was assuming that
20 IF A$="plover" PRINT $A;" is a jerk" else 30
was reasonably correct. The Applesoft emulator suggests that
20 IF A$="PLOVER" PRINT A$;" is a jerk" else 30
is closer to being correct, but Applesoft lacks an ELSE statement. At which point I realized that hacking the code to excise the ELSE statement would also correct the error I identified originally:
once line 20 is parsed, control falls through to line 30, unless there is an intervening end statement like so.
10 INPUT "Who is poster?";A$
20 IF A$="plover" PRINT A$;" is a jerk" else 30
25 END
30 PRINT A$;" is not a jerk"
35 END
No guarantees on whether this will parse on any given machine.
It's the equivalent of writing a C switch statement without break; statements.
Lol, I remember doing that in middle school programming class with qbasic, and running it on every one of the library computers. Then standing off in a corner chuckling as the librarians scrambled to fix the problem. It only got funnier when I learned how to disable the scroll lock key (the only break sequence the librarians knew was ctrl+scroll lock). It was hilarious to a teenage kid, even after I got sent to the principal.
(There (is (nothing (wrong (with (lisp (damnit(!))))))))
I second that: PHP (from the command line) would be a great language to learn. Uses simple text files, no compiling, reasonable error messages, and it is enough like C/C++/JavaScript/Java that a person could transfer most of their experience into any of those languages.
The same reason we teach kids math. Teaches them to think for themselves and to understand exactly what their graphics based editors are doing for them. Or at least get their mind to a point where they can think openly and creatively.
"Instant gratification takes too long." - Carrie Fisher
and how is GOTO different than exception handling? You can put lipstick on a pig, but it is still a pig.
I haven't programmed in BASIC in many a year and it was my first programming language so I didn't know much about it. From what I can recall the main issue with GOTO was that it was a crutch for not having user defined functions.
I recently employed "goto" in a Perl application. You put a label and can then jump to the label. Its just a more generalized version of using break, continue, etc. In this particular case it was clearer to use the label and jump to it (as part of error handling) than trying to kludge some nasty code up for the sole purpose of avoiding a goto.
Its also the first time I've used such an explicit jump in many years because, generally, there *are* cleaner syntaxes. But those other syntaxes aren't always the best syntactic sugar.
And break, return, throw -- these are all goto statements. Gussied up and renamed, but goto nonetheless
http://karel.sourceforge.net/ Technically my first exposure to programming was a loop in BASIC that printed hello world, however, I was fond of Karel as my second encounter with programming. It has a very small instruction set (prevents kids from being overwhelmed and forces them build more tools with procedures) and can keep their interest because it is a game/puzzle.
And seeing the mess teaches the need for more structure. As long as the teaching doesn't stop there, I find this perfectly acceptable. You don't want to start learning programming with every possible pitfall in mind - you want results, NOW!
> I actually did think for myself when I rejected GOTO. I actually went back and read the "GOTO considered harmful" essay.
>
> Can you provide an example of when goto is appropriate -- in particular, when it's appropriate to use a goto rather than actually structured
> programming, or even a safer option like break, return, or throw?
When you're telling the CPU what you want it to do ?
Show me an object orientated CPU
Show me a CPU without a jump instruction
-- kjh
Another good reason is to avoid unnecessary indentations. If I had a dime for every time I saw code like
I know return is effectively a goto, but I do prefer it, along with break, continue, and exceptions, as a more structured approach. So I'd do:
Pretty much the same as:
It's also worth noting that "break" is a scope-limited goto, yet few have issues with it.
Well, precisely because it's limited in scope and much better defined. I also have far less of a problem with, for instance, the way Java handles references than with the way C++ has stack objects, references, and pointers, complete with pointer arithmetic. It may be the same thing in some abstract sense, but there's far less opportunity to screw it up.
Don't thank God, thank a doctor!
and how is GOTO different than exception handling?
Exception handling is structured, and it does things GOTO can't, that I know of. For instance:
This puts the actual error-handling code somewhere up the stack where it's actually relevant.
Its just a more generalized version of using break, continue, etc.
Well, in the same sense, it's also a more generalized version of a loop, but you still use structured loops, don't you?
Break, continue, return, etc, are all limited in scope. They do one thing, and do it well. Aside from being clumsier for the things I'd use a break for, goto can take me anywhere else in the program.
Don't thank God, thank a doctor!
When you're telling the CPU what you want it to do ?
In what sense?
I'm telling the CPU what to do when I type here, but I'm certainly not giving it a jump instruction, or any other instruction, manually. I'd have to be insane to do so just to type up a Slashdot post.
Now, if I needed assembly for some reason, yes, a jump instruction becomes relevant. I can't remember ever needing assembly for anything.
Don't thank God, thank a doctor!
Have a look at PowerBASIC [powerbasic.com], for example.
DOS/Windows and proprietary? No thanks.
In my opinion a key point which makes BASIC great as a beginner's language is readability. It's more or less plain english and stays away from all that curley bracket/semicolon stuff.
So does Ruby. More so, I'd argue.
Don't thank God, thank a doctor!
Why would a programmer keep using a tool if it's much worse for the job? It just doesn't really happen.
You're lucky, then, or exceptional. Or at least, speaking only for myself, I do have to spend years building habits like version control (killing the bad habit of commenting tons of stuff out and in to make it work), automated testing and especially any sort of test-first development, and so on.
Also, I think GOTO's have one advantage for a learning language aimed at small children: It's easier for a child to learn and understand, as a building block / stepping stone toward more complex things. For some reason, I even remember this learning process (using basic, that was popular then) when I was a small child, on our 48K ZX Spectrum ... GOTO's were easy and obvious, but I recall seeing these weird GOSUB things that seemed more abstract somehow.
I remember that, too. But I also remember that when I first saw functions, they made sense. Maybe the GOSUB syntax was just unhelpful?
Finally, any good programmer needs to do significant amounts of assembler at some point in his life, and you're gonna be doing lots of JMP's there anyway, and yet nobody considers that 'learning bad habits',
I would say that's mostly because assembly generally isn't taught as a first programming language. By the time you learn assembly, you already understand structured programming and why it's a good thing, certainly by contrast to assembly.
There are many other bad habits that cause FAR more damage in real-world programming, and yet nobody even cares to teach those in formal Comp Sci or Engineering programs.
I'd certainly like to hear about those. I'm in an odd situation where instructors in my formal Comp Sci program actually listen to me. (Of course, it's academia, so even if they took me as seriously as I'd like them to, it'd still take years to change...)
Don't thank God, thank a doctor!
That's pretty stupid. If you can learn GOTO, you can learn jump. But until you need it for assembly, why would you want to?
Don't thank God, thank a doctor!
The main reason i was thinking of is that there are multiple ways to do the same thing.
And why is this bad?
For/while loops can use *.each, num.times ... can be use to generate the same resault (where to use each one is not immediately obvious if your witting your first program)
Same problem exists between for and while. Every language is going to have some sort of choices built in.
I don't know if I have an intelligent response, other than to suggest you go to tryruby.org and type 'help'. It actually makes the idea of a "block" feel natural, and they're covered before any actual loops happen.
Don't thank God, thank a doctor!
Tryruby.org is for people with knowledge of another language not for teaching basic programming principles.
Though i have no first hand experience at teaching ruby, people who were to learn ruby would either learn to stick to small subset of the language due to experience of felling like a complete idiot for not getting some of the difficult concepts require to understand the fun stuff in ruby. Or in case of self learning and searching for example code to solve problems will also encounter these concepts. I learnt C in a course where people had the option of not taking further programming courses and took it because they chose to bullshit there way though it rather than struggle to get there head around things, trying to get ruby would be much harder.
I guess it would not be bad if you just wanted to teach the basics of ruby, but they would then have to completely relearn everything to move to other mainstream languages and not also understand the stuff that makes ruby a good language.
Python as other people have said is the best possible replacement to basic. While you could use ruby there are a number of pitfalls and problems that i don’t think python or other more consistent languages would have. Read the 'zen of python' i keeps confusing parts of the language to a minimum.
Tryruby.org is for people with knowledge of another language not for teaching basic programming principles.
If you say so. I've seen people who don't know anything about programming follow that tutorial well enough.
they would then have to completely relearn everything to move to other mainstream languages and not also understand the stuff that makes ruby a good language.
Maybe. But some of that stuff is pretty accessible. Try going back to setters and getters in Java after using attr_accessor.
Don't thank God, thank a doctor!
It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration.
Edsger W.Dijkstra, 1975
Like you, I first learned BASIC at a tender age; actually a decade before you did. Back then, it was all self-teaching, of course. That's the ease of BASIC, and was also the start of the problem. We had no schoolteachers who knew programming, so they let us work alone on terminals in the back of the math or science rooms. We taught ourselves programming in sequential steps, because that's what we saw, and it's what the language gave us to work with. We never learned to think about or recognize "discrete units of work," unless it was something so big and often repeated that it would save line numbers if it was turned into a GOSUB call. Every variable is a global. No code is named, except by line numbers. The closest thing to a reference was an array index. We didn't have code reviews to learn from each other. And nobody graded our code; if there was any academic look it was only to "ooh and aah" at the results our teachers could never hope to duplicate.
And external learning opportunities were awful. The programs printed in Creative Computing were horrible examples. Even programs that could have been OK to learn from were then scrunched down to save on line numbers and column inches or to fit inside a 16K machine; any elegance they may have had was lost to compression.
Sure, you can accomplish a lot of stuff in BASIC, but everyone reaches a wall where the programs were no longer maintainable. We didn't even recognize why; just that there were many line numbers to juggle, and variables named A, A1, B$, and C7 to keep track of, and never enough extra space between line numbers where we needed them most -- which caused odd little subroutines to sprout from the most awkward of places.
BASIC can be done well with effort and training, but it can be done poorly much easier. When people learn on their own, they don't get feedback or corrections for their bad habits. And BASIC lets you get a lot further on your own than the syntactically thick languages of the C family, or the new concepts required to learn about object oriented programming. You spend more time ingraining bad habits before someone comes along and says "here's a better way to do it."
And then you hit the hard part! You then need to fight the internal pride that says "screw you, I already know how to program well enough, look what I can do in BASIC!" and actually accept learning the better way. Far too many people are so arrogant that they never get over this hurdle, and those are likely the students Dijkstra was condemning with his words "practically impossible".
Part of the problem was the era in which Dijkstra wrote his sentiments. Not enough people outside of academia (especially in industry) were writing quality code; even inside academia there was still a lot of research to be done, concepts waiting to be discovered, and curricula to be written to explain them to students. Another part of the problem was the BASIC language of the time did not encourage or even support concepts we now hold to be common best design principles: modularity, high cohesion, low coupling, etc.
Dijkstra was a visionary who not only understood these concepts back then but framed a lot of what was to come that would improve programming. He recognized this badness the same way we do now, only 35 years earlier. He saw first hand the damage that was caused by self-taught programmers, and saw BASIC as the crutch that enabled them to get too far down that path.
And did you read the points leading his list of uncomfortable truths? Let me repeat the key one here:
The tools we use have a profound (and devious!) influence on our thinking habits, and, therefore, on our thinking abilities.
John
Im saying that for teaching 'programming 101' to a large group ruby would be a poor choice, to teach the whole class (including the students with little natural talent) basic programming, when you consider the other possible languages.
Just guessing (!!!) that you talking about an enterprise situation (with ruby and java) where you have code already written with smart people who know what the code is suppose to do using the tutorial to learn the syntax of implementation. If you are teaching people to just learn ruby to modify or write scripts for a specific purpose then teaching ruby directly is a good idea.
He is probably concerned about teaching such a limited form of GOTO. While the simplest version should be demonstrated the student should be encouraged to investigate the far more powerful and interesting Computed and Assigned GOTOs.
The reason we subjugate ourselves to law is to better procure justice. If law does not accomplish this purpose then it m
Your assertion that Python travels well is a strong point.
Visual Basic and VBA have very accessible OO environments, but mostly over MS Windows. Which is a serious limitation.
Reviewing this thread, I think that the capability of writing lucid code was the key feature I was trying to advance. If you can name wisely and have the basic syntax of the language, even if purposely verbose, read like pseudo code then I think we're on the same page.
"Knowing everything doesn't help..."
The thing is, BASIC encourages use of GOTO, rather than being an unusual thing to use when unusual circumstances call for it.
I wouldn't agree that all BASICs encourage GOTO. The dialect of BASIC which I know best - BBC BASIC - was one of the first structured BASICs (possibly the very first) to make the use of GOTO completely unnecessary, and its use was positively discouraged from the start. In nearly 30 years of programming in BBC BASIC I can honestly say I have never used a GOTO except in programs written to test that the GOTO statement works!
BASIC isn't standardised in the same way as many programming languages, so you can't lump all BASICs together and criticise them generically. For example if you are in the 'GOTO considered harmful' camp (which I am) you may disapprove of those BASICs in which GOTO is unavoidable, or at least encouraged. However other BASICs positively discourage the use of GOTO, notably BBC BASIC. In nearly 30 years of programming in BBC BASIC I've never used a GOTO (except in programs designed to test that GOTO works!).
BBC BASIC was designed quite specifically to teach programming, as a key part of the BBC's Computer Literacy Project of the early 1980s. Advice was sought from academics of the day on the features the chosen language needed to have, and being sufficiently well-structured that GOTO can be entirely avoided was a central requirement.
As recently as 2006 BBC BASIC was chosen by Portsmouth University as the language to teach in the Introductory Programming Unit of their Engineering Foundation course.
Consider that the only seriously considered structured programming language available for home users in the 80s for microcomputers was Borland's Turbo Pascal. If you had an Atari ST in the late 80s, you could have Modula-2 (heh, heh) and good luck finding people to help you with either of them. I didn't know *anyone* who used Turbo Pascal, even when i got into BBSes and such.
I'll agree with your key point though. Outside of 50 minute classes at school we were all self-taught and finding resources and tools was a real pain. Without guidance, everyone develops bad habits. But even your last message proves that these bad habits can be unlearned because we *have* advanced over the past 35 years. Better tools, better resources, and with the availability of the Interbutt, the ability to shout "help me!" worldwide and get a decent answer has definitely helped the art of programming.
And yes, what you stated is one of the reasons why pride is a sin.
--
BMO
Just tried your system out. Found a few bugs.
I coded an infinite loop. Then I typed "run" and then I realized that there doesn't seem to be anyway to halt a program once it is running. There must be a big red octagonal button on the screen with the letters "STOP" in it that actually stops the program.
I tried to code an IF statement. I had to look up the syntax because "if i 0 then goto 2" got a syntax error. I can almost forgive using the C like "if()" for the if statement but using FORTRAN like "LT" for "" is pretty nasty if you ask me.... But, you didn't :-)
You have a "declare record" statement when just "record" would do. Using "declare" make sense if you are planning to add more things to declare, otherwise it is just a waste. And, seriously, no "for .. next" statement, no "if ... then ... else..." statement, no while statement, no multi-line statements at all. I see that you have reserved some keywords for those so it looks like you are planning to add them in the future. Please, these are critical parts of any language. I know for a fact, having done it, that it is f(&#$@#*$&^King easy to implement those compared to some of the things you have already added.
I tested what would happen if I typed "run" for a program that has a syntax error. It went away forever. No error messages, no output at all. It just stopped reacting to the keyboard. This is a serious bug.
The documentation is really really really poor. Very few examples. No real introduction. You use things like "boolean-expr" but do not define that anywhere it the document.
"turn" is great, but you need left and right also. Kids understand left and right. Positive and negative angles are a bit harder for them.
Palettes? Really? It is very hard to find a computing device that can run a modern browser that is not using RGB pixels. Why put this ancient cruft in the way of kids? Color values are RGB in the range 0 to 1. There are no palettes anymore.
Sprite maps? Nostalgia is an addictive drug, but like all drugs it is damaging when used to excess. Why not just have a place on the screen to browse and drop graphics that can then be used in your program?
I've written an ANSI standard BASIC compiler, I've written a Logo interpreter (or 2 or 3 :-), and I've taught courses in which the final project was a Lisp interpreter. In fact, I've written many compilers, interpreters, and even a linker once. I've also used both basic and logo to teach kids aged 5 to 12 to program. And, I have to say that while you have a good idea your implementation is far from ready for use by kids if I can break it in 5 minutes doing exactly the kind of things kids do.
It looks to me like you have focused on the "cool" parts, the graphics and the math library, but have skipped, or at least skimped on the critical part. The critical part is creating a system that works, followed by the documentation needed to use it.
BTW, WTF is "proof" for? It is left over from back in the day (your nostalgia is showing...) when you actually had to type in code that was published in magazines. OMFG!!!!! We live in a world where magazines have websites (in reality a few websites still have magazines) and flash drives are nearly cheap enough to show up in cracker jack boxes (yeah... I'm old, I learned Basic and Logo on an Univac 1108a :-). We do not do that anymore!
You have a good idea. But, shake off the nostalgia and make something that acknowledges the 21st century.
Yes, I know I have been harsh on you. If I didn't really like the idea of what you are doing I wouldn't bother to find the flaws, let alone spend the time to point them out.
Stonewolf
P.S.
I've recently managed to eliminated the use of paper in all the classes I teach. Doing that has really pissed off the English teachers who still insist on paper and give tests using blue books.
Just guessing (!!!) that you talking about an enterprise situation
Nope. I'm talking about taking my mother, sitting her down in front of Try Ruby, and watching her figure it out pretty much on her own. I'm not saying she was a good programmer by the end of it, but it wasn't hard to follow.
No, she wasn't a programmer.
Don't thank God, thank a doctor!
This was for supposed seasoned programmers, who I discovered were writing "COBOL in drag". I didn't get past how classes, inheritance, abstract classes, and base class calls were invoked. I was trying to get them to understand the language features and then how to leverage them. You can't do patterns as presented in GOF and others without understanding these topics. I was still on the basics. The "manager" had certs in the technology in question. I was trying to first familiarize with the basics and then expose them to the more advanced topics.
putting the 'B' in LGBTQ+
And here's the equivalent in an OOP language:
// allow ctrl-break to exit
protected class helloWorld() {
helloManager hello = new helloManager();
hello.setMessage("hello world").toString;
repeatManager repeater = new
system.controlStructures.looper.infinite.repeatManager();
repeater.exitHandler = new system.controlStructures.looper.exiter(system.io.ui.keyboardObserver(new system.io.ui.controlKeys.ctrl_break()));
repeater.repeat(hello);
}
Kinda miss the good ol' days now, don't we?
Table-ized A.I.
How funny! I just did the same thing!
--- wad
x = 0
furple = 1
foo = (onevariablename
+ anothervariablename
+ athirdvariablename)
<quote>Personally I think they made a mistake in that regard, and should have outright prohibited a mix of tabs and spaces for indentation within a single file</quote>
<p>I think that's the case if you use "python -tt".</p>
They actually fixed it in Python 3K, sort of - there isn't an outright restriction on mixing tabs & spaces, but it's invalid to have a mix that would give different results depending on tab size.
All the more reason to avoid it.
But that's basically the same argument as assembler -- this practice might make sense in a language that lacks certain features which effectively replace it. In assembler, there aren't actual loops and such, but there are jumps. In C, there isn't actual exception handling, but there are gotos.
At this point, though, I have an honest question: Would a preprocessor hack be worse than a goto?
Don't thank God, thank a doctor!