5 ms·
Not to be contrarian, but Python is even simpler than Basic. You don't have GOTO, but you don't need it. Just using a subset of Python language you can do any
by blunte 6y ago
Not to be contrarian, but Python is even simpler than Basic. You don't have GOTO, but you don't need it. Just using a subset of Python language you can do anything you need, and with less syntactic noise.
- Igelau 6y ago> Just using a subset of Python language you can do anything you need, and with less syntactic noise. Okay, I'll bite. How does one check for keyboard input without blocking in Python? And remember, you said "simpler" and "subset", so do your best to avoid imports.
- publicola1990 6y agoTurtle is packaged with the default python distribution, for as long as I can remember, so I don't find importing it that much of concern in this case. It is like importing math.
- Igelau 6y agoThat doesn't answer the question.
- DanBC 6y agoHow do you draw a line on the screen in Python? Here's BASIC. I'm not saying this is good. But it is easy. SCREEN 13 LINE (X1, Y1) - (X2, Y2), COLOUR
- dragonwriter 6y ago> How do you draw a line on the screen in Python? Using only stdlib: import turtle turtle.penup() turtle.pencolor(colour) turtle.setpos(x1,y1) turtle.pendown() turtle.goto(x2,y2)
- ksaj 6y agoI am guessing that is straight-up LOGO on Python.
- dragonwriter 6y agoNot exactly, but the turtle library was inspired by Logo, and designed to enable fairly direct translation of Logo code.
- publicola1990 6y agoIt is turtle library inspired by Logo alright, but important thing is that it was available from very early versions of python onwards, and by default available when python is installed.
- ksaj 6y agoI didn't realize the lib was in there by default. It is instantly recognizable as Logo, although the syntax is clearly python. This video from Mathologer about solving polynomial equations might be just as easy to implement in Python with that library as it would be under NetLogo (a more multi-dimensional science-oriented implementation of Logo), which certainly justifies having a turtle library to begin with: https://www.youtube.com/watch?v=IUC-8P0zXe8 https://www.youtube.com/watch?v=IUC-8P0zXe8 I'd hate to program that under BASIC.
- amelius 6y agoI tried it and it works. But that drawing window seems almost broken. It doesn't repaint properly when I resize it, and closing it seems impossible.
- indymike 6y agoThis is where a lot of modern languages are hard for kids. You have to find a library to do things you want to do.
- klelatti 6y agoIt obviously depends on the Basic version but I think it's hard to argue that Python is simpler than Basic in general (e.g. OO, FP are quite complex topics for newbies) plus all the libraries - it's a lot for a beginner to take in. I do think that there is an interesting point around whether you could usefully define a subset of (say) Python as a better first language. I've not seen anyone do that but seems like might be worth trying.
- analog31 6y agoBASIC was my first language, and today my favorite is Python. Not to claim better worse, but I can think of some differences from a teaching perspective: 1. BASIC was typically either built-in, or accessible via a single command from the disks that came with the computer. Beginners often get lost trying to install Python. If three beginners independently google "install Python" and follow the first blog that comes up, they will get three mutually incompatible installations. 2. The BASIC interpreters were self contained -- you learned a small number of keywords, and everything else had to be composed from them. Python is huge, and some of its keywords are conceptually brutal for beginners. And that's before you introduce even a few of the familiar packages. 3. Look at the official list of Python keywords. Half of them describe concepts that are brutal for beginners. I'm not saying progress is a bad thing. The Python ecosystem can be bigger today because code is so easy to transport. It needs to be bigger because more complex programs need that stuff to have a chance of working. But teaching Python involves a dilemma that didn't really have to be considered for BASIC: What small subset of this thing do we try to teach? We end up with a subset that looks like BASIC, and we simply tell them how to install it so they have a reliable starting point.
- dragonwriter 6y ago> you learned a small number of keywords, and everything else had to be composed from them. Python is huge QBASIC has 60+ keywords, Python 3 has 35. > Look at the official list of Python keywords. Half of them describe concepts that are brutal for beginners. Here's the list: False await else import pass None break except in raise True class finally is return and continue for lambda try as def from nonlocal while assert del global not with async elif if or yield Which of them do you think “concern concepts that are brutal for beginners”? (I could maybe buy async, await, and yield.) OTOH, QBASIC’s BLOAD, BSAVE, PEEK, POKE, and CALL ABSOLUTE, among others aren’t particularly dealing with beginner-friendly concepts.
- analog31 6y agoGood reply. Maybe the passage of time has smoothed my memory.
- schwartzworld 6y agoNo way. Qbasic has built in graphics and sound. Putting pixels on the screen is way simpler than python.