5 ms·
What is everybody’s opinion on Edsger Dijkstra’s quote “It is practically impossible to teach good programming to students that have had a prior exposure to BAS
by andrewl 3y ago
What is everybody’s opinion on Edsger Dijkstra’s quote “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’ve seen several version of Basic, but I’ve written only a a small bit of code in one of them, and that was 30 years ago. So I don’t know enough about the language to know what his objection was. The language I’ve programmed in the most is Ruby (also my favorite so far), and the one that interests me the most to look at next is probably Pharo. And I know Dijkstra did not like object-oriented languages, either.
- nanolith 3y agoI started writing software as a child, in the eighties. I only had access to various forms of BASIC and machine code. I switched to C in the early nineties, when I got access to Turbo C in middle school. Later, I got access to Minix, BSD, and Linux. I turned out fine. I'm a fan of Dijkstra, but it's best to take his opinions with an appropriate dose of salt. He liked to be provocative.
- sowbug 3y agoThe version of BASIC I learned (Applesoft) had little support for functions and no concept of scoping. Every variable was global. GOSUB acted a little like a function, but barely (no function parameters, and without variable scoping a parameter is meaningless anyway). Without these features, it was very hard to write a program of any size without it becoming a mess. I wouldn't go so far as to say BASIC breaks your brain, but it is almost antithetical to structured programming, and eventually you need to learn structured programming if you plan to write maintainable code. There is also an argument against learning programming with languages that have no concept of a heap. I agree that a C pointer is a weird thing at first, and some people never get it. But I've softened my stance over the years. People can be productive coders without being bit twiddlers.
- analog31 3y agoI learned Dartmouth BASIC on a timeshare in 1981. Variable names are single letter, or a letter and a digit. All variables are global. No function headers. Branching by GOTO. It means that modularity and structure are virtually impossible. It practically forced you to write obfuscated code, and programs larger than a few dozen lines become exponentially harder to manage. Imagine the worst code you've ever seen. People who got good at coding in this way tended to develop mental habits that had to be un-learned when they moved to a more advanced language such as Pascal, as I did. With that said, beginners in any "scripting" language can evolve in the same way, if not taught some better habits. I've seen some Python programs that were as bad as my BASIC programs.
- matthewdgreen 3y agoDid you also use Dartmouth BASIC6 on a DCTS connection? That was my first language, and god it was miserable. But on the same machine we had BASIC8 which was essentially True Basic.
- analog31 3y agoDon't know. It was what we got when we entered BASIC. We didn't have the manual, but only our textbook. The timeshare was on some kind of minicomputer. I later got a summer internship at the facility that hosted this thing, and the rack of modems was as big as the computer.
- matthewdgreen 3y agoI wrote a multi-thousand line conferencing program in BASIC6. It was an absolute nightmare (no subroutines, everything global, line numbers were hardcoded and couldn't be changed.) Weirdly, the experience was almost like learning an assembler as your first language -- you had to keep state for everything. Learning Pascal and C after that was actually a huge relief.
- analog31 3y agoIt's still amazing, considering that there was no networking at the time. Today, a conferencing program would be able to take advantage of phenomenal networking infrastructure, yet instead of multi-thousand, it would be multi-million lines, and still an absolute nightmare. Some sort of Parkinson's law applies: The code expands until it becomes unmanageable. When AI can write code for itself, it will be trillions of lines.
- Brian_K_White 3y agoI've been playing with vintage 8bit machines the last few years and it's true. Nontrivial basic apps have to be written essentially like assembly, or worse even, chock-a-block with single lines with 2 or 3 different exits, and every 3rd line is also a goto target while also still being the ordinary next line in some routine. And it's not because the programmmer was thoughtless or undisciplined. With only a few k and basic to work in, this is just required to get the job done. Outside of something quite as limited as a trs80 model 100, you can have at least some kind of modularity using chain, if you architect everything around that concept, and develop a framework or set of rules you follow the same way everywhere, like having a dispatcher main loop and all other modules all follow some consistent set of standards so that all modules can rely on all other modules working the same way, with a common interface, entrance, exit, params, etc. Instead of functions or gosubs, you are always chaining forward, loading a new file, and sometimes the next file happens to be the one you came from previously.
- deleted 3y ago[deleted]
- wvenable 3y agoI disagree. I've lived through various levels of programming languages and it makes me appreciate features in languages that, these days, are just taken for granted. I've got a few vintage BASIC machines now and some of the code for those machines is almost unreadable. What struck me now that didn't when I was kid was kind of how much like assembly language BASIC can be in some of these computers. On machines with very limited RAM but plenty of ROM, BASIC acts like compression allowing you to write much more complex programs than you could actually fit in RAM if you did everything in machine code. And, like assembly, being terse and clever can result in better performance and smaller code. I'm considering writing a BASIC-to-BASIC compiler for these machines that works something like a JavaScript minifier.
- Brian_K_White 3y agoHah, in another comment I just made the same association, that you had to write basic essentially like assembly to get any actual nontrivial work done. And pointedly, it wasn't a failing of the programmer writing badly.
- whartung 3y agoI disagree with that comment about BASIC, for a few reasons. First, you can say that about any language when trying to learn another. The classic “writing Fortran in Lisp” concept. Learning to write idiomatic BASIC doesn’t prevent you from learning to write idiomatic anything else. Is there some, perhaps, unlearning necessary? Of course there is, as with anything. But it’s not fatal. Second, it’s hard to appreciate how good something is until you’ve fought through something else that could have benefited you, if you knew it. Early BASIC is not very expressive, and therefore limited. When you move on to something more modern, you don’t necessarily take it for granted. “Oh boy, this is so much better!” Now you know WHY it’s better rather than just accepting it as rote. That leads to just a better, and deeper understanding of the whole field. When you were implementing your first B-tree, or hash table in raw C, you learn to appreciate why the one in the utility library, that you get for “free” may well not only be better than the one you copied from your “Data Structures 201” book (since it just may well be a more advanced algorithm), but you’ll realize how it works as well. In contrast just blindly drag and dropping one into your project because you found a link on the internet. Similarly, while it’s easy to condemn these older systems, if you ever go back and try to do work on some of these vintage systems, at their vintage speeds, you may well appreciate why something like BASIC was limited in the ways it was. Are the more advanced language features worth the expense they incur? Maybe, but also maybe not. Maybe for some the habits they learn have life long impact, but I don’t think being exposed to different idioms and methodologies of software development is a bad thing. Let’s folks learn and understand where those sayings and “best practices” they blindly apply (and not always necessarily for the better) come from.
- bruce511 3y agoI'd go so far as to suggest that Dikstra was right, but without the Basic qualification. It is very hard to teach programming to students. Most students at the time had some exposure to Basic (there was little else available to the non-student at the time), but programming is hard. Most students make lousy programmers, especially if one adjusts for the standard Dikstra might have been hoping for. He chose to see Basic as the common denominator in the ones who failed (with the "almost" qualification to cover the outliers) but I'd suggest that correlation is not the same as causation. Then again, who am I to argue with Dikstra?
- teo_zero 3y agoI have zero evidence that this is true. My personal experience is that after having fought with the limitations of BASIC, I enjoyed the power of C: pointers, that most students struggle with, were fresh air for me. On the contrary, I was exposed to Pascal after C, and hated it: haw can you tolerate self- inflicted limitations when you know that there's something better out there? What I learned is: always go from simple to complex, never backwards. So yes, BASIC is a great choice for absolute beginners.
- glimshe 3y agoHe is wrong. It is an infantile view on learning which assumes that your first contact with an area of knowledge creates a lifelong habit that can't be improved with further learning. I started programming with BASIC and easily switched to C, Pascal etc without a trace of BASIC's programming practices.
- Brian_K_White 3y agoWhat's wrong is taking an outlandish hyperbolic conversation-starter premis so literally.
- deleted 3y ago[deleted]
- renewedrebecca 3y agoDijkstra was a brilliant man with big opinions that were often garbage. The fact that there are many great programmers that started with BASIC disproves this quote.