The Value of BASIC As a First Programming Language
Mirk writes "Computer-science legend Edsger W. Dijkstra famously wrote: '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.' The Reinvigorated Programmer argues that the world is full of excellent programmers who cut their teeth on BASIC, and suggests it could even be because they started out with BASIC."
Scripting with JavaScript in Firebug is an easy way to learn and there is no compiler involved.
A good programmer has experienced many languages and done things in many ways. A good programmer has compared all these various experiences and understands the advantages and disadvantages of each language and programming technique. A good programmer doesn't get bogged down in line numbers and GOTO statements and never move beyond that. If someone does get bogged down they never had the attitude to be a good programmer.
These posts express my own personal views, not those of my employer
I was on Basic from 1986 to 1993, and it was the most meaningful years of my life.
Depends on the BASIC. I use RealBasic at work as an alternative to LabView. It's object oriented, multithreaded and completely "Visual".
as potential programmers they are mentally mutilated beyond hope of regeneration
Am I the only person on the Earth who just writes off hysterical, panty-wetting stuff like this? When did he say this? in the 1960s or something? It's 2010 now, right?
There's something to it. I recently downloaded a ZX Spectrum+ manual from worldofspectrum.org (the colorful one), and was amazed by how simple the language is. The complete reference takes like 10 pages? And it can draw lines and circles..
Now compare it with any modern language, such as Java or Python. The language description itself takes 10x more than that, and the libraries available are vast. I am not arguing it's a bad thing; I am just arguing that simplicity may be a key here.
Damn, all this time I was blaming it on Bacardi 151 mixed with Jolt!
I started out with QBasic. It was absolutely horrific - the language itself and the code I wrote as well. QB convinced me to never, ever try VB.
So yes, starting out with BASIC helped me tremendously :)
...and I'm wondering: what's with the random sushi pictures?
...but does totally depend on the programmer himself. BASIC (including VB6, VB.NET) gives you many bad habits and wrong estimations about how programming is (Case-Sensitivity, Implicit Type-Casting...). It's an easy to learn language, but you _have_ to look beyond your own nose if you wanna start with a C-like language afterwards.
His argument is kind of funny. He says people who've learned in BASIC have learned what NOT to do when programming. I have to admit he has a point....I learned exactly why spaghetti code was a bad idea after doing it for a couple years. Some people think they know what spaghetti code is, but unless they've written code with line numbers, they probably don't.
Qxe4
I was #1, the top banana, programmer for assembly, C, pascal, fortran and many more even ada, extremely well paid on route 9. Learned programming with a sinclair zx-81. then went to college to be a computer engineer. Go Figure!
If you cant program in basic, you cannot be a programmer, or an engineer for that matter.
I disagree with the premise that BASIC teaches bad habits. I stick with the old adage a bad workman blames his tools. BASIC teaches kids (like I was over 30 years ago) from the ages of 5-6 how to put together simple logic, and gives them the very basics of languages constructs like variables, loops, sub routines, etc. without them having to grasp structures, classes, polymorphism, OO, etc. that a lot of grown ups that have been involved with writing code for quite some time can have issues with.
It's what I started on, and learning the fundementals such as if/else, do/while, variables, arrays, etc will give you a massive head start on any programming course in the future. It's so simple that when you look at code it's not so complex that it will scare you off, and easy enough to just start hacking around (even the good old:-
10 PRINT "HELLO WORLD"
20 GOTO 10
is quite valuable).
That said, it's not really worth while learning all the ins and outs of the language as anything real world (even *shudder* Visual Basic) will be quite different.
And the name doesn't sit easy for me.
I learned BASIC on a Commodore Vic-20 when I was about 6. The big problem with that flavor of BASIC was its shallowness: it didn't reward elegant solutions to programming problems and it was very easy to hit the performance limit. I never really managed to build anything more complex than text adventures and very simple arcade games. Still, the BASIC prompt was the very first thing you saw when switching on the micro so you were naturally attracted to experimenting with it, assisted by handbook that was included in the box. The prompt rewarded curiosity, especially when you started to enter those seemingly random values for PEEKS and POKES. Nowadays, on Windows machines, the prompt is hidden away from sight and there's hardly any mention of a programming or scripting language anywhere in the GUI.br /br /I can't say that learning BASIC made me a better or worse programmer, but that's what got me interested in computing in the first place: those simple but oh-so-thrilling rewards of getting the machine to do what you want it to do.
Not recognising the relevance of BASIC as described in the article, it's possible you're around a decade or two younger than the individuals the article is referring to.
"The true measure of a person is how they act when they know they won't get caught." - DSRilk
I learned BASIC on a Commodore Vic-20 when I was about 6. The big problem with that flavor of BASIC was its shallowness: it didn't reward elegant solutions to programming problems and it was very easy to hit the performance limit. I never really managed to build anything more complex than text adventures and very simple arcade games. Still, the BASIC prompt was the very first thing you saw when switching on the micro so you were naturally attracted to experimenting with it, assisted by handbook that was included in the box. The prompt rewarded curiosity, especially when you started to enter those seemingly random values for PEEKS and POKES. Nowadays, on Windows machines, the prompt is hidden away from sight and there's hardly any mention of a programming or scripting language anywhere in the GUI. I can't say that learning BASIC made me a better or worse programmer, but that's what got me interested in computing in the first place: those simple but oh-so-thrilling rewards of getting the machine to do what you want it to do.
Hack your mind out of its sandbox.
Worthless? Hardly!
I'm trying to teach myself to set people on fire with my mind... Is it hot in here?
As a programmer who started with old-school BASIC (numbered lines, etc), I was overjoyed with better elements of structured programming in Turbo Basic, and totally excited with C when I learned it. It felt like having my hands untied. So I would state the contrary: you cannot fully appreciate the structured programming unless you went through the GOTO hell.
I hear a lot of similar FUD from some people, like "you can't grok OOP if you started with C", or "anyone who touched .NET or Java is lost for C++..." It boils down to "people are idiots, they can't possibly learn anything new, they are either indoctrinated at birth in My True Way, or lost and hopeless." Who in their right mind would take that seriously?
Anyone else remember learning to program with the book "Instant Basic"? It was formatted like a Trader Joe's advertisement, with lots of Victorian clip art, and it let a lot of us learn the basics of programming -- conditional branching, loops, variables -- without actually having access to a computer.
Whoever hasn't coded with GfA-Basic or Omikron Basic never experienced how a fun and versatile language it was.
{{.sig}}
I've gone from MSX Basic to Turbo Basic to Turbo C. Now I can code in all kinds of languages, assembly, PHP, Ruby, Javascript, etc..
I do think that BASIC has value as a first language because it gives back results immediately. Sure, nowadays there are other script languages, so you don't have to go through compiling and all the other complexity. BASIC is valuable because it's just that: basic. You don't have to worry as a first-timer about libraries, include files, functions and everything else. You get down to the very basics like variables and program flow.
And after a lot of years of BASIC programming I knew the limitations of the language (which largely depends on the interpreter). That's when I switched over to Turbo C. And to be honest it didn't took me long at all to learn C because I was a pretty reasonable BASIC programmer.
What I _do_ object against is stuff like Visual Basic. That's taking a limited language which is simple and jamming it into a place where it shouldn't belong. To let Visual Basic work, they stuffed all kinds of non-original basic stuff in there which make it more complex then something like Visual C. Their idea was "lets make making real application easy with Basic, because Basic is easy right?". It doesn't work like that.
I also think that Java is not a language that people should start programming in to be honest. Object oriented programming is NOT something people should learn before they had a taste of procedural programming. Fun fact. I went back to my old school to see about taking some night classes to get my CS degree. (I dropped out at the time and I've learned a LOT more on the job then what they were teaching.) At their open house classes I asked about procedural programming and if they still taught it. They scoffed and said nobody uses that anymore. This when I've been a Linux kernel developer for 10+ years now which is 100% procedural ANSI C. It's all Java they teach nowadays.
In closing. I think a good programmer is somebody who explores. If I have a Windows application that does something cool, I take it through a disassembler to see what makes it tick. I look up DOT NET C# code snippets to see what it's all about. I look through COBOL and ALGOL source code to see what constructs people used in the past. I patch ARM assembly code to fix bugs. I do all those things and not rigidly stick to a single programming environment. A good programmer is a state of mind, not the language he works in.
just great, more sushi, I should block images from that site
I started with Apple BASIC, and I was playing around with peek and poke before the other students even knew how to properly misuse goto.
But that was when I was 13. The first year of college should not teach BASIC.
But why are we not introducing BASIC or the very beginner friendly 'Ruby' to students when they're 13 anymore?
Years before I took any formal course, I was looking at the manual of a BASIC computer and making circles on the screen by programming a dot that kept to the same distance to another and rotated. I still remember the emotion of seeing a real circle emerge on screen. I don't know if BASIC helped me much to program, but the immediacy of the thing certainly did much to keep my interest alive.
Rome taught me patience and assiduous application to detail. Virtues which temper the boldness of great, general views.
Back in my day... we didn't have basic...
we didn't have Assembler
We didn't have machine code
we didn't even have ones...
we coded in zeros
Most folks who have learned C++ learned it in a classroom with a real teacher. Most folks who learned BASIC learned by banging away on a computer keyboard at home.
Most people aren't very good at teaching themselves. I've seen this a lot with people trying to learn Morse code and giving up in frustration.
You can pick up a lot of bad habits without someone to guide you.
I'm doing a Programming Fundamentals course (mandatory and boring for me) and they're using Java... most of the students have never programmed in their life, and are completely overwhelmed by OOP.
Like all eminently quotable people, Dijkstra tended to hyperbole and oversimplification.
programming is about being rigorous. that should be taught at college. not some sloppy language where anything goes and with the magical on error resume next that "fixes" all of your bugs. you know what is propaedeutic for real programming to freshmen? fighting segmentation faults. learning to trace stack overflows. checking that what they are doing do what they thing it should do, even if that means checking the return value of each printf.
we don't really need another generation of people who'd like to be programmers but doesn't wan't to learn the intricacies behind it. we've enough problems as it is, with sql injections and stuff.
The first language I learned was Javascript. Well, actually I tried to learn QBASIC but it was just so horrible that I lost interest and nearly didn't become a programmer. I don't think any of that made a difference in the long run.
What's really important is learning more than just the language you started with. Learning many different ways to express yourself will really get you thinking about problems in a way that is not tethered to the specific syntax of your favorite language (not to mention introduce you to many different features that you might otherwise be ignorant of). Additionally, truly learning those extra languages will generate a lot of mental exercise. How you've spent the bulk of your time is far more important than where you started out.
Essentially, the author is trying to rationalize his start with BASIC by turning into some sort of advantage...either that or he's joking.
And Dijkstra does have quite a few genuinely useful and lasting achievements speaking for him (semaphores and such),
Didn't Dijkstra also pretty much lay down subroutines and coroutines.
This is my sig.
A language may lend itself more naturally to a certain way of thinking, but isn't bending the language for the job the role of the programmer? I personally agree with the author - I think it's always a good mental workout to work in languages that do not give you the wealth of constructs and libraries of the many language popular today, but more than that, starting out in Basic exposed me to the many dialects of Basic very early in my career such that I'm now used to programming in unfamiliar languages.
...but it was BASIC. And the expectations were so low. "10 PRINT "Hello, World!", "20 GOTO 10" and it started doing something. The programming manual was well worn by the time I was 10, would that have happened with any other language? I doubt it. Things like lack of scoping makes the easy things easier and the hard things harder. The point isn't to learn everything from your first language, the point is to get started and interested at all. Moving to DOS was sorta ok, but moving to Windows killed my interest. C/C++ was just horribly complicated, I remember trying to get up a window in the Win32 API and it was like wtf, how hard can this be? MFC was even worse, Java (really early java, on hardware of the time) was slow and unresponsive as fuck, Javascript was a toy language for websites and never really like Pascal or VB much either. I didn't regain my interest in programming until I went with C++/Qt, or maybe more Qt than C++ really. QMainWindow *mw = new QMainWindow(), mw->show(). The hard stuff is still hard, but I very very rarely find I write "overhead" code that I shouldn't have to.
Live today, because you never know what tomorrow brings
Yeah, there were no 'else' constructs. If you wanted an else, you had to do it yourself with a couple GOTOs. Also, the worst part about line numbers was when you decided to add something later, and there weren't enough lines. A program that had been refactored this way a few times could literally move randomly through the source code.
I never owned a Beeb, though I had several friends that did. I used them at school a lot too, and their BASIC was extraordinarily advanced. The ELSE statement was there, as was the standar(ish) GOSUB, but you could also define true procedures which returned values etc. (DIM PROC), and there was a clean way of dropping down to the 'OS' proper (OSCLI statements).
In addition, it also solved the line number problem you mentioned. It had a renumber command so that everything would become properly spaced out again. I remember the style of coding you're describing from my C64 efforts - the C64 was actually MS BASIC and it was dreadful, anyone wanting to do decent high-levle coding used to get the Simon's BASIC cartridge.
As a whole though, the BBC simply had the best BASIC of any 8-bit I encountered. That's not too surprising given its background and use as a teaching tool, but they did it very well indeed.
Cheers,
Ian
easy language first your get-over is
FORTH started I at-all me affected not and
My son is currently at the age where he wants to start learning to program. The thing is, other than Basic or similar entry-level languages, he just can't wrap his 11 year old mind around C++ or other more complex languages to start. And I can't exactly drop him straight into SQL or Linux either. He has to start somewhere, and simple languages fill this gap very well for the young. It's also the same reason why I hope that they never stop making those ###-in-one electronic kits. The basics may be old and useless to most of us here, but to our kids and grand-kids someday, it'll make the difference between being a good engineer or technical person versus just another brainless repairer who swaps parts without knowing why.
Learning out of a book in high school or college isn't obviously the same as hands-on building and programming.
What a bunch of horseshit. Most modern intro-to-programming classes are taught in C and/or C++.
Really? I've looked at a *lot* of courses, and I've hardly ever seen either C or C++ taught as first language. When I started doing this, Pascal was the most common with a smattering of Modula-2, ML and LISP. These days, it's almost always Java. If it isn't, it's OCAML, Modula-3 or LISP.
What intro-level courses use C or C++?
Dijkstra, who taught at Eindhoven Technical University - which is how I superficially came to know him - was mostly a self-declared legend. He cultivated his own myth, even going as far as publishing a little book with his own quotes.
Religous speak to God. Insane are spoken to by God. When all shut up, one can finally hear Shostakovich in peace
Back in the day I used basic a LOT, arguably like a sophisticated calculator programming language to do engineering calculations.
Show me a page of PHP even and everything goes blurry and out of focus.
That's dyslexia for you.
http://slashdot.org/~GuyFawkes/journal
And Dijkstra's algorithm for graphs, used on the Internet to this day.
Commodore Basic taught me to love programming, have fun making little games and all important binary operations and encoding for sprites and font
QBasic allowed me to take my learned lessons to the 8086 and add much much more visually appealing graphical interfaces (still mostly games, but also editors etc.)
QuickBasic introduced me to libraries and compilation, i've built some great hardware monitoring interfaces with sensors and relay switches
Visual Basic allowed me to explore the win32 API and libraries, i''ve built some of my greatest applications with it ranging from editors and filtering proxies to a graphical music collection interface I could control with a remote
I loved basic, it taught me so much but most of all it taught me to love programming... The days of fun little programs in basic are over and I have no intention of ever going back... but there is definitely meaning there, and I would recommend anyone to try programming with basic... as a self-taught programmer I can say you will learn a lot from basic.
Are people still teaching or learning BASIC?
I know JavaScript, PHP, and AppleScript, and I learned them so I could script the Web browser, the Web server, and the Mac desktop, respectively. With just a few simple lines of each you can make really practical and productive things happen that seem to me like they would reward the beginner. My background is publishing, though. Maybe I'm biased towards programming that makes documents.
What does BASIC actually do?
Depends on your age when you start learning. I was 12 when i first met "programming", it was a TI programmable calculator. It was fun to squeeze as much functionality as possible from less than 1K Basic. Then came C64, with its ~38K Basic. Its Basic was very weak, but i learned how to read disassembly when i read the code of various Basic extensions and read books that contained snippets on extending C64 basics. Eventually i made my own Basic extension, cracked games to create trainers, made an own turbo loader that had half of its code on the floppy drive. So, by the time i went to mid school, i programmed device drivers in machine code!
I learned PL/I and other archaic languages in mid school, even punch cards! I learned C on my own and was taught in it only by the time i went to high school.
Patents Drive Free Software as Hurricanes Drive Construction Industry
my mother draged home a 286 from work. I knew nothing, but i poked and i prodded and finally learned that exe files were programs. I stumbled upon qbasic.exe and did'nt understand what it was. I pressed F1 and the help appeared. I read it all many times and my programming carrer took of fromt here. It took several years before i left basic for C and ASM.
Today i have no problems getting my work commited to the Asterisk project. The guy is full of it.
I think the author is mostly on. He's aware Dijkstra was exaggerating for effect, but also completely correct... if you started programming in the early home computing era, you probably started with a BASIC. I was lucky enough to get some varied exposure earlier to some other languages (LOGO and some shallow assembly), but until I was 15, it was pretty much Basic.
And none of my programming habits now resemble anything close to the BASIC I wrote in when I was that age. Except, occasionally, for the rare cases where global state seems to make sense, and even then, I try to namespace things in one way or another. But by and large, I picked up structured programming, I picked up object-oriented programming, I picked up logic programming, and I'm learning to enjoy functional programming.
I will say... there was a time when I was probably close to being "ruined." It was when I was learning C++, and I only really had Pascal, basic C, and Basic under my belt. And I had a pretty solidly structured-imperative mindset, and really hadn't seen any other way of doing things. C++ married data structures and methods in an interesting way, but it didn't seem like more than a stylistic practice to me. I was pretty sure most languages were alike, you just had syntax and typing differences.
But there was one thing: I'd had to learn Prolog for a very specific job. We were teaching it to high school students in a CS summercamp I worked at for a few years. The first year, I just thought "Man, this is weird," more or less got through all the exercises, and left it behind, and did what most people do: dismiss it as an odd research toy. The second year, I thought "this is weird, but interesting." The third year, I thought "Wow. There are all kinds of intriguing ideas here."
And there are, and I still think it could stand to see more usage in mainstream software, but more importantly, I think I'm pretty lucky I got repeated exposure to a language that forced me to think differently before I got very far into actually working in the software industry.
Because I now think there's either a critical period (or possibly, at a minimum, a critical attitude of some kind) after which a lot of programmers tend to lose either the humility or the curiosity that drives people to think about different programming constructs and habits. I think if a programmer has been minimally exposed before they reach it, they'll keep just enough of one or both of those attributes that they'll be interested in what they don't already know, rather than arriving at the point where "they've already learned the last programming language they'll ever need."
And if they don't get so exposed, they become Blub programmers, where generally $Blub is some industry-leading language that does enough you don't easily bump up against tasks that are near impossible in it.
To tie this back in with a point I think the author missed, I suspect that some of the difficulties with Basic are actually part of the reason why it didn't end up ruining more programmers. Almost everybody who really came to grips with it as a tool probably realized that it couldn't possibly be the last programming language you'd ever need (if it weren't enough that any effort to look into working as a programmer revealed that Basic was clearly not the strongest payroll ticket).
Tweet, tweet.
When I was first learning to "program" I had nothing more than an old computer with DOS. The internet was something I had heard about, but had never experienced myself, and I didn't know what Linux or even Unix was. The only way I had to learn was from some books I found at the library. At first, it was just .bat files. When I discovered BASIC (I thing it was GW BASIC), I was excited to have it. Later, I discovered QB.
There are some advantages. First, I didn't have to set anything up or worry about what includes I needed. A simple PRINT "Hello word" was enough. What was better with QB was that with the press of F1 I could browse the list of commands. Also, it came with a Gorillas.bas and Nibbles.bas. I spent hours injecting lines of code into those games.
Sure, if you have a full Linux environment with gcc, man pages, and web access then BASIC is just some lame toy, but if it's all you have It's a start.
There are 10 commandments: 01)Thou shalt love the Lord Thy God 10)Thou shalt love thy neighbour as thyself.Matt22:34-40
I cut my teeth on BBC BASIC back in the 80's. It was simple, powerful, let you do pretty much anything and best of all came with a built in assembler. Now that was really neat.And it just worked. It was easy to optimise individual subroutines in assembler. This was age 10. At my simple state school with a couple of BBC Model Bs in the corner, I wasn't the only one doing that either.
I make a living writing C++ now and seem to do fairly well at it. The kids coming out of university that I interview these days haven't touched BASIC, or C++ for that matter. We want them to write good C++ when they come and work for us. The intelligent ones adapt easily to working with pointers etc. The less able ones that have somehow made it through the interview process struggle.
Bullshit. You know what may be a reason? The extreme restrictions. In the 80s I used a fairly good Basic, BBC Basic, but I mostly used 6502 assembler. This on a machine with very limited memory. What that does is cause you to do things as efficiently as possible, it makes you think how to best represent the data in memory etc. In german there's a saying: In der Beschraenkung zeigt sich der Meister" (which translates loosely to "given restrictions, the expert will show himself to be an expert") but I think even better would be "In der Beschraenkung bildet sich der Meister", i.e. given limitations you will become an expert at various problems.
In literature there are similar situations. Limits of form/rhyme may instead of restrict a writer, actually make him write better material...
But back to Basic: The limitations in there (the early 1980s and some later versions) are mostly not helping one to become an expert. They just annoy. What I clearly feel and which is what Dijkstra probably refers to (as it may be a strong effect in some programmers) is that I know how to do something directly, and thus the minimalist urge is there to write something different to using the features of the language you're using because for example you may think that would be less efficient.
What I (like to) think Dijkstra meant, when he issued his famous quote, was probably a lot more like:
"Programmers who learned BASIC first can't really be coaxed away from thinking that all languages should be as easy as this."
Trying to convince a BASIC programmer that they should understand CPU Instructions, Registers, or hell, even pointers, or why you should end a statement with a semicolon, is hard to teach a programmer for whom UP UNTIL NOW, THE COMPILER (or runtime) DID IT FOR THEM.
Anything else seems like a step backwards. And hence, they do not respect the more elementary languages. "Really," they think, "is it so hard for the compiler to manage my memory allocation for me, when my $400 1978 micro can do it when I program it in BASIC?"
A well-educated programmer has since learned that programming is, in essence, understanding how to get the machine to perform a task; and, that, while there are different ways of asking, only a certain exact way will ultimately be understood by the machine. And you might as well know the exact way, since any problems will be related to that exact instruction (or lack thereof), and it is also obviously optimal in terms of effort (both for you, and the machine).
Dijkstra was commenting more on how children who learned to program on simple BASIC micros didn't usually grasp the new expectations of the compilers when they were writing for things such as mainframes. But, on the other hand, why DO you have to manage your own memory, still? The imperious little bastards who refused to learn anything that requires them to know more about the machine than BASIC required, well, they did have a point. In fact, in many more modern languages - like the recent Google Go - you mostly don't have to concern yourself with things like memory allocation.
Dijkstra was right, but he was also wrong.
I know spaghetti code, but then again I am mentally mutilated by Brainfuck2D.
I've seen to many programmers who get way over there head with Visual Basic and think they are ready to jump into more powerful programs.
I think I see a representation of what he was talking about a lot. Even here I see it in the responses. "I wanted to draw a circle on the screen. So I figured out how to do it in BASIC and I did." and they kept on with this attitude, never considering what the memory issues are and communication issues. So they right code on 16GB RAM with the RAID 0 15000 RPM SCSI with the latest 3.x CPU's and look like dear in headlights when they have their resulting code bomb on a 1.7 GHz processor with 2GB of ram.
I simplify, but from where I sit that's what it looks like to me.
Don't get me started on stuff I've seen come out of LabView. (You mean there's a limitation on a Southbridge?).
I found programming by learning Basic in a high-school programming class. Anyone that was so affected by the first language they were introduced to had some preexisting conditions I'd say... If a person only has the capacity to think in terms of the tool currently in their hands then forget about it. I quickly moved on to C and Linux in my teens when Basic didn't support what I wanted to do and my empty wallet didn't support Borland or Visual Studio. So yeah, thank you BASIC, public libraries and Linux.
I did Apple and C64 BASIC (and 6502 assembly language) to death back in the day. You really can't get more 'oh no, gotos everywhere!' than those, but I seem to have survived it. Of course I realized the fragility that GOTOs and JMPs engendered. The key thing is that it nurtured my love for programming because it was so easy to slap things together. Now of course, I can see where it had flaws, but what was I going to use Back in the Day? Pascal? Please, I learned it. But Wirth and Dijkstra's beloved Pascal, while great in theory, was in practice crap for making neat stuff with the minimum amount of effort compared to BASIC + 6502 ASM. If you wanted to do the REAL stuff in Pascal instead of just masturbating for your professor you had to learn the pcode interpreted byte code stuff, which was just fancy assembly language (though it was neat as a precursor of modern VMs). I could (and did!) churn out an entire game in AppleSoft BASIC while the UCSD pascal system was chonking away on the floppy drive editing or compiling or whatever, and god help you if you didn't have two floppy drives. Meanwhile BASIC would happily run with just a tape drive or /nothing at all/. She was an easy whore but things got done. These days I use Python with the added advantage that I think it's the most maintainable language even if it doesn't have the purity of something like Scheme, but none of those were an option at the time.
So yeah, spaghetti code is bad, but I think any decent programmer learns that sooner or later anyhow. If BASIC got you going, more power to you.
More to the point, is coddling uninterested putzes with Java's strait jacketed purity so they can churn out more utter crap really a better alternative than BASIC's trial of fire? Because that's our current go-to plan. I apologize in advance to those excellent Java programmers I know who can really make Java sing, but you, even more than me, already hate that most of the people using Java are FactoryFactoryFactoryAbstractFactoryTools. Far better to flush them out earlier.
Maybe C and C++ aren't common for introductory programming courses anymore, but they used to be for a time. About 10 years ago:
I took an introductory C programming "class" as part of the Columbia University Science Honors Program for high school students. It was the only programming course offered.
The Computer Science Advanced Placement exam switched from Pascal to C++.
At Rensselaer Polytechnic Institute, Computer Science I and II were taught in C++.
While there are no doubt some great programmers using structured languages, let us all not forget those great programmers who work with their own structures and only have global variables and labels are a luxury of the compiler , and where gosub is but a pipedream -- BASIC the training ground for assembly language maybe?
Yeah... I wrote my first commodore 64 basic program when I was 10, and now I'm about to finish a phd in computer science.
Either C64 basic wasn't all that dangerous to one's mental health, or maybe it isn't a problem to be "mentally mutilated beyond hope" when working within academia.
Hrm. Actually, when thinking that last part of the statement through, it does seem like a rather fitting description of both me and my colleagues. I just never knew it was because we had programmed basic.
it really doesn't doesn't get much simpler. Even shell and batch scripting is more complex.
The base language can be described in a couple pf pages, it works great for functional, oo and imperative programming. It's also trivially simple to learn.
The main problem is a lack of an easy to use code repository & plugin modules.
Deleted
At college we started off in Pascal but quickly moved on to C and a bit of Java. I'd say that if anyone is considering BASIC as a first language, they should choose Pascal instead. But to be completely honest, these days OO programming has become so important that it's probably better to start off in Java or C# from the start.
The BBC Model B was released in 1981. It had a nice dialect of basic with named procedures, named functions, dynamic memory allocation, typed variables, proper pointer indirection and a cleverly integrated assembler.
It had pretty much the full suite of structured programming tools.
Maybe the comment had some value before 1981, though I don't think it did. For the last 29 years, however it has been somewhat out of date.
SJW n. One who posts facts.
Anyone who remembers when VisualBasic was heavily used knows BASIC doesn't teach people to be better programs. Even C or any other "good" functional language doesn't teach you what not to do. As the saying goes C++ will not only let you shoot yourself in the foot it will load the gun and cock it. I don't think you even realise most of the major programming pitfalls until you have done a major project or gone back years later to maintain your own code (and spent more time trying to figure out your logic than it took you to write it in the first place). I started off with BASIC* (on Win 3.1 machines) but that was only because it was the only programming language that nearly every computer had. These days there are so many easier, more powerful, and just plain better "teaching" languages and toolkits.
If you just want to teach a kids the real raw mechanics of what a computer does let them lose with an ASM-like language and a simple CPU simulator (there are various robot simulators out there, or you could even invest in a real robotics platform). If you want them to learn to program there are much better tools out there to achieve that than BASIC.
* And only learned how to really program when I got my hands on Pascal.
========
CINC, 4th Penguin Legion
Here in Ireland (NUI, Galway) C has been used as the first / introduction to programming language for a long time now. There was a brief & failed effort to use Java; I had the "pleasure" of trying to tutor some of the people who had started on Java -- they were a confused bunch. Of course there are plenty of people who fail to "get it" with C too.
The ducks in the bathroom are not mine. [http://www.27bslash6.com]
Because it was the language that came preloaded in the ROM of so many home computers back in the early 80's.
I cherish memories of the time I started programming in Speccy BASIC, at a single-digit age. I got to love programming on that machine. But I do not think it's any good for a beginner.
The point that the author makes, that "the horribleness of BASIC was its virtue. It forced us to think around corners. It made us think through what the control structures really were, and how they were implemented." is moot - assuming he's not joking, if you really want to train that way of thinking, you're much better off learning Assembler.
Admittedly, it may take some application, but you can write crap in any programming language, and you can write structured BASIC programs. You need to have been introduced to the technique that's all.
There seem to be VERY few assembly language programmers here pointing out that underpinning ALL our oh-so-elegant programming languages is one of JMP $ LCALL and RET.
Steve
OK, BASIC might not be the prettiest language in the world and it has some features which make it hard to maintain IN A PROFESSIONAL ENVIRONMENT. However, for kids playing at home wDijkstrahere the half-life of a piece of code is measured in days, it provides an easy entry with a smallish learning curve. Just like you start off playing with Meccano, you aren't expected to become a professional engineer and build bridges from it (though it has been done) but it does let people develop a love of engineering.
I have read a lot of Dijkstra's work. He's basically an academic who's writing is intended to impress other academics with it's insight, theoretical accuracy and idealism. As a practical basis for doing real-world projects, it falls a long way short.
politicians are like babies' nappies: they should both be changed regularly and for the same reasons
Surely Python is the language to start with these days? It's straightforward, doesn't force any particular model, i.e., can use for procedural, OOP, functional style. Most importantly it's not a toy language.
The ducks in the bathroom are not mine. [http://www.27bslash6.com]
We can argue 'til we're blue in the face about what the best first language to learn is, but the simple fact of the matter is that it doesn't matter as much as we want it to. Even the second language we learn doesn't really matter that much. What matters is the transition from the first to the second language, assuming they're different enough to really consider the second language a different language (I would argue that going from C to C++ is not significant enough a change to be considered as a "second language"). If it goes smoothly, you've got a capable coder on your hands. If it takes more than a few tries to write "Hello World!" in the new language, chances are you have someone destined to be befuddled by any kind of more advanced programming methods. Granted, there are several factors that go into the significance of the transition, not the leas of which is time and depth spent coding in the first language, but those are issues are part of a much bigger pedagogical discussion than this. And no, I didn't RTFA.
Again, around ten years ago (1998) we learnt C++ in first-year computer science at the University of Wollongong. Second year branched out into java and assembler, but I was a physics major so didn't go that far.
What intro-level courses use C or C++?
Florida State University -- COP3330, "Intro to Computer Programming". 100% C++
It's not necessarily a bad thing to have done things in BASIC, but bad habits can be formed by that language. However the other side of it is that if you first see the bad sides of BASIC then you can recognize the good sides of other languages.
And BASIC of today is Python.
If builders built buildings the way programmers wrote programs, then the first woodpecker would destroy civilization.
Oh really? And university students should have no prior knowledge to programming? We have full universities of such students, they get degree and go working for some brainless company doing minor tasks.. Or they could continue study until they are 40, then they will probably be able to code.
I started at 12, and BASIC gave me some idea of how computer is actually working. Probably it's time for new languages, but You just can't learn programming at college in few years. You have to grow up with that.
When Dijkstra wrote that, kids did not have access to computers. Any child has the flexibility to learn the, ahem, basics from BASIC and move on after discarding it.
Adults, on the other hand, tend to stick with what they first picked up on. Look at how badly most (non-techy) people use modern GUI-based systems, sticking rigidly to the few things they have picked up over the years.
This thread has lots of people who learned to program BASIC as a kid and then moved on, they think their experience invalidates Dijkstra, it does not, it reinforces it. Dijkstra was spot on, except as a training language for children BASIC is harmful.
...is the Dutch word for what I think of Dijkstra. He's overly negative is his opinions only to impress others and to let off steam built up by his personal frustrations. Besides his wonderful contributions to CS, he was mainly just a grumpy old man who's opinions have been grossly overrated. The gems of his work are in his scientific contributions, not in his tantrums.
-Can you warp your head around coding logic?
-Can you avoid chaining yourself to a specific language, and instead choose one that works well for what you're trying to do, rather than force one to work outside of its intended scope?
-Can you handle both procedural code and OOP, and are you aware of the pros and cons of each?
-Can you write code others (not to mention you a month later!) can actually read?
-Are you willing to take the time to truly learn programming, rather than just copy-pasting a few functions and hoping it works?
-When you learn a language, are you willing to actually learn the language, and not just make it behave like one you already know?
-Are you aware that debugging often takes longer than actually coding, and are you willing to put that effort in for the sake of quality code?
If you answered yes to all of the above, you're probably going to be a pretty good programmer, whether you started on C/C++, Assembly, BASIC, or hell, ZZT-OOP. Every language has places it really shines, and every language has glaring flaws - if there was a prefect language that was good at everything, we wouldn't need a few dozen of them. :)
http://en.wikipedia.org/wiki/Simons%27_BASIC Simons basic had actual procedures and loops It also had very powerful access to graphics, sound, and input devices.
One of my earlier programs was one that mapped out the frequency response of a bass speaker and enclosure, complete with graph.
I started in school with Ada (the horror!) thought this programming thing was not for me. then we went on to c, and I saw the light....
Having said that, I do mostly c# and python nowadays and I DID start with Basic (on the Apple II) by myself before getting to the programming classes in school
if (!signature) { throw std::runtime_error("No sig!"); }
With the old 80s BASICs you had a lot of work on your hands to organise a program. You had to note down line numbers of subroutines and be disciplined in choice of variable names so as not to create unwanted side-effects. As more structured languages came along, this effort was no longer necessary - I was happy to learn Pascal, then C and C# because of the possibility of less typing, less notemaking and less headscratching.
On error resume next didn't exist in MS Basic for microcomputers, of which the author of the article speaks. It wasn't anything goes in terms of variants either - variables had types, indicated by suffix (!, % or $).
It was more like programming in type-safe assembly language, but without an argument stack.
When was anyone introducing languages to students at 13? There's bound to be a significant chunk of us out there who poked around our computers and went to find these things out ourselves. BASIC just kinda sold itself with the name - you knew it was a good starting point. Self-discovery and a curious mind is probably outdated in the corporatised world, in spite of the roots of many of us who learnt by screwing up an autoexec.bat file or two on Dad's computer. Nothing teaches you to pre-check your logic than having to explain to Dad why his computer doesn't work any more :)
Man who leaps off cliff jumps to conclusion.
BBC BASIC was my first language. On the Acorn, many things where BBC BASIC, with ARM assembler sprinkled in at bottle necks. Me and a few friends taught ourselves (we shared things we found, and played each other's games). I remember not knowing about procedures/functions. For a few years I wrote everything with GOTOs. Finding out about procs was a revelation I still remember. I look back at the code from my childhood with a certain pride, despite the horror of it. All the variables had shortened names because it made things run faster. Everything was fixed point and logical shifts instead of devides. It is tangled and nasty, but it runs, and being the games is done in BBC BASIC, fast. (SWI for sprite rendering helped!) I do wish someone had got me started on C earlier, didn't set up RiscOS to compile C until I was 19, but there was no one until I was able to do it myself. Setting up gcc on RiscOS had a bit of reputation for being hard, older friends had failed. But once I was up and running, I wrote a C software 3D engine demo thingy, dropped out of uni (stupid multimedia course), moved myself to Windows, C++ and OpenGL, got a job speeding up a startup's 3D engine (which was like a lesson on how not to do 3D), and never looked back. I owe my working life to having BBC BASIC as a child. As a kid in the 80s/90s, you couldn't ask for a better start than BBC BASIC on the Acorn, you could knock together fast enough games to be worth doing. The modern day equivalent I guess would be python and pyGame.
Like all things, you can't give a blanket statement here. Yes, there will be some people who "learned" BASIC when they were young and now, when they are let loose on an Excel macro in work, will pine for line numbers and GOTO's. But they would have done that no matter what they learned. However, there's also a damn lot of people who moved on from BASIC very quickly but still have a fond association with it because of their history and because of the simplicity of some tasks in BASIC (of course, a lot of things are more complex but depending on your project you can still "win" on speed using BASIC). If I was to "invent" my own programming language, there are features from just about every language I've ever used that I'd want to be incorporated. Even BASIC has some things that I'd want to include, or that have been copied into lots of other languages.
I think BASIC was an introduction - a way to hide the complexities, to say "don't worry about memory management and data structures just yet, let's learn half-way to being able to program so you can get interested and have some fun quickly". And then when you did that, it was *so* much easier to move to other languages. Of course you still had to learn and change habits - but that's the point of learning. People who drove a moped when they were 17 don't go on to drive a car and keep twisting the indicator stalks to change gear or accelerate.
But BASIC only corrupted those who were corruptible - those who didn't *care* how the computer allocated memory or whether the program was efficient or readable were bound to carry on not caring in other languages. And those people, by definition, would have been like that in any language and probably *never* go on to learn any other.
My dad bought me a ZX Spectrum in 1987 or thereabouts. I was 8. Within the first week I was trying to figure out how to program in BASIC (by the help of that orange-spiral-bound BASIC manual that came with it - damn that should be a compulsory item with all new computers). Without that book being included, I'd probably now only know how to 'LOAD ""' and my life would be very different. If that had been any of the C books that I've ever read, I would have thrown it in the bin immediately. Within a year (in between playing games, school, and pulling girls' hair), I was a pretty proficient BASIC programmer. It helped that I was also doing things like typing in listings from magazines (an early form of Open Source that will forever be sadly missed) and trying to understand Z80 assembly. By the time I got to secondary school (age 11), I was writing games for fun for my friends. I wrote a No-CD crack for Desert Strike when it first come out on PC, I was 13, and was incredibly proud of my first use of x86 assembly / Ralf Brown's Interrupt List - I never distributed it to anyone else but it's still sitting around on my machine somewhere. I did it using DOS "debug" and a hell of a lot of manual path-following and single-stepping through the code. Around the same time, I wrote a program for Windows 3.11 that prevented execution of programs with certain signatures / hashes / paths that integrated into the school's Novell network and was so damn good that even the network administrator (an old-school IT guy) couldn't bypass it on the test accounts. He seriously considered deploying it to help curb a spate of students running programs via Word macros, DOS command prompts and other clever tricks (I never had the heart to tell him how they were doing it, who had taught them that, or why I felt so guilty that I had to counter-act all those methods for him...)
By the time I got to Year 11 (age 15), I was programming on my TI-85 in the back of the class (and sharing those games / programs with the rest of my class) and writing "toy" operating systems for my PC. I was receiving email from Canada (a massive thing at that time) telling me how good my games were, and I was dabbling in everything I could find: C, Pascal, FORTRAN, assembly and even things like DOS Batch scripting and
Personally, I think I was far more mentally mutilated from my semester of FORTRAN77 than from any form of BASIC. /shudders
Fundamentals of Programming CPTR-124 -- Southern Adventist University That one uses C++.
There are plenty of scripting languages right now - use one of them. What is it with all this archaic non-c love?
Python is actually a really nice language, its only pitfall is that it considers whitespace significant.
I cut my teeth on BBC BASIC back in the 80's.
The comments of Dijkstra et. al. really relate to the original Dartmouth BASIC, Apple BASIC or the early Microsoft BASIC that you'd see on CP/M, PETs and TRS-80s.
BBC BASIC was partly designed to address those very criticisms (since the BBC Micro project was primarily educational) with a wider variety of loops, named procedures and functions etc. and could be used to write reasonably structured code. (It was also very, very fast!).
There was nothing really like BBC BASIC for years, until Visual BASIC started to take off.
In a survey of 100 programmers, 111111 thought that duck-typing was a good idea.
> When was anyone introducing languages to students at 13?
Actually, that's about the age I started learning 6502 assembly on my KIM-1.
When programming in Java, I still resist breaking out of loops, or multiple returns, even in small methods. These things seem to be normal acceptable practice with most developers, and really are fine when used in the right places. Because of early exposure to BASIC (and badly written C) I avoid them more than most.
I think the BASIC of today is Javascript. You see more badly written javascript than any other language..
Point taken, but in my experience people who have even marginal idea of what happens under the covers, tend to write better code than those for whom the underlying machine is a complete mystery. I'm not talking premature optimization, but merely knowing in the back of your head what a pointer is, or _why_ this operation is O(log n) and better thus than O(n), can save one from a lot of awfully wrong guesses and writing awful code.
My canonical example is a team whose architect (!) finally read somewhere that when passing an object to a Java method, only the pointer is passed on the string. So he actually decreed -- and none of the lemmings knew better -- that they should use parameters like the wrapper object Integer instead of the primitive int. (We're also talking Java 1.3 times, so no automatic boxing/unboxing either.) Because, I quote, "If you use Integer Java copies only a pointer to it, not the whole int."
Maybe knowing how much space an int takes under the covers would have helped.
Another time I hear my now ex-coleague Wally (not the real name, but pretty accurate;)) repeatedly going, "That can't be true!" and the like. Curiosity gets the better of me and I ask what's the problem.
"Java has a bug!" he goes, "I put a new key/value with the same hash code in a HashMap and it just replaced my old value!"
"Oh, yeah, we've had the same bug at the old company, " Wally 2 chimes in. "We had to manually set the capacity so it goes in another bucket."
(I clench my teeth to avoid screaming at the notion that there's any way to the right capacity to avoid collisions for keys that are random strings.)
I go and look at what he's doing, and sure enough he's got the debugger open and is looking at the bucket array of a HashMap. "Look! There! I had a different value and it replaced it!"
"Aha, " I try to be diplomatic, "can you please expand that 'next' variable there?"
"No, you don't understand! My value was there and now it replaced it!"
"Yes, I get it. But I want to see what's in that 'next' variable."
He clicks and goes, "Oh... there it is."
The whole concept of a linked list was new to him, obviously.
And if you think that's an isolated case, in the meantime I've run into two different teams whose "architect" actually made it mandatory to plaster his broken replacement for the hash-code method everywhere, because of that supposed "bug in Java." Supposedly they can hash a long-ish random String into a 32 bit int without ever having collisions. (Ok, 31 since Java doesn't use the sign.) Consulting can be depressing business, you know?
I could go on with more such WTF examples, but basically let's just say I wish more people would know exactly what happens behind those high level constructs and libraries. Because otherwise I see them take their own guesses anyway, and guessing wrong. I wish they'd know what a pointer really means, and why a LinkedList does _not_ use less memory than an ArrayList, and, yes, what kind of things will cause jumps. Or what kind of things will be optimized into a tail recursion instead of a plain recursion, as a trivial example of where it pays to know the difference between a JUMP and a bunch of PUSHes and CALL generated by the compiler.
A polar bear is a cartesian bear after a coordinate transform.
What intro-level courses use C or C++?
University of Kentucky, CS115, CS215, CS216. A 3 semester 100% C++ block, required for all CS and CE majors.
Very similar to my childhood.
I wrote my first Basic program in 1983, when I was 7, on a ZX Spectrum. By 13 I was writing in assembler using Zeus, cracking games in order to copy them from cassette to floppy, writing utilities like a record/play sound, font editor and more.
At 15 I started learning Pascal. At 17 I wrote my first asm virus for x86 and started with C.
Later I used C#, PHP and javascript.
My favourite programming language right now? Actionscript. Epic fail, I know - I'll turn in my card in a minute. But I wrote a chess game in it and had tons of fun tweaking the performance.
First of all, you're clearly not an article reader. The point of initially learning with a painfully unstructured language is that you end up appreciating structure more, while being able to tolerate code that has awful structure. IMHO a better choice is assembly, but BASIC does have the advantage of providing faster rewards.
Second of all, many of us dispute the bit about Python not being a toy language. If you build your skills around Python, you'll hit serious trouble if you ever end up needing decent performance or unwrappered OS functionality. If you build your skills around C, whole new possibilities open up to you. You could even write a non-toy OS if you were so inclined.
We were taught BASIC in my maths class when I was 12. This was on PET computers (CBM4016) with cassette tapes for storage. I thought that was the usual age for teaching kids computers.
I know a lot of OO evangelists would have us believe otherwise but it is a procedural method of programming except the procedures are conceptually wrapped up inside a container that also has data. If you need more proof just remember that its entirely possible to do OO programming in C (a procedural language if ever there was one) using function pointers inside structures - and in fact this is exactly the sort of code the early C++ to C precompilers produced (along with a load of unintelligable macros).
most of us have been writing software without using goto for the last two decades
Us goto-loving programmers don't take two decades or more to write software. We just go to it.
I agree on all counts. Python has its moments -- especially when the student moves on to lists and classes and especially when they fall afoul of the unexpected consequences of = being a binding operation rather than an assignment. But in general, the simple stuff is simple. And it works. I think that's really what you want in a tutorial language. And it's probably not all that bad in many real applications either.
If Python has a problem as a language for tutorial programming, it is probably in its rather limited error checking.
You can't see ANYTHING from a car, You've got to get out of the goddamned contraption and walk...Edward Abbey
My university here teaches intro with C++, which they feel isn't a good choice. However, they teach it because Electrical Engineers need to know a "C" or "C-like" language. Apparently they want to shift to Python in the near future, which means they need to work out how to bridge between Python and C in Intermediate (which is another required course for Electrical Engineers)...
as potential programmers they are mentally mutilated beyond hope of regeneration
He's thinking of APL, not BASIC.
I made my first Basic program when I was about 9. There is a special kind of magic in seeing your first few basic instructions work.
The concept of a computer executing just a long string of instructions becomes very clear.
If somebody had shown me pascal at that time and started to tell me I had to first make functions (I had never heard of such a concept, and probably couldn't have imagined how a computer was supposed to handle that) and only then could do some work inside them you would have lost me...
I saw Pascal and later C only after I had done a lot of exploring in basic and literaly poked the entire machine...
If you have been lost in spaghetti a few times the concept of a function (and later objects) becomes much clearer.
I have seen some being thought programming in Delphi. They don't grasp functions and objects as easily simply because they don't know which problems are solved by them.
Secure messaging: http://quickmsg.vreeken.net/
It didn't have procedures like BBC Basic unfortunately , but what it did have was a simple type of multithreading. It had the AFTER and EVERY keywords which meant you could get the interpreter to call a subroutine once or all the time after a certain number of clock ticks. When I moved on to real multithreading in C then C++ my experience learnt on this helped me immensely since the race conditions you could get in posix threads are nothing compared to those that you can get in a multithreaded Basic language where all variables are global and there is no locking!
My first computer language is BASIC too.
Obviously, it can't do anything fantastic. But it can invigorate the enthusiasm of the casual coder to do more coding. That's the best trait in my opinion.
I mean, I don't think a first time coder wants to write an OS kernel. Maybe he/she wants to print his/her name on the screen, see computer knows the answer from 2+2, draw a geometrical shape on the screen... simple things that makes them happy.
Once they are done with simple stuff, they might level up to experiment with algorithm type tasks, e.g. routines to generate Fibonacci numbers, prime numbers etc.
Certainly, nothing I picked up in BASIC helped me in anyway on any language I tried later. But at least, when I walked into CS101, I wasn't someone totally new to the concept of 'programming' and wasn't scared at all. What I see is, people who never had programming experience before college years, tend to develop a real hatred towards it in their freshmen year.
Somebody above mentioned JAVA (or any OOP language) is a bad idea for new programmers. I totally agree with that. Even my CS101 taught JAVA, it wasn't a pretty experience. May be I am strange person, I never liked Visual Basic either.
But in my 2nd year, I learnt C.. it is to-date, the best damn thing I learned in my life. It pave the way for me to learn C++, MATLAB, C#.
In my opinion, programming is not something one can teach to a great depth. Its something one needs to explore with his/her inner curiosity. BASIC can spark that inner interest. BASIC gives some hope for a newbie casual programmer, rather totally putting off like most advanced languages does (even C/C++). That's what matters at the end of the day.
I saw M$ is rolling out 'Small Basic' as an replacement for original BASIC (in many plaforms including linux). I never had the chance to try it out, but I see some important additions that helps coder to play with GUI, internet so on. I am glad to see someone is putting effort to bring the programming back down to absolute ground level.
While BASIC was (is?) a rather bad language overall, programmers of today are blessed with at least two excellent high-level languages with large communities that they can use for almost anything: Python and Ruby.
It used to be fashionable to introduce children to Logo long before that age.
Slashdot: where don knuth is an idiot because he cant grasp the awesome power of php
And BASIC of today is Python.
easy != bad
Complicated conventions and workarounds don't make a good programming language.
Teaching people to program in C is so much more complicated than Java/Python because you have to explain all the conventions (read: main, NULL) and workarounds (read: arglists, macros) people came up with.
I quite agree. I fire bullets over the heads of my students as they program too. Makes the bastards learn to duck.
echo -e 'global _start\n _start:\n mov eax, 2\n int 80h\n jmp _start' > a.asm; nasm a.asm -f elf; ld a.o -o a;
It never ceases to make me smile that any discussion about BASIC invariably brings BBC BASIC fans out of the woodwork, and I'll add myself to that list.
To be honest, BBC BASIC spoilt me. I was familiar with the concepts of using procedures and functions, but never progressed to the built in assembler. The thing is that BBC BASIC and the sheer power (for the time) of the MOS (operating system) was so far advanced of the other 8bit machines available at the time. I then moved to the 32bit Acorn Archimedes range which also features BBC BASIC. So, when I got my first PC it was a complete shock - there was QBASIC, but it didn't work the same way and seemed far more limited. It didn't integrate so elegantly with the operating system.
For me, BBC BASIC and the MOS is a truly amazing piece of work and went with a truly revolutionary piece of the hardware. As an example, the BBC B hardware (the most common computer to run BBC BASIC in the early 80s) has a built in floppy disk drive port, parallel and serial, a programmable ADC port, a digital "User" port for controlling mice etc, a 1Mhz(!) bus for controlling other devices such as sound synthesisers, the ability to add an Econet module to create a local network and the "Tube", an interface/protocol for interfacing with a second processor (the first ARM processor was designed using the Tube interface). How many other 8bit machines in the early 80s could do any of that? The operating system also supported paged RAM/ROM and a very sophisticated display driver (called "VDU") where screen co-ordinates mapped to a virtual screen resolution, effectively allowing your routines to be resolution independent.
If you have an interest in old computers, or elegant design, but have never played with a BBC or even a BBC Emulator, you owe it to yourself to track one down.
Surely Python is the language to start with these days? It's straightforward, doesn't force any particular model, i.e., can use for procedural, OOP, functional style.
Most importantly it's not a toy language.
I've been struggling to teach programming to my kids using Python (and other languages), and have never been completely satisfied. I'm thinking that I need to start by teaching a restricted subset that looks a lot like BASIC. Two character variables are missing, but OTOH python doesn't use '$' to indicate string variables. The big thing is to include a GOTO statement, such as http://entrian.com/goto/, to be used until other flow control mechanisms are taught. I wonder if I can extend Entrian's code to include a GOSUB?
Of course, there's always Perl.
Nothing for 6-digit uids?
And that kind of proves his point, doesn't it?
As for the badness of Basic, all I can do is think of what Knuth said: it is good to know multiple different styles of programming languages. Only knowing languages descended from Algol: C, C++, Java, PHP, JavaScript, is too limiting. It's good to be proficient with LISP/Scheme, assembly on more then one CPU, a string processing language (Perl/Awk), and an industrial language like Fortran or Ada. Logic/declaritive programming is also a useful skill. One size does not fil all, and if you are comfortable with multiple paradidms you will be a bettere programmer. Personally, my next language experience is going to be with Haskell, because I really like Scheme, and I want to understand the functional paradigm.
Why is Snark Required?
I learned BASIC as a young kid in the very early 1980's. All thanks go to Mattel (Aquarius) and some little known company called Microsoft! When I got to secondary school they exposed us to Turbo Pascal - I completely failed to wrap my head around this crazy language that had no need for line numbering. Even assembly (micromon on the C64) had what I thought were line numbers at the time. I was 10 years old! I spent close on 4 months looking over shoulders and copying work before it all started to sink in.
I'm not really sure if BASIC was a good thing for me or not. C and C++ were though - that's where I really learned how little I actually knew :-)
Exactly. It not the language that makes a bad programmer, is the lack of knowledge.
Speaking a language that has dominated the market is "garbage" because it would be "too easy" to "superdevelopers of today" (so they think) is a huge childish that I can only see people who think using 50MB of ram to make a "hello world" is acceptable.
Religion: The greatest weapon of mass destruction of all time
I really wonder what your demography was, and the profession of your father/mother...
For me personally, I cannot envision myself programming at 7. Around that time there was just the commondore 64 around in very specific households; I used to go play space invaders on the commondore of my friend, but we never got further as typing in the commandline to start something up (and go play outside while we waited it to boot up) and his parents and brother being very protective about the PC and the PC-time allowed. So there was no programming for me at all around that age, other then gaining a great interest playing alot of nintendo, tiger games, or even 70s "television" games.
Up until my 14th I just screwed open my electronic toys trying to understand it, to the hating of my parents because I'd just drive it for a while until bored and get out the screwdrivers. I kept on doing that until I hit puberty and tried to screw other things, unsuccessfully mostly. Around that age the internet started to integrate in my life, but I was with the first few percentage of people even aware of the internet. This is where my programming-story started: before I already wrote retarted batch-files but with the internet I moved up to mIRC programming bots (printing out the full manual and reading over it day and night, those were the days) to help with fileserving, got into FTP-concepts to circumvent the ISP "port blocking" and eventually went to JavaScript because the animated gifs were sortof retarted but I had problems getting the gist of Turbo C. After understanding the concept of JavaScript, becoming pretty decent at it (and webconcepts with it) I was forced to look into PHP and databases. Once I got bored with that, I wanted to do "real things", and picked up C++ in which I've ended up doing socket and LPT programming. After that, picking up new languages and getting things done has become simpler and simpler.
But it's hard for me to imagine programming at the age of 7 (other then a VCR or something), I really didn't have the information or environment until I had a internet hookup. And that concept only came into my home with my brother starting IT at uni (which he gave up pretty soon for consultancy and certifications.)
I think we can keep recursing like this until someone returns 1
I was always told my "generation of programmers" would be the last who will be articulate in both procedural and OOP programming and will most of the time or migrate the one to the other, be the last to maintain procedural languages while the next generations will only be schooled to understand OOP-concepts.
That was the period .NET 1.1 was being a horrible pain, and .NET 2.0 was the new promised land after Java (they've took the main concepts, and sortof sweeped the horrible things under the carpet in a VB-like fashion).
I must say, I've often been the "new guy who refactors the messy monster code nobody is wanting to come near" and haven't seen much full OOP-implemented architectures, mostly an improvisation of a mix of technologies...
I'm guessing the next generation will be schooled directly in C# as you say... As it teaches OOP-concepts, doesn't have the "transitional and historical workaround", and helps you protect yourself against making too big fuckups.
I think we can keep recursing like this until someone returns 1
While I don't much care for Python, you have never programmed in either BASIC, Python, or both. Comparing BASIC to Python is like comparing the Model T to a Ford Cube. Yes, we get it, you don't like these newfangled languages. But Python is in no way analogous to BASIC.
Python has scoping, functions, good control structures, and a usable set of data structures.
The conventions in C are for the most part design choices used to encourage you to program in an efficient manner.
I assure you, BASIC is not easy. But that's also why comparing it to Python is beyond stupid.
I use VB.NET (2005 and up) mostly at work. Back in the olden days when I was in college, we learned, in order. BASIC 1 & 2, FORTRAN, COBOL 1 & 2 and then ASSEMBLER for your degree.
I was a VIC-20 hacker and then moved to C-64 and then ATARI 800XL (mixing basic and ML) before I started my college days. When Turbo C came along I bought that and learned a bit on my own, by that time they were also teaching that at the college I had went to so I went back and took a semester of C.
I like all those languages, but BASIC is still my favorite. I'll take an app I've coded here for work, and for fun, recode it in C# (or even C...C++ I consider a nightmare), but really, there is no difference anymore speed wise for your basic apps. Yeah, I'm not writing device drivers or sending bits through serial ports or IN and OUT ing to the sound card, but then not everything needs to be coded to the bare metal ALL THE TIME. When it's required I can do it, but most of the time, it's not
Yeah, back in the day I ditched basic for a while and used C because the basic interpreters were slow. But today, I'm happy with VB.NET (and C#).
I'll never understand the hate for BASIC. It's a tool, you can use it right or you can use it wrong.
Perl as introduction to programming for kids?
You will be lucky if they put you in prison for life, for child abuse.
If they don't, you'll have the misfortune to spend the rest of your miserable and short life in the grim world you will have created, filled by monstrosities from worst nightmares.
If BASIC was mutilating the young minds, Perl is in the line of Cthulhu summoning with minors.
45 5F E1 04 22 CA 29 C4 93 3F 95 05 2B 79 2A B2
It had PEEK and POKE... what else do you need :-)
If Python has a problem as a language for tutorial programming, it is probably in its rather limited error checking.
Well, one can have an entire discussion over the merits of, say, static vs. duck typing. IMO most type errors are so grave that they are caught by even simple testing (remember, Python is still strongly typed), and messing with the type system especially if you're a beginner is more trouble than what it is worth... in particular in languages like Java where the OOP stuff can make the learning curve far more steep than it needs to be.
I want to play Free Market with a drowning Libertarian.
For those that ventured into assembler will understand the goto and line nums of early Basic
That just makes learning and developing your mindset about programming much slower. Programming is, at least to me, a formulation of a computable solution in some Turing-complete language. The machine-specific stuff is actually not the part that the human is most required in, as it can be pushed to be done by the machine itself.
A wrongly constructed algorithm fails just as much in a higher-level language as it does in a lower-level language, but allows for clearer, faster understanding of why it actually fails. The machine-implementation failure related stack traces are code-monkey style stuff in comparison.
I want to play Free Market with a drowning Libertarian.
Most importantly it's not a toy language.
That's why it should be kept far away from beginners. What if they accidentally type "import skynet", huh?
I always found the original Basic, with its gotos and line numbers, to resemble assembler. When I was around 10 I found it very easy to make the jump from Basic to assembler. I would really hate to make the jump from Java to assembler if I were now starting out. Not that I would advise programming in assembler but it is a very good thing for all programmers to know . As basic and assembler both grew up they both even added labels. So in a way learning to get anything done in Basic was actually quite hard core.
Aren't there excellent programmers that started in any language? Heck, I started with mIRC scripts and even THAT was enough for me to develop logic... Whether there are excellent programmers that started with Basic or not, there would be no easy way they are 'excellent' because of BASIC and not despite that...
Copyright infringement is "piracy" in the same way DRM is "consumer rape"
God, Logo is the worst pile of crap to force on a child ever. BASIC is a far better choice. Trust me, I was forced onto BASIC and then Logo in elementary, and that Logo class was idiotic. I felt like I was getting dumber by the minute.
Disclaimer: I am now an EE, not a CS.
When you're afraid to download music illegally in your own home, then the terrorists have won!
My 1st Hello World! was done on a Pet. I then got my own 1st computer a TI99 4/a that had of course BASIC which I played around with but only in a very limited fashion. (Again mostly Hello World! type stuff. Hey I was not even 10.)
It was when I got my //e that I really started, and had the capacity to, looking beyond a simple goto loop and did so with that Apple. It was neat because at the time there were all sorts of cool tricks that people would use. Such as poking a small assembly program into $300 to speed up their Applesoft program.
Furthermore the monitor was right there. You could drop into direct assembly mode at any point. I had a friend who could program directly into the monitor and it was very cool to watch. My talents were much more modest and I needed a real assembler to do anything more than the very basics but it did let me cut my teeth on something other than BASIC.
So my point would be that BASIC is ok to start with but it should never be the only thing that people who want to know what programming is all about should see. From those roots I remember looking at Pascal and Forth just to get an idea of what out there. Mind you I am not, and have never really been, a coder other than scripts and whatnot but I have the background to at least sit at a table with programmers and have an intelligent conversation. Gives me nice nitch in being a liaison between the suits and the hardcore geeks.
Really, I know what I'm doing...Ohhhh, look at the shiny buttons!
We had to do Ada for CS 101, which wasn't awful, but didn't seem like a very solid language to have to use after spending High School teaching myself rudimentary usage of ASM/C/C++/Java/C#.
When you're afraid to download music illegally in your own home, then the terrorists have won!
My problem with this is that Python does not require you to specify what type is expected.So, when maintaining code, you have no idea what this strange thing being passed in, other than it seems to support methods foo() and bar(). I keep having to read code, written admittedly by hardware engineers, where some strange object is passed through many layers of call. It may be documented somewhere, but the source code leaves me no way of finding it. It makes for unmaintainable code unless you are meticulous in your embedded documentation. Even the best of us fail occasionally in this department, and IME Python encourages this tendency.
Consciousness is an illusion caused by an excess of self consciousness.
Yes, yes, yes, and when I recieved my Doctorate in Baraminology from Thunderwood College we...
Wait, Wollongong is a real place? You Aussies and your crazy words...
When you're afraid to download music illegally in your own home, then the terrorists have won!
My first real programs were written in perl. While perl can be sloppy, at the time, there were few other languages that had that kind of power. No compilation, instant feedback, and can do pretty much any task you can think of. I think perl, in some ways does remind me of BASIC.
10 n=n+1
20 Print "Hello"
30 if n=10 goto 50
40 goto 10
50 whatever
I am an English major, and I don't know if the above code would actually produce 10 "hellos," as I expect, but I know conceptually that this is how computers work. And therefore I know enough to understand why my spelling checker, for example, doesn't always do what I expect.
I can't believe that learning BASIC causes blindness. but if it does, most young programmers would like to be allowed to keep doing it at least until until they have to wear glasses.
No, I still think its best not to start off with anything other than something really simple. The point is not that you get to learn OO or web services or whatever, but that you get it to work immediately, with interactive debugging. I'd even go so far to say you should learn a scripting language (like php or python), but they tend to be too web-centric and not-so-easily debugged.
Hmm, that said, there is a PHP debugger/IDE. Perhaps that would be best to start with.
Then, once you have the basics of programming in you, you can branch out to new stuff. But its important to realise that what you or I know, the 10 year old newbie to programming doesn't have a clue about. He has to learn the stuff we've forgotten to take for granted.
You could start with Pascal as the 2nd language, and extend yourself to Modula-2 as the third, but you'd probably be better off learning C as the 2nd, and C++ as the 3rd.
BTW. today OO isn't so important - its all Web Services. Oh sorry, Cloud services. Oh sorry, the *next* big thing ;)
BASIC was a perfect language for a world that did not grow up with digital technology. It didn't require a lot of book time, it didn't require much project planning, and it didn't require an appreciation of abstract computing disciplines. Never underestimate the value of a language that produces results after one line of code.
Eons ago, I took a computer science course for nontechnical majors at the University of Illinois taught by Daniel Slotnick, creator of the Illiac-IV and a pioneer of parallel computation. He made us write code in binary for a theoretical machine. On paper.
That is the worst possible way to create a computer program of significant complexity, with all the spaghetti-code flaws of the original Beginner's All-Purpose Simplified Instruction Code (BASIC) plus many of its own, especially mind-breaking tedium. I utterly hated it, and actually took an F on that exercise, but I got the point, completely. I had a sudden deep respect for assemblers and especially macro assemblers.
Too many modern programmers have no real idea how computers work, or even how languages work, or why they're built the way they are to solve what kind of problems. Getting under the hood changes all of that. When I moved on to C, I understood how it functioned ("really a preprocessor for PDP-11 assembly language").
I don't know whether the cited blogger is right when he says this sort of thing makes your brain stronger. I do know that it prepared me to understand viscerally the significance of higher-level languages and advances in the art.
I did dabble a bit in BASIC along the way -- on a CDC Cyber-9000 and a Commodore VIC-20. The latter made me understand that all of this can be fun.
In my case, it was trying to explain to my father why I felt my game was more important than that silly quicken folder. That wasn't a game. We only had 40MB to deal with and that was getting in the way of what makes a computer good. Eventually I found QBASIC and GWBASIC on there and it was all I needed to make this machine do what I wanted! I had previously learned on a TRS-80 by copying code out of a magazine and editing it here and there. The new computer didn't seem to have the same interface, so I figured I was at a loss and this machine could only deal with machine code. It wasn't cool enough to have a prompt that you could just start programming in.
Every time I start to have faith in humanity, I ruin it by driving to work between 7 and 8 am.
I'll make a simple observation here.
At the end of TFA, there's a bit about how BASIC allegedly helped the author "the ability to think about a hundred things at once" which in turn helped quote strings appropriately for a DB -> Perl -> JavaScript -> HTML situation. It apparently only took three times to get it right.
And then comes the assertion that no "amount of structured programming helps with that kind of frankly messy problem". WHAT? No, entirely wrong. A simple but good solution would be to use literal string quotation (instead of having strings interpreted at every step), or a String transformation at the end. You know, so that you DON'T rely on having all of DB -> Perl -> JavaScript -> HTML and your string in exactly the state they are right now, and actually can make changes to any of these without making changes to everything else as well.
Really, if the author of TFA deems his skills with BASIC as valuable it is mainly because he's good at entirely going against common modern programming guidelines and likes to create situations (as BASIC near automatically did) where one constantly struggles to make the least amount of changes to code to not be forced to do more changes in code, and needed to think of hundreds of things to not hit a wall, but still fails at least a few times due to the complexity of it all.
The rest of the article is more than equally silly, mostly the repeated assertion that various abilities were bestowed onto people who learned BASIC due to the adversity of programming in it. Basically, it boils down to "your brain probably grew from the challenges and you got skills now". I can't agree, I only learned BASIC specific, entirely useless skills from BASIC.
Rigorous programming is as much of a trap as sloppy programming. In my experience programming projects often fail entirely due to too stringent, too rigorous programming methodology. Totally neglecting the "let's get it working" angle gets you only failure.
And yes sloppy code causes disasters. But at least they cause disasters only after actually running the code. Rigorous programming causes disasters before the first cpu has seen the first bit of your program.
Besides is there any argument against sloppy programming except the sort of academic frustration people have with badly spelled letters, not even reading the contents ?
Besides, extremely sloppy programming is how all big successes started, linux, windows, hell even unix started out more than just a little sloppy. And the very popular ruby language ... talk about sloppy. Yes it's very nice for certain kinds of programming, but everyone can see it's the next perl.
The only significance of Dijkstra's comment is that it proves that Trolls predate Slashdot.
This when I've been a Linux kernel developer for 10+ years now which is 100% procedural ANSI C.
If you'd said 99% I might have agreed.
But no, Linux isn't 100% procedural. The file systems are object oriented---each file systems presents a vtable to the vfs layer, which is then used to translate the `read' system call into, say, the reiserfs `read' call, or the ext3 `read' call, or the [...].
In other words, the vfs layer invokes the read method of the class corresponding to the file system in question.
(And no reductionistic arguments, unless you want to argue that programs aren't procedural either, because there are no procedures but only a bunch of GOTOs with a stack...)
When I went to college, I was originally a Civil Engineering major. All engineering majors were required to take an "Intro to Programming" course taught in FORTRAN.
My previous BASIC exposure helped me code in circles around my classmates. It was pretty obvious then that having previous BASIC experience was a great asset.
I enjoyed my FORTRAN class so much that I decided to switch majors to computer science, where I had to take another "Intro to Programming" class, this time in Pascal. Again, previous BASIC exposure had me way ahead of my classmates.
I have always been puzzled by Dijkstra's dislike of BASIC, you could certainly notice a big difference between students who, like me, had been previously exposed to programming and those who hadn't. And back in those days, most personal computers came with a BASIC interpreter, therefore "previous exposure to programming" pretty much meant "exposure to BASIC".
Expert Java EE Consulting
BASIC is terrible (Score:0, Troll) by Ed Dijk (3102) 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.
I did both at that age as they were the fashionable languages to introduce kids to programming. I actually quite liked Logo, although you have to pick up recursion before you can do anything really cute with it.
Disclaimer: I am now a CS, not an EE. :)
Slashdot: where don knuth is an idiot because he cant grasp the awesome power of php
And then Pascal and C. Quite frankly BASIC is very well suited as an example on how not to design a programming language, as its flaws are glaringly obvious. (Java, which is just about as bad, requires much more effort and experience to find and understand its problems.) That makes BASIC an ideal first language to move on from after about a few weeks or so. Those that are comfortable with BASIC and do not want to move on even after a few months should probably be considered unfit to become programmers.
Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
FORTRAN man, eh? No wonder you posted as AC.
"The urge to save humanity is almost always a false front for the urge to rule it."
- H. L. Mencken
Its how you use it. A good programmer understands that no matter what programming language they use, the same structures apply (ex: branches, loops and function call/gosubs).
I write my first few little programs in various basic languages. I learned quickly that programming in blocks (one entry point, one exit) simplified things greatly. My first real training was in college in Java. This just further emphasized proper coding structure and built on what I had already learned on my own.
Since then I can develop programs in C/C++, Java, Ada, assembly, DXL, Perl and other languages but no matter what the language is I simply picture what structure I want to use and then figure out how that language can implement that structure.
Ultimately its not the language, its the developer...
I'm curious about what kind of "bad habits" can be learned using modern dialects of BASIC today?
Then again, the current incarnation of Visual BASIC and other similar implementations of the language are such an abomination that you can hardly call them BASIC either. Well, I should note it isn't the earlier implementations of Visual BASIC, but rather when some C programmers got ahold of the language and threw out some of the exceptional power that BASIC holds over other languages.
I'll admit that the traditional "Dartmouth BASIC" can result in some unnecessarily complex spaghetti code, but then again it also shows who the sloppy programmers are when they try to do tricks to save a couple bytes of code that ultimately makes code maintenance almost impossible. I've always hated "clever" programmers anyway, and this can be a pitfall in any language. Then again, this version of BASIC was designed to be used on a line printer terminal.
I don't want to admit to how many or how large of a program I've written using that software editing system, but it is more than a few and some fairly large programs.
BTW, I don't consider Python to be today's version of BASIC. Instead, I would consider Scratch to be the true philosophical descendant of BASIC. If you've never tried this programming language out, you are missing out on a very unique experience, and something that is certainly going to influence software design over the next century or more. For my own children, this is the software development environment I've been using to introduce basic software development concepts, and it teaches object-oriented design and event interrupts right from the beginning. Who knew that an introductory language could introduce multi-threaded design so easily? My only major complaint is that it encourages the use of infinite loops not as something to avoid but even implements a specific construct to push its use.
Yes, Python is pretty good, but it isn't an introductory environment.
Like most, I disagree. The bottom line is that my early days programming BASIC (first on a Commodore VIC 20, then on an Altair, then on a Commodore 64 which is about when I graduated to assembler, then to C. But I still did some BASIC right through the 90's from time to time until I learned perl for "quick and dirty" stuff.
I think that the most important thing that BASIC taught me was that, there had to be a better way. So, I started to learn different programming languages, different environments. And I eventually learned the habit of using the best language for the job. If I needed to make "Patrick Rox!" scroll up the screen, ad infinitum, I used BASIC. Along the way I was forced to learn many languages, and learned most of the standard ones as well as some oddities (like Forth, Prolog, etc.) If I needed to write something fast, I used Assembler. If I needed to write a lot of code, I used C or Pascal or (later) perl. Nowadays, I do most of my code in Ruby, but at work I just got stuck with a project that's a combination of perl and shell and it was no biggy, and I decided yesterday to do a personal project in Python/Django because of it's better unicode support (the project will be mostly "about" handling Greek texts.) From an early age, I developed a solid understanding that languages are fungible, and that there's often a better language and environment for the job and than the one I might know best.
This contrasts with the kids I see nowadays (grump grump) who, if they bother to program at all, only seem to ever learn one programming language and one programming environment and tend to think that that's the end-all-be-all solution to everything. If they know VB, it's all VB. If C++, then it's all got to be C++. Java, python, ruby... you get the idea. Why? Because none of those languages (except maybe VB) really suck, and certainly none of them suck nearly as much as good old Microsoft BASIC on an early 80's Micro did. So it's easy to just stay stuck in a single language and never learn a vital lesson that separates "prorammers" from "people who write some code."
"He who would learn astronomy, and other recondite arts, let him go elsewhere. " -- John Calvin, commenting on Genesis 1
Most languages sort of enforce a framework whether you like it or not. Not BASIC.
When I was a kid and I learned BASIC, I thought it was hot shit. And I didn't have a great amount of trouble learning Pascal.
But, when I got older and I started programming in C++ and eventually in PHP, I noticed that almost nothing from BASIC carried over. If it weren't for iterative loops, I think there would be nothing of value to come out of BASIC in learning other languages. Even in Visual BASIC, it's astonishing the number of times you end up using a C-like structure just because that's what works best.
The only thing BASIC really does is offer an easy gateway into programming. Is that good enough? I don't know.
I scream. You scream. I assume that means we're both acquainted with the problem. We proceed.
You can use the calculator, as soon as you know how to do it by hand
What trigonometry teacher asks students to compute a cosine on pencil and paper using Taylor series or CORDIC? My math teacher gave students seven cosines to memorize (0 to 90 degrees in 15 degree steps); for anything else, students were expected to use a calculator.
I've been teaching my 7 year old how to program, and they think it is a really cool thing to do. Yes, it isn't something that easily comes to them, but it is something they are certainly capable of doing.
I don't know if you've seen it or not, but Scratch is a programming language that fairly easy to pick up and extremely powerful. 7 years old is still a little bit young even for this language, but not impossible, and certainly you don't have to be a pure genus to be using this language at that age. I'll admit, however, that even this language is more geared toward middle-school aged kids (10-14 years old) where kids that age seem to have the patience necessary to grok the concepts and be able to make something useful that goes beyond the simple examples.
It doesn't, however, take a college degree to learn at least the basics of computer programming. I started to write my first programs when I was 10, and that was several decades ago.
BASIC evolved over the years. If memory serves, Basic at the time Dijkstra made these comments had no functions with local variables, no structured control statements, and so on. It was more like assembly language with good string support.
I started with BASIC and now I'm a professional Visual Basic developer!
Sometimes I wished `break` could take argument of how many levels it should break out of
It can in PHP. Java and Perl have a different solution: label the start of a loop and then use that label as the argument of break. In C, it's just a matter of discipline to use goto only to replace a throw or labeled break.
10 I started with GW-BASIC, and now IF my colleagues need some programming help, THEN I am the GOTO guy.
SIGSEGV caught, terminating
wait... not that kind of sig.
programming in plain C is considered harmful under almost all circumstances anyway
On a lot of systems smaller than a PC or a smartphone, environments like Java and .NET introduce too much system overhead. If you have 4 MB of RAM, you usually don't want to devote 3 MB of it to the runtime. Are you trying to imply that "almost all circumstances" involve comparatively big computers? If not, then what am I missing?
I cut my teeth on BASIC, fell asleep in Pascal class and ended up with a degree in Journalism. Which I then used sparingly while earning 100K+ writing VB apps and managing software development projects. The moral of the story is that what you learn is not nearly as important as what you do and the quality with which you do it.
Code is related to classes, data is related to objects.
How does this dichotomy handle prototype-oriented object systems in languages like Self, JavaScript, or Lua, which don't have a solid concept of a "class"?
I agree. A good library or Framework allied with the basics of the language and some knowledge of best practice probably go a lot further than people give credit for. I too learned BASIC (BBC-Basic) and had a lot of fun with it. Was taught PASCAL and Modula2, but I struggled with C. Pointers and memory management and the lack of instant feedback that you get with BASIC really put me off. I spent years with some 4GLs and database specific languages before a very well structured, framework heavy proprietary OO language eventaully took me to Java, which is where I am now. However, I will be revisting C and ObjectiveC in order to do something with the iPhone. It's not nearly as daunting now as it once was.
Should have said What intro-level courses use C or C++ "at relevant, non-reject universities"
when you think of basic - you talk of GOTO statements & line numbers.
but modern Basics just havent used Goto statements or Line numbers in almost 2.5 decades!
except for some syntactical curiosities - the code you write with basic
supports the same structures as C, pascal, or java for decades already.
when's the last time you've seen Basic code? did it have line numbers or goto statements?
how about variable records (structs), function passing, and C-like dimensioning:
| local FN generateRawMoves(board as ^boardRecord, moves(0) as moveRecord)
|
| dim as long pieceMoves, numMoves, querySquare
|
| numMoves = 0
|
| for querySquare = 1 to 64
| pieceMoves = 0
| long if board.square[querySquare] 0
| pieceMoves = FN pieceTree(board, moves(0), querySquare)
| end if
|
| numMoves = numMoves++
| next querySquare
|
| end FN = numMoves
basic as it was 20-30 years ago is not what basic has become.
on the mac, there's currently a very useful (free!) futurebasic5 to C
cross-compiler available here, with an active 20yr+ user community:
FBtoC: http://www.4toc.com/fb/
|
| FBtoC 5.4.4 creates Mac OS X universal applications
| (Mach-O executables) from FutureBasic source.
real basic allows object oriented (cocoa) code, and is cross-platform:
RealBasic:
http://www.realsoftware.com/realbasic/
basic has also been adopted to some new paradigms.
it used to be that basic wasn't compiled, and interpreted languages
were considered too slow -- now basic is compiled, and java abounds.
or -- instead of using csh for scripting -- how about basic??
Apple I BASIC as a Mac OS X Scripting Language ./reverse.bas
http://www.pagetable.com/?p=35
|
| $ cat reverse.bas
| #!/usr/bin/apple1basic
| 10 DIM A$(100)
| 20 INPUT A$
| 30 FOR I = LEN(A$) TO 1 STEP -1
| 40 PRINT A$(I,I);
| 50 NEXT I
| 60 PRINT
| 70 END
| $ chmod a+x reverse.bas
| $ echo MICHAEL STEIL |
| LIETS LEAHCIM
basic aint what it was - so stop this thirty-year old gripe against goto & line numbers... aaargh.
In C++, code still goes in .text sections, and data is still on the heap (or possibly .data or .rodata), so the mixing of code and data is an abstraction.
In C++ implementations, every object with a virtual method carries a hidden field (whose name is unspecified) pointing to an object representing the object's class. This class object acts as a virtual method lookup table full of function pointers. So if you're opposed to function pointers, you're opposed to the way most C++ implementations handle method calls, but then you're also opposed to languages like Lisp and Python that treat functions as first-class objects.
I get the feeling that a lot of posters think of BASIC as 1964 Dartmouth BASIC, or GW-BASIC. But is that entirely fair? Various versions of BASIC have, pretty much, abandoned the "GOTO LINE NUMBER" model decades ago. BASIC may still support the GOTO statement, but I think most languages have some form of "goto." There have also been compiled versions of BASIC for several decades.
BASIC was not originally designed to be an object-oriented language. But, neither was C, and C led to C++, Objective-C, and Java. Other languages not originally designed to be object oriented include: Perl, PHP, Pascal, and - I'm sure - several others.
Python has scoping, functions, good control structures, and a usable set of data structures.
BASIC has had all that for decades. Clue: there are many versions of BASIC which have progressed since 1964.
they may not only be dead wrong but also inspire other people in pretty stupid ways. On the first day of my ugrad CS education the professor, most likely influenced by Dijkstra's absurd statement, had students raise their hand if they had previous BASIC programming experience. Then, he went on a rant claiming that we, the BASIC programming kind, would have virtually no chance on graduating from this institution. Couple of years later he had to eat his own words and hand me over the price for best student. Later I was one of the few of that class that got PhD in CS. So there Dijkstra!
Hey idiot. When you were just smear of cum in your mom's vagina, we were writing code. So shut the fuck up.
Every time I use Java I'm reminded just how much I miss the old GOTO statement. Java can take a program that would take ten lines to write in basic and turn it into a huge pain in the ass with multiple methods and nestled loops.
SJW: Someone who has run out of real oppression, and has to fake it.
The deal is that if you're writing generic enough code, you shouldn't really care what it actually is that you've got, as long as it works as required. Explicitly spelling out things like interfaces help the compiler, but is generally redundant information.
Documentation should always be written of course, especially when behaviour needs to be documented. This is something that a static type system won't help with.
I want to play Free Market with a drowning Libertarian.
Not the one I use at work.
And VB .Net doesn't count as a BASIC.
But perhaps the biggest problem is that BASIC doesn't really mean anything because there are so many wildly incompatible, and poor quality implementations. For that alone it doesn't resemble Python at all. You get Python, you basically get Python. BASIC you have to re-learn it every time (and never like what you hear.)
Which implies that you have to write bug-free code. If you write generic enough code with bugs in it, how is the maintainer to know which incomprehensible operation on which inscrutable object is wrong?
People tend to document the original class better than random uses of the class. With static type checking, you can get back to the declaration and at least find what the class had in it when it was created, which will give you some idea of its use.
This was not helped by the fact that the implementors overused dictionaries. These inscrutable objects contain dictionaries of values indexed by abbreviations opaque to those not in the secret order.
Consciousness is an illusion caused by an excess of self consciousness.
In the 80s, BASIC had no compound objects, conditional blocks had to be coded as conditional jumps to numeric line positions: machine code didn't seem too different, and was a necessary step to get anything to run at a decent speed.
Yeah, my programming went more or less along the lines of this (skipping database languages and languages only covered as topics in a class with no significant amount of code written):
BASIC --> Pascal --> C --> Ada --> C++ --> PowerScript --> Java --> C#
After learning Pascal, I still only have a single exit point for any loop or function. Set a boolean and check it, last few loops are effectively NOOPs (not the most efficient, but I can tune those out if perfomance becomes an issue). Only one return per function. etc. etc. My BASIC code, though, probably overused GOTO.
IMO Python-style genericity makes code much briefer and manageable in the sense that it is easier to see that some piece of code, in isolation, does things correctly as long as the assumptions regarding the objects given hold. And as the type information is there at runtime, type errors actually crash the program in testing very quickly, after which it's just a case of verifying where you're making that call and what it is you're giving the function.
I do understand what you're saying, but simply am a bit unimpressed by the supposed benefits of explicitly telling the compiler what you already know.
By the way, Lisp wins here in general; it's duck-typed to begin with, but lets you annotate type information, which both helps the compiler and and can warn you when the compiler can tell the type annotations do not add up.
I want to play Free Market with a drowning Libertarian.
It has nothing to do with the language crippling your mind (though some days I do wonder about VB), but because the language has been taught in High School/Middle School Computer/Typing classes where teachers are more than happy to pass anyone who can print text to a screen and type 30 words a minute. It was (, no idea if it is still taught in public school) just a random elective that pretty much anyone could take and pass. Some people pass it, don't enjoy it, exclaim that they can program and for the rest of their lives feel that programmers are overpaid, entitled nerds who would serve the world better if they were ditch diggers.
I don't take advice from "programmers" that don't own a computer. If it's mathematics were talking about, big ideas, yes. For actual real world use, that's just plain crazy. If we all followed academia's approach we'd use a functional language and every application would be mathematically provable. Sure it may take a century to complete, but it will be "perfect".
Yes, yes, the the dark side is so easy to reach, so powerful and tempting!
45 5F E1 04 22 CA 29 C4 93 3F 95 05 2B 79 2A B2
It is not so much telling the compiler what I know, it is telling the source code, in a checked manner, what I know today that the maintainer (who may be myself) does not know tomorrow. It is a big fallacy that source is needed only for man to communicate with machine; just as important is man communicating with man. And if I can get that communication machine checked, should I not do so? Just like assert(), @override, private: and other annotations which add nothing to functionality but reduce finger trouble.
Consciousness is an illusion caused by an excess of self consciousness.
Yep. Everyone should start programming with Commodore Basic V2. It should be the law!
The best I used was on the SinclairQL; beautiful and almost Pascal like, you could create advanced programs without much effort. But the real beauty of BASIC was on the 8-bit systems, really sucky dialects like Commodore basic 2 made you hit the hardware to do anything meaningful so it was a short step to assembly.
A good environment for tinkering with basic is the ZX Spectrum emulator BASin. It has advanced tools for coding and debugging, as well as creating assets for games etc. Sinclair basic really is one of the nicest around with plenty of good doco.
POKE 36879,8
I'm surprised no one's mentioned Blassic yet. It works quite well for the odd project, or just to play around with. You can use it with or without line numbers and it supports a handful of different syntax models. I believe there are graphics/windowing commands, and it supports file I/O operations as well. You can even call programs from the command line and pass arguments to them, similar to regular scripting languages.
Since I'm not that great with other languages, it has proven itself rather useful a time or two.
I learned to program on an Atari 800 using BASIC. Now I can't code my way out of a paper bag.
This ain't rocket surgery.
In the 80s my high school BASIC programming teacher (TRS-80 Model IIIs) made us go through the trouble of structuring our programs very much as if we were coding in Pascal or some other more structured language. At the time I didn't fully appreciate the added burden and limitations that were being imposed on us. Understand, though, that I was a self-taught Commodore 64 BASIC spaghetti coder complete with a generous spattering of GOTOs and not nearly enough GOSUBs. Certainly these programs would have been a nightmare to diagram. That (at the time) unwelcome discipline imposed in that high school class was of immeasurable value later on as this was an excellent prep for other languages later on and for building far better code than if I were to have continued through life trying to code as if I were still on that C-64. Still, I can't help thinking that maybe Pascal would have been a more natural way of introducing that discipline and it leaves me wondering how many in other similar high school BASIC courses at the time weren't so lucky as to have structured approaches taught in connection with a totally not-structured language. But there's the flip side: Without that amazingly accessible C-64 BASIC that can literally be learned in no time with a quick read-through of the user manual and a handful of other peoples' code to pick through, I doubt I'd have ever bothered to learn in the first place.
I kind of miss ZBasic. Small, fast and with an expert friendly editor. (This was before I knew about the VI/VIM editors.) .com executable, including a full screen editor.
The entire compiler/interpretor was a ~60k MS-DOS
I still have version 4.6 somewhere.
Apparently also available on CP/M, Apple ][, Macintosh and TRS-80.
If you want to teach kids programming I recommend Scratch, Alice, or Greenfoot kids want to make games that's why me and all my friends learned basic on our 8 bits was to write games. These environments enable quick game making successes which increases interest.
With the introduction of exceptions and structured error handling, there is no compelling case for continuing using GOTOs. Java, Python, Ruby and many others modern languages does not have goto, and no one seems to miss it.
Modern, Visual Basic-style basic, with full procedures/function calls, full-length symbol naming, and no line numbers, sure.
Old-school, with line numbers (REN anyone?), 2-letter max variable names, and gotos up the wazoo, no thanks. And the latter's what I "cut my teeth" on, and I'm the best programmer on the planet.
Oh, wait. n/m.
(-1: Post disagrees with my already-settled worldview) is not a valid mod option.
"modern" assemblers also have features that make them work nearly as well as a high level language with memory allocation and "function" calling methods that strongly resemble what you might even find when writing in a language like C.
;-)
The C language combines all the power of assembly language with all the ease-of-use of assembly language.
Of course if you are a competent software developer you should know this stuff anyway even if you use a high level language.
Of course, the determined programmer can write a Assembly program in any language.
I can imagine that, then they're still very eager to learn and i'd imagine it's more sortof a puzzle, while they integrate the concepts (also mathematical, I find programs to be downwards compatible with mathematics, but not a requirement to grasp the programming concepts) and learn how to deal with correctness (the compiler doesn't forgive)
It sounds like a large added value for these children, but only when they have the inclination themselves and enjoy the entire interaction (very likely with you as guidance, in a "playtime" setting while they get creative with it.)
Stimulation is really good, sometimes I wished my parents were more stimulating as I was left to find it myself (a screwdriver and librarycard saved my childhood and teen days :)
I think we can keep recursing like this until someone returns 1
While I agree that good programming is a state of mind, the problem is that HR can't recognize good programmers. In fact, a large number of organizations can't recognize the difference between a good programmer and someone who merely has experience in a given language.
There seems to be this notion in Corporate America that if you haven't been formally trained in a language (i.e. college courses), or have some documentation of doing it professionally (i.e., on your resume), then you don't know it and you can't learn it. When I was in college, I really believed that getting a degree would afford me a job working among intellectuals. Instead, I'm working among people just as stupid and ignorant as the blue collar counterparts they hold in contempt. Unable to learn something of their own volition, without having been taught, the notion that someone can, or will, learn something new is completely foreign to them. They can't understand how a C programmer could also be proficient in Java.
The society for a thought-free internet welcomes you.
I feared there was a critical period - there is so much reason to suspect so. So many folks I've met seem frozen, whether in life, in mindset, or in the development methods that they learned during their larval phase.
I still fear that there is a critical period for scepticism, but I'm at least reassured that folks can learn significantly new perspectives and, in particular, to even go larval again later in life and pick up major new skills, whether new programming approaches or the entire suite of new models and mindsets needed to deal with a new field entirely. I've seen folks jump successfully between different engineering fields, coding styles, industries, etc. ...
I haven't seen, personally, folks successfully make the jump between the engineering/technical mindset and the serious liberal arts' points of view. Perhaps there is a more qualitatively different wall there than merely a larger conceptual distance - I don't have a decent theory. The people I see who seem to be centred in-between major disciplines like art, science or engineering tend to appear strongest at that very point, in the interdisciplinary space, rather than having two masteries with an intersection where they choose to play. While some can be extremely proficient and have a broad expertise, they have always appeared to get weaker as they traveled from their personal centre. This is a small set for me, though, thus even more anecdotal than the rest of my ramble.
Sadly, as far as a minimal exposure notion goes this might be extremely hard to dispute by experience. I read an article in Byte 25 years ago on LISP or Prolog, or even did a few weeks of them in a survey course during uni; do these give one enough of a 'seed' such that if one is able to properly discover them later in life it was only because that opening was created so many years earlier? Who can say reliably that they have had no exposure to an idea within a field once entering it. Clearly folks who only got into tech in some year can reliably state they didn't encounter certain concepts before that point - but a single person rambling drunk at a party, something one had forgotten, if that is enough to be a your seed for a future successful exploration of that concept then I can't really claim any significant idea I ever came to understand well later in life hadn't been exposed to me years earlier.
Even reading /. might ...
Bah.
Though I know a handful of different programming and scripting languages, I'm IT by trade, not a developer. So I've never learned C++.
But, I did cut my teeth on the most basic BASICs: for Commodore 64 and Apple II. It was working in BASIC as a wee kid tinkering around for fun that taught me the fundamental principles of logic, variables, and program flow.
So, thank you BASIC! You'll always hold a special place in my heart.
Well if you need a decade or two of historical perspective to understand the issues raised by an article, doesn't that pretty much confirm that the article's premise is irrelevant? More specifically: The BASIC of Djikstra's era isn't the same as the modern BASIC language exemplified by VisualBasic, Cypress Basic or even VBA. So Djikstra's concerns about properly structured programming are no longer relevant -- Basic in Windows is fundamentally different, and open source platforms have abandoned BASIC in favor of other languages. However, if you abandon the specific references to BASIC and acknowledge the fact that some languages are better at enforcing structured programming habits than others, then Djikstra's concerns are relevant. It's far better to teach beginning programmers in Pascal or Java than it is to use Perl, for example.
We are the 198 proof..
Seriously.
If I had to decide what made me like programming, it was being six years old and getting to drive that dumb turtle around a screen (wasn't lucky enough to have the physical turtle). Later I picked up Basic and Hypercard in high school, Modula-2, Batch, C and C++ in university, Perl, Javascript, Java and VBA in my career and personal projects. But I probably wouldn't be doing what I do now if I didn't discover how to draw shapes on screen.
Now, Logo isn't a "useful" language. But it shows kids that you can control the Magic Game Box. And your future programmers will see that, go "cool!", and run with it.
It's the Lego theory - people who end up building things as adults liked to build with blocks and legos as kids. The complexity comes later.
Dijkstra...isn't he that guy that built the crazy computer in Star Trek. Just kidding or am I. All programmers should start out in assembly. This will weed out those that are not serious. Knuth realized this long ago. They should then be made to program in a language I invented called GOTO where everything is a goto statement. This will show them exactly what they are giving up when they go to languages without gotos. Then I would have them write programs that are all in one file and only in caps. See how they like that. And finally I would have them write programs in some kind of XML based language like XSLT (ick). And just so they don't whine about their fancy IDEs they have to write a COBOL compiler in COBOL with punch cards. If they still want to be programmers, we can let them cut their teeth on Scheme for a couple of years using only ed (text editor). Then and Only then should they be allowed to even view Java or any other OO programming language. Amen.
Southern Illinois University Edwardsville. CS140, CS150 sequence uses C++.
I started with APL. After the mushrooms wore off, I switched to BASIC and then FORTRAN and then.....
who cut their teeth on Basic, and Microsoft continues to hire them
Exactly what I was thinking. Nobody seems to touch assembly anymore.
What about exceptions? I've always thought of them as a logical progression of the goto. Possibly as a result of goto being so useful in situations where you need to break out of multiple code blocks such as error conditions. Exceptions fulfill this use case while adding something goto always lacked-- indirection: I remember goto situations where I would redirect the goto or with some logic decide to goto another "higher" place to properly handle an error. Had goto been acceptable, I think that a "smarter" goto would have been associated with exceptions... "Advanced" goto involved labels instead of line numbers or memory locations- it was just the next logical step to make labels exist at run time so one could decide to catch or redirect them by their label.... I never encountered this because I learned goto was "bad" while learning C and pascal and the dogma at the time but when I ran into exceptions, I immediately thought "goto is back".
Think of java-- its all objects. So, we have these silly things called Singletons which only exist because we can't admit it was a mistake to kill global variables so we create a "new" concept that re-invents the wheel we couldn't live without. Even then, a Singleton is not built-in its a hack work around in for the rigid object only dogma (and where classes have runtime properties that is just paying lip service - those are still globals; one could do the same thing with a global struct but that would be taboo...)
Democracy Now! - uncensored, anti-establishment news
you can do so many things in basic and so often they are all bad things to do. the use of goto for looking is a bad practice. I will say that MS took it to a level that made it visually easy for people to make large ugly coded programs that did lots of things that people would now write in java/c# today
Only 'flamers' flame!
Does slashdot hate my posts?
I agree that there is a critical stage in the development of a programmer that will shape the end product.
I was fortunate enough to have Scheme (think LISP) taught to me in my intro CS class (after learning BASIC as a kid and being exposed to other things like Logo and FORTRAN). This opened up a whole new way of thinking about logic structures and recursion that just isn't possible with BASIC.
My university curriculum also included "Comparative Programming Languages" in the second year of CS, which taught four or five vastly different languages. I would find it hard to believe if other schools didn't do the same, as it's just massively useful for a young programmer to get this exposure early in the process.
Ugh. I get so tired of this Elitist "holier-than-thou" crap. Define bad program. Program with lots of bugs? If a program works as intended and it requires no updates, users are happy with it, it's secure, and it is useful, then what difference does it make if it was made entirely using GOTOs ?
There's this "Well if it isn't made with C++ it's shit" mentality again.
Look, you can make really great programs without typing and scoping. And very quickly, too, without bugs. You just have to be good at making and keeping your own conventions, keeping things modular, and doing things in the most efficient manner.
Beyond that, a judge of poor programming? Bite me.
"They said I probly shouldn't fly with just one eye," "I am Bender. Please insert girder."
What if they accidentally type "import skynet", huh?
They'll get an error. Because it is, in fact, "from __future__ import skynet"!
Because, with its gotos and numbered code satements, it made pretty explicit that the computer
was implementing a "program counter" or "program current-instruction pointer" which was advancing
step-by-step through the program and being redirected to another block of code using a jump of some
kind.
Someone who is going to become an excellent programmer will take that, and discover for themselves
that always structuring ifs with gotos as a standard pattern in an if then else organization makes their
programs easier to write and to maintain and understand.
They will also learn to create standard patterns for looping while checking a condition, and
for creating distinct subroutines with structured ways of going to them and returning, including
creating extra variables which are used to pass arguments into a subroutine.
Thus you don't just learn structured programming. You learn what aspects are important about it
(the patterning of control flow, localization of similar purpose code etc.) and you learn the mechanics
of how a compiler is going to make it work i.e. what it will do under the hood.
Great stuff.
I'd put it this way.
-Bad programmers will be outed sooner by starting with Basic.
-Excellent programmers will become even better and wiser faster by starting with Basic and
climbing up out of it.
They will also have a quick straightforward path from Basic down to understanding assembly code and
ways and advantages of structuring it.
Where are we going and why are we in a handbasket?
God, Logo is the worst pile of crap to force on a child ever.
Really? Most programmers respect Lisp, even if they don't use it themselves.
Disclaimer: I am now an EE, not a CS.
Ah, OK. Here's your cookie and a warm blanket.
Dewey, what part of this looks like authorities should be involved?
I'd say that if anyone is considering BASIC as a first language, they should choose Pascal instead.
Compared to which BASIC, for what reasons, and which Pascal ?
But to be completely honest, these days OO programming has become so important that it's probably better to start off in Java or C# from the start.
Do you not think Visual Basic .NET is an equally good platform for learning OOP/OOD ?
In writing .BAT files to run under Windows, the available commands for conditional logic flow are extremely limited. There is an "if" statement, for example, but no "while"" statement. I recall when goto statements and labels became available (MS-DOS version 3?) it suddenly became possible to implement complex logic in .BAT files. Sure, it's not pretty, but it's mighty useful. That primitive syntax still works on Windows today, all the way up to Server 2008. Even though PowerShell is now available, I still like the simplicity and ubiquity of .BAT programming.
If you disagree with my sentiments, please exceute the following code:
@echo off
SET DESTINATION=HELL
GOTO %DESTINATION%
The article seems to be saying everyone ought to use a crappy ancient tool so as to excersize their mental muscles to be able to use the crappy modern tools that are prevalent for now. Because the size of the programmer's skull is limited and will not be getting an upgrade anytime soon, eventually progress will stagnate long enough because of programmers running up against this law of nature for someone with a really good idea about how to do things to catch up and overtake the herd of programmers who have become proficient at producing crappy code.
...
Nearly all the people I'm hiring now have never touched the original BASIC, and those who have are usually valuable (and expensive) because of their long experience. So from the point of view of career evaluation the question is totally moot. And should people should be introduced to programming with BASIC? Is this even a question? Nobody's doing this. Nobody uses it any more. Why was this even posted?
Terry Schaivo called. She said "................"
1. Well, I didn't mean random as in actually generated by SecureRandom, but more like in, "they had nowhere near the control over their contents to guarantee they can hash to a 31 bit value without collisions." For the purpose of that custom brewed hash method that was supposed (in their imagination) to never create collisions in a HashMap, the strings were as good as random, and there was mathematically no way to guarantee the lack of collisions.
There are plenty of Strings which are as good as random in that aspect. User names for example. Car registration numbers. Whatever, really. Above some 5-6 alphanumeric characters that are out of your control, even if you ignore case, hashing it to 31 bits will necessarily always result in different hash codes.
Because that was the "problem" they were trying to solve. They thought in all honesty that a hash collision causes the wrong value to be changed, so they tried to write a hash method which would never cause collisions. But on the actual Strings they used, that was impossible.
2. There are cases where generating cryptographically-secure random keys is actually the right design. The trivial example is: browser session ids. Having a predictable sequence of session IDs is actually considered exploitable. If a user can predict the next or previous key, conceivably they could hijack someone else's session.
A polar bear is a cartesian bear after a coordinate transform.
> Not the one I use at work.
But that is just *you* not really "BASIC"
> And VB .Net doesn't count as a BASIC.
Why not?
> But perhaps the biggest problem is that BASIC doesn't really mean anything because there are so many wildly incompatible, and poor quality implementations.
Ignore those implemenations. Stick with a major version. BTW: that is the same argument that linux bashers use. Also, if you are creating a GUI app with python you have all kinds of incompatible libraries to fight with.
> For that alone it doesn't resemble Python at all. You get Python, you basically get Python. BASIC you have to re-learn it every time (and never like what you hear.)
You may have some points, but you are all over the map. First you compare python to 45 year old BASIC. Then you dismiss widely used VB.NET with no explaination. In many ways, Visual BASIC compares very well to Python. For creating a quick GUI app on Windows, VB is much easier and faster.
I only know my personal experience, unfortunately no one around me knows how to put code together.
Anyway, I started with "GWBASIC" I think, then moved to Quickbasic after some months.
My target is just making games, not even commercially, just because I love designing them, doing graphics, music... My hobby, not my professional choice.
With BASIC, it was easy, and I had the ability to focus on making a tiny, pretty game instead of focusing on the coding part. And it taught me many things about game logic, how things worked behind the scenes.
When I got a big, good enough idea, I jumped from QB to C+Lua+SDL+GL, and, in all honesty, it's not hard, just time consuming (fortunately for me)
The best thing is that, within the constraints of BASIC and a 8086 computer (CGA graphics! 4 putrid colors of WIN!), I learned to optimize code, which is a very valuable thing that, it seems, many game programmers of today weren't exposed to.
Then again, even with such a skill, I can't consider myself (or many wouldn't consider me) a real programmer, I don't feel capable to writing a desktop application, and I ignore the terminology of things. I can build a house and succeed but I am no architect.
Still, what this meant to say is that BASIC can surely teach some things, at least as entryway to "logic" which is the most important weapon of a programmer.
Point is, the OP was claiming that BASIC and Python are in the same language family, which is just false. And as for BASICs with good data structures, scoping, and real functions, yeah, they're probably fine to use.
But such BASICs have as much in common with the BASIC people talk about when they say BASIC is terrible as Java does with C. Probably less, since C is a well-designed language.
My highschool had a mandatory, though only 1-term long class on introduction to computers and what we mainly did was learn about the various parts and were introduced to BASIC. This was in early 80's and we used Commodore PETs. I was 12.
BASIC is still a great learning platform. As a whippersnapper back in '78 I learned the pain of GOTO and moved to GOSUB. Through my own ineptitude I was jarred into functional/procedural programming. Moving to objects after that was a natural progression. Sink or swim.
I was on Basic from 1986 to 1993, and it was the most meaningful years of my life.
Were, by chance, those also the years you discovered sex?
"It if was easy to do, we'd find someone cheaper than you to do it."
(I learned programming first with several flavors of BASIC in the early 70s (plus books about F0RTRAN and COBOL but no chance to use them, then learned Academically Much Better programming with PL/C (the Cornell PL/I compiler, similar to IBM Checkout), then algorithms with Knuth Spaghetti Code and Knuth MIX, then IBM and PDP assemblers, then a summer job with RPGII, then Simscript, then C, shell, lex/yacc, and many other languages.)
Knuth's books on programming were fundamental then, and still are - understanding what machines are doing, and how to think about that, and understanding how mathematics relates to algorithms and programs, and how to think about them, are fundamental to good Computer Science and good programming, and probably always will be. But Knuth's actual programs that he used to teach them were inexcusably unreadable spaghetti code, and MIX was just appalling, even given the goal of being machine-vendor-neutral. It's especially frustrating, because when I first used Knuth's books it was at least in the context of a class with a professor walking us through the critical parts, while now when I want to use them as reference books I've got to wade through that sludge myself. The syntax and structure made it difficult to learn the semantics which are what was really valuable about Knuth's work, and they make them difficult to use as a reference book.
Algol 60 came out around 1960, and widely used for programmers who wanted to share ideas with each other (e.g. CACM, the Communications of the ACM journal, was mostly in Algol 60, though sometimes it used Fortran) and Knuth was writing almost a decade later. He could have done 95-99% of his non-assembler programs using Algol and Algol-like pseudocode, and it would have been much easier to read because you could tell when he was doing a FOR loop as opposed to looking for the incrementation and backward-pointing GOTOs, and when he did want to do things that were tricky it would have been easy to figure out which were the tricky parts. (Lisp was also available around 1961, and for some things Knuth taught it would have been better, but for many things a procedural language is really enough closer to the metal than a functional language that it wasn't always appropriate.)
And MIX? Ugly not-very-machine-like assembler, with decimal numbers and odd-sized words? It's a hopeless thing to use to teach algorithms, except for algorithms that are really about bashing the bits when you need to do that. And yes, the world wasn't as clean or pretty back in the 1960s, and there really were Burroughs machines that were almost that ugly, but still, it wasn't the best choice then and looks even worse now. If I were writing something back then I hope I'd have used something cleaner, though the PDP-8 and IBM 360 didn't come out til the mid-60s, and byte sizes didn't really standardize for a while, even though people pretty much knew that binary sizes made things much cleaner.
Bill Stewart
New Fast-Compression-only CPR http://preview.tinyurl.com/dy575ks
If you have modern control structures, and subroutines with actual local variables, and don't have line numbers, you're not really running BASIC.
If your control structures are limited to "IF something THEN line# ELSE line#", GOTOs, and GOSUB, then you're using the real thing, or something pretty much like it. You can write non-spaghetti code in even the earliest BASICs, but you had to be disciplined enough to always do it, and without local variables, GOSUBs didn't let you write large programs with multiple authors unless you were very very well behaved about agreeing who got to use what range of name space, especially since most names looked like "LETTER DIGIT DIGIT".
Bill Stewart
New Fast-Compression-only CPR http://preview.tinyurl.com/dy575ks
No, not that baroque Common LISP stuff, one of the original LISP dialects, that pretty much just has parentheses and a few simple statement types, or maybe Scheme if you want one that's slightly newer. It's straightforward, simple, clean, beautiful, and powerful enough that you could write the software for, say, an entire universe using it.
Alternatively, if you want a simple language with a short manual designed for kids to use, which is good at drawing lines and circles, there's LOGO; you might not want to write an entire universe in it, but if you want to draw a picture of a planet, it'll do the job (though it'll do a better job of drawing the turtle part and the disk than it will with the elephants in between.) Or if you want one that's not for kids, but lets you pack heavy-duty programs into toasters and is a predecessor of Postscript, there's FORTH.
As far as vast libraries go, you'll see the same thing with FORTRAN; most programming problems are either trying to build utilities for general-programming problems, or trying to solve real-world problems that are more about the problem space than the program space, so it's not surprising that any language that has a clean subroutine interface and a large user community will have lots of libraries written for it. You couldn't do that at all in BASIC, because GOSUBs didn't have local variables, and line numbers weren't locally scoped either, but almost anything other than BASIC or maybe RPG has libraries.
Of course, in practice, I never started using LISP for real applications; I usually use C/C++ or shell/sed/awk. But I've had at least one friend who used XLISP to build prototypes of graphical programs, and found that they were usually not only faster to write than the languages used for the production versions, but also faster to execute :-) And there are a lot of old Smalltalk users around and a few young ones who view their environment the same way.
Bill Stewart
New Fast-Compression-only CPR http://preview.tinyurl.com/dy575ks
It's far better to teach beginning programmers in Pascal or Java than it is to use Perl, for example.
Could you elaborate on this point? I am not primarily a programmer; I am a networking nerd for an ISP. I have however, in the course of my duties, had to utilize a variety of programmer-like skills. I learned programming originally in perl, because it was the closest thing to shell scripting (which I generally understood enough to accomplish my goals) that met my immediate needs. I'm curious what kind of bad habits I may have inherited from my initial exposure to perl as opposed to, say pascal. Specificity would be appreciated as my goal is not to argue, but to hopefully learn and save myself some headaches...
Remember time sharing? We were running BASIC on a Hewlett-Packard Series 2000 Access minicomputer using a Teletype dialup terminal session at 10 characters per second, while the same time 31 other people were doing the same thing. It had a rudimentary operating system and was fairly bulletproof. The hard drive (about 100MB) was the size of a small washing machine.
Of course, it was the secret objective of my classmates to create programs that would bring the entire system to a crawl.
The HP2000 did not directly support any kind of instant messaging (other than master console warnings).
We did some pretty cool stuff in BASIC. My classmates and I created a real-time chat program in BASIC in 1975 that let us talk to students at different schools. Another guy had written a series of FOR / NEXT loops that would play "Blue Danube" through an AM radio plugged into the HP2000's backplane power supply...
Ask Me About... The 80's!
You might as well say that Johnny can't be a poet because his first language was German not English. There's a relationship between language and thought but they are not the same. A good programmer is a good thinker - of a particular kind. The language he/she uses to express those thoughts is almost (but not entirely) irrelevant. For example, I can express myself more fluently Thai than I can in Khmer, even even though I am equally skilled in both. And while I am not a programmer, I cherish my first experience learning BASIC because it gave me an insight into the world of programming that has been invaluable to me in my work as a writer working with scientists and IT specialists. So three cheers for BASIC.
I had no cartridges or cassette tape storage for my TI-99/4A, so I had to type in all the BASIC code from books and manuals. I would then play around with the code to alter games. I once looped a prtion of a game where little stick men would randomly collide with mugs of beer and then fall down with a chat bubble then popping up saying "Whoops too Drunk!", the "highlight" of my programing career! ;-) I ran it on my color TV in a window facing the apartments courtyard. That apartment building was like Animal House circa 1980ish. It was a hit of the party though after the first 2 kegs where emptied.
-Eric
Perhaps, but Visual Basic .NET is still a bit the retarded brother of C#. Sorry to say so, but some of the nonsense that VB.NET accepts as valid code is just unhealthy.
Bad habits can be formed in any language. I've seen bad Perl, Python, C, C++, Visual Basic, BASIC, sparc assembly, ...
You can teach someone to program, but it's hard to teach them to do it well just like anything else in life. They have to see value in doing things correctly. They have to want to comment their code, to format it, to name variables in a logical way, etc.
I worked with several computers growing up including a Commodore PET, Apple IIe, Commodore 64, and was exposed to BASIC. I had a class on BASIC in 8th grade and another in community college (2001). They used BASIC to teach control structures, basic sorting, etc. It worked well for new students (to programming) because the language constructs were simple and didn't get in the way. Conversely, when I started working on my bachelors degree, the university started with C++. Almost every class used C++. Many students were confused at first.
My wife started with JavaScript at her college and then moved to C++. I think it went much better there because they started with a language students could actually see benefit to. If you can code something simple and add it to your website, it makes it a whole lot easier to learn. (yes, it's scary we're both programmers)
I taught myself VBScript and Visual Basic before college because I wanted to do classic ASP development. I wrote VB ActiveX dlls to wrap functionality for speed, etc. I didn't get the hang of writing gui apps right away, but the usefulness allowed me to learn a lot about the language. Student interest is more important than any language you choose to teach with. You need to come up with interesting projects.
First, you teach them how to program and then you teach them why you do things the way you do. You also teach them the skills to learn new languages or it's a waste of time.
MidnightBSD: The BSD for Everyone
But it's hard for me to imagine programming at the age of 7 (other then a VCR or something), I really didn't have the information or environment until I had a internet hookup.
Kids these days! I learned to program on a Sinclair ZX-81 when I was 10. Back in the day we had these things called magazines, but they weren't like the magazines of today. Back then, the magazines had useful information in them like full program listings with commentary by the author about the design decisions. Some magazines had an ongoing contest to see who could write the neatest program in a single line of BASIC code. In addition, we had these things called Libraries that have Books in them that also had fully commented programs for various computers (Mostly, Commodore and Apple). Most of the software I used that I didn't write came from magazines and books, not computer stores.
Not being able to imagine learning to program without an internet connection kind of boggles my mind. The internet has only really been around in the general public for, what, 15 years? What do you think people did with computers from 1950 - 1990?
Oh, yeah...Get off of my lawn!
--
JimFive
Please stop using the word theory when you mean hypothesis.
Better to teach a structured OO language like Python, Haskel and yes Pascal. Java is too hard to get started for the beginner.
One of the historic features of Pascal was that if it would compile it would almost be guaranteed to run (almost). There is a lesson in this as it removes a lot of tedium from the teacher.
Clever languages that are too plastic are too hard for teachers to learn, teach and grade.
The key is the teacher and secondary is the cost but in an Open source world languages like Python, Ruby, Haskel, cost is nill. Teaching the teachers is much harder and more challenging.
Truth is stranger than fiction, but it is because Fiction is obliged to stick to possibilities; Truth isn't. Mark Twain.
Or as Atwood put it: You can write fortran in any language
Excellent and horrible coders exist no matter what language you choose.
The logic that a single language can spoil your mind would only lead to you experiencing fewer languages in order to avoid damaging your precious brain!
I'd wager that most of the top programmers in the world have written significant amounts of code in at least 10 different languages.
Like a lot of people, I started off with BASIC and thought that is how programming was. I never was exposed to anything object oriented. The day I was exposed to C I decided to give up programming haha. But alas, 15 years later, I found a really good book written by the Head First Labs (O'Reilly) all about how to use MySQL and PHP. I think those who were DEAD SET on BASIC back in the day, should have no problem whatsoever using MySQL. It is plain english. Yes it's a database, but it is exciting when you learn to use it. Add some PHP and you start learning the essential format of more modern code. Simply understanding what semicolons, curly brackets, concatenation, and the basic operators do, will get you very far.
*plays the Apogee theme song music*