
Python is the new BASIC - edne
http://coffeeghost.net/2008/06/18/python-is-the-new-basic/
======
ZitchDog
Nope, sorry. Python is an easy, good language. Basic was not popular because
it was easy, or even good, it was popular because it was everywhere.
JavaScript, for all its warts and foibles, is the new basic. It's easy enough,
and it's everywhere.

~~~
agentultra
Python, fwiw, is a _better_ BASIC. It includes a built-in Turtle graphics
system and a decent IDE. You can teach loops and draw graphics in just a few
lines of code:

    
    
        import turtle
        
        turtle.setup()
        turtle.forward(100)
        turtle.turn(90)
        turtle.forward(100)
    

And so on. That initial experience has been one of the easiest to teach kids
outside of a visual environment like Scratch. Some friends of mine have tried
teaching Javascript but it's just frustrating: you have to teach looping with
intermediate values and mutation, you have to teach the DOM, and if you want
to get turtle graphics... well you have to scour the net for a poor
implementation that barely works and teach the <script> tag... you get the
idea. It's painful.

The ubiquitousness is a huge advantage. Installing Python on a Windows machine
and running programs is not as easy as "just being there." And being able to
share your programs with a URL has so much potential... potential I feel is
wasted by the walled-garden nature of code and presentation in modern
browsers, crappy developer tools, and a lack of usable built-in batteries.

Python will never be as ubiquitous as Javascript. But it's pretty close: OS X
includes a Python distribution as do most Linux distributions. Windows is the
place where it hurts. I don't know if it could be, "the new BASIC," but it
could certainly be a better one.

(This coming from someone who has fond memories of BASIC on the Apple IIc and
Amiga 500).

~~~
IanCal
> It includes a built-in Turtle graphics system and a decent IDE. You can
> teach loops and draw graphics in just a few lines of code:

What! I've been looking for a nice easy to use turtle program for ages and
it's been right in front of me the whole time!

Thank you for this.

~~~
jmulho
I ran across this book
([http://www.greenteapress.com/thinkpython/html/index.html](http://www.greenteapress.com/thinkpython/html/index.html))
several years ago and had a lot of fun with Python and turtles. See
TurtleWorld at around the fourth chapter.

------
arturhoo
As a Data Visualization enthusiast, I can say that Processing [0] is a great
candidate for an introductory language to introduce programming (and computer
science in general).

It is a less verbose subset and superset of Java at the same time, has a solid
IDE providing great _visual_ feedback as the code changes and you can
introduce real, physical world concepts through classes, polymorphism and what
not in a way that doesn't look too abstract. In fact, many visual arts courses
have successfully introduced programming to an audience of designers and
artists that are usually not fond of it.

Installing it is a 100MB download away and you can even make use of the
universal aspect of javascript through ProcessingJS [1] or p5.js [2], or even
through Python [3].

[0]: [https://processing.org/](https://processing.org/) [1]:
[http://processingjs.org/](http://processingjs.org/) [2]:
[http://p5js.org/](http://p5js.org/) [3]:
[http://py.processing.org/](http://py.processing.org/)

~~~
danielrpa
+1 For Processing. I was talking to a friend about that the other day and used
this very same phrase "Processing is the new Basic".

You can't talk about the joy of learning computers without having a very, very
easy way to produce simple graphics. Processing delivers on that, it doesn't
even require a main().

~~~
arturhoo
Exactly,

Imagine introducing programming to kids at the same time they learn the
cartesian coordinate system, or allowing them to grasp f(x) = sin(x) visually
through experimentation. And pointed somewhere else on this thread, you can
publish your work using the HTML exporter - no need for other people to
install languages, open the console, etc, etc...

For those of you who don't know Processing, you can take a tour at
[http://hello.processing.org/](http://hello.processing.org/)

------
david927
Yesterday I had to explain to my 9-year-old daughter that the bug in her
Python script was due to the fact that she indented with a tab and not four
spaces. Trying to publish her program so that her friends could use it was a
nightmare (it's a console app).

It's 2015 and we have the brightest minds working on this stuff and it's all
shit.

~~~
anentropic
it's 2015 and you're still using the wrong editor

~~~
moistgorilla
What? He doesn't even mention anywhere in his comment what editor he is using

~~~
orf
And he didn't need to, any editor that mixes space indents with tabs is the
wrong editor.

~~~
edanm
Untrue - start editing a file in a tabs editor, download a snippet from the
internet that has spaces in it, and voila - you've screwed up your file.

And this happens _all the time_ to professional developers, much less 9-year-
old beginners.

~~~
takeda
All is needed is to have editor that can show white spaces (i.e. show tabs
differently than spaces, after all those are two different characters).

With that the whole issue with tabs and spaces no longer exists.

BTW if you are copying snippets of code from website "as is" in any language
you will have to reformat it to fit your structure. Also if you copy code so
often that this is becoming an issue I'm not sure I would want someone like
that working for me.

~~~
JadeNB
> Also if you copy code so often that this is becoming an issue I'm not sure I
> would want someone like that working for me.

This seems like a cruel comment in a thread specifically talking about a
9-year-old learning her first language.

------
euroclydon
Professional developers are permanently scarred by software environment
configuration tooling. It's to the point that when I decide to pick up a new
language or technology stack, I dread researching or even picking a way to get
my environment set up, dependencies resolved, and my code built and deployed.
And it's not because the tooling is bad, but just that there is so much of it,
and it's continually being re-written to add marginally new value.

Beginners benefit from there being a single way of doing things. Competing
tooling just leads new developers to waste time early in their careers writing
even more tooling, or writing a bunch of scripts and blogs to talk about how
they dealt with tooling.

Tooling in JS is going to discourage some potential developers. It's not that
bad in Python.

------
32bitkid
Anecdotally, I recently went back and did some QuickBasic 4.5 programming, and
was surprised how decent the experience actually was. I was on a retro kick,
and was working backward/up to to doing some IBM PCjr hardware cartridge
programming/ROM design. I still have a stack of old programming books from the
mid 80's and early 90's and it was great to dust them off and re-read them
with a fresh/older set of eyes.

I ended up doing some simple graphics programming on an old 386sx. Using QB
for high-level code, and interfacting with some ASM for lower level graphics
and data processing, it was actually quite pleasant.

But then, the reference PCjr that I was targeting/experimenting on finally
gave up the ghost and died, and I lost interest in hunting down a new one...
Poor little guy.

What I took away from the experience is while the tools were more primitive,
it wasn't the languages that sucked when I was learning to program in the mid
80's and early 90's as a kid; it was me. _I_ sucked at programming.

~~~
vram22
>I was on a retro kick

Retro programming can be great fun. I dive into it - a little - every now and
then. E.g. Turbo Pascal 3, Turbo C 2, Icon, Forth, BASIC even. I think I still
have a copy of Delphi 1 on CD - it came as a promo with a UK computer magazine
I bought at a roadside newsstand. And used it to write some small apps.
Surprisingly the apps worked even on much later versions of Windows than were
current when Delphi 1 was released, though of course the widgets looked old-
style.

Also fun is exploring offbeat languages (that are not retro). Pike and ElastiC
come to mind as ones I've checked out, and there are others.

------
runn1ng
Mods: Please add "(2008)" to the title.

------
impostervt
As a javascript fan,

console.log("Hello World")

seems pretty simple. Sure, when you get into async it might confuse young kids
(or experienced programmers), but most beginner stuff won't need callbacks.

~~~
mateuszf
True, though there are some inconsistencies in the language. For first
language it probably makes most sense to use a language that seems to be
carefully designed.

~~~
ourmandave
Or maybe the one that comes pre-installed _everywhere_ (like BASIC back in the
day).

------
kcorbitt
When my friends ask me what language they should get started in when they want
to learn to program without a specific application in mind, I usually suggest
Python for all the reasons the article so convincingly presents. So certainly
in one sense it's a good modern BASIC equivalent.

However, I don't think that what made BASIC so magical was just that it was
easy -- it was easy _and you could make the computer do the things you were
interested in_. And while the capabilities of Python are vastly greater than
BASIC of yore, I think a beginner's expectations of what they should be able
to do have grown even more quickly.

These days, typically someone who wants to learn to program wants to do one of
two things: (1) make a website or (2) create an app. For a lot of types of
sites Python is still a great choice (Flask is definitely one of the easiest
frameworks out there to pick up, and I'm actually teaching my wife to program
by making a basic Flask app with her). However, for other interests Javascript
or even Java or Swift may be more appropriate first languages.

I guess that what I'm trying to say is that the best first language is the one
that ignites your imagination with its possibilities, rather than the one
that's the absolute easiest to learn.

------
megaman22
Very true. It probably can't happen for various reasons, but I would love if
windows just folded python 3.2 in as part of the default install.

Python certainly feels, to me, like the most similar language to the old
QBasic. Simple syntax, with advanced features that you can use, or not use,
pretty robust standard library, not great, but usable IDE built-in (I assume
IDLE still comes in the install?)

One of the really cool things about QBasic was that it had support for doing
such a wide spectrum of things natively, and easily. In my first semester-long
high-school course, we went from Hello World, to doing VGA graphics with the
different SCREEN modes and FILL, LINE, etc, making programs that could play
christmas carols using the built-in MIDI commands, and doing some animations
that relied on some of the old-school page-flipping techniques that we take
for granted with modern hardware and APIs.

I don't know of another language that makes it as easy to do all that now.
Python with pygame would be a start, but it's still much more complicated to
get a window created that you can draw in than it was with QBasic.

~~~
scriptproof
Maybe Python has all these qualities, but it is - different -. If you learn
programming with Python, you have to relearn it again to use any other common
language, Java, C#, JavaScript etc...

~~~
gecko
You could say the same if they bundled in Java, C#, or JavaScript. You
ultimately have to make a choice.

------
BerislavLopac
I would like to submit a pair of excellent evidence for the points in the
article: [https://www.checkio.org/](https://www.checkio.org/) and
[https://empireofcode.com](https://empireofcode.com)

------
mangeletti
Articles like this remind me of a quote from the German philosopher Arthur
Schopenhauer[1] (in the context of Python's great success and proliferation):

    
    
        To truth only a brief celebration of victory is allowed
        between the two long periods during which it is condemned
        as paradoxical, or disparaged as trivial.
    

1\.
[https://en.wikipedia.org/wiki/Arthur_Schopenhauer](https://en.wikipedia.org/wiki/Arthur_Schopenhauer)

------
wiremine
I remember trying to program some BASIC back in 1st grade, which was 31 years
ago. I was terrible at it, but I was hooked.

Fast forward to today: my 4th grader asked me the other day which language he
should learn, and I was stumped. I ran through the languages I know well in my
head: Java, PHP, Perl, Python, Ruby, Javascript, Go, Swift... Wasn't sure what
to tell him. His expectations are fairly high, due to Minecraft and video
games and whatever.

So, on one level I agree with the author: Python (or Ruby) is probably the
closest to the original feel of BASIC. You can dive into simple statements
without wrapping it in a class. You don't need to worry about functional vs.
OOP or methods or functions. You can just write some code.

But, as I thought about it, I realized my son already _is_ programming. He's
just using Minecraft's red stones. It isn't turing complete, but it has basic
input and output.

What I'd love to see is something like Minecraft, but with a more accessible
programming environment. There are a few tools out there that do it, but the
gap between the visual building experience and the programming experience is
way to wide. I want him to click on a block and write 3 lines of code to
change the color and give it some behavior.

tl;dr - Minecraft is the new BASIC for most kids today. It just isn't a very
good BASIC.

~~~
vbezhenar
I think minecraft red stones are turing complete. Someone built a simple
processor with those red stones.

~~~
wiremine
Ah, good to know! Got any links?

~~~
fauxfauxpas
[http://www.minecraftforum.net/forums/minecraft-
discussion/re...](http://www.minecraftforum.net/forums/minecraft-
discussion/redstone-discussion-and/348979-working-cpu-with-ram-branching-etc-
save-added)

------
jasode
_> EDIT: When I say that Python is the new BASIC, I mean it as a compliment,
to say that Python is in the best position to become a lingua franca for non-
programmers to learn programming._

I think it is much more common for novice non-programmers to look at some
HTML/Javascript that they're curious about and then tweak the javascript a
little to change the behavior of the webpage. The tweaking may come from
copying a stackoverflow.com answer without unerstanding the underlying
principles (aka "cargo cult"). However, these humble beginnings act as the
gateway to more systematic learning (.e.g read "Java - The Good Parts by D
Crockford", etc).

Because of Javascript's pervasiveness[1], it is much more likely for a
beginner to hack around with others' Javascript and then eventually write
their own _.js rather than download Python and start writing_.py files.

Those are my personal observations. Do others see total more beginners
downloading Python rather than dipping their toes into Javascript?

[1] google.com search "get started Javascript" ~211 million hits:

[https://www.google.com/search?q=get+started+with+javascript](https://www.google.com/search?q=get+started+with+javascript)

google.com search "get started Python" ~33 million hits:

[https://www.google.com/search?q=get+started+with+python](https://www.google.com/search?q=get+started+with+python)

------
petilon
I think Python is a great first language to learn. It is well designed and is
widely supported, for example Visual Studio 2015 comes with it. The only
trouble with Python is the Python 2 vs. 3 situation. Both these versions are
being improved. Python 3 is the newer and better language, but a lot of
libraries are only available for Python 2. The wxpython library, referenced in
this article, is an example.

------
rebootthesystem
No, I don't think so. I was going to write a long and detailed post but I have
a really full schedule this morning.

I'll just point out that Python suffers from a deployment issue. Getting a web
project up and running can be a nightmare (no, using Heroku merely hides the
problem...it's still there). Even on the desktop it can get really cryptic and
confusing for a newbie. And, of course, releasing and sharing your app is
--from the vantage point of a newbie-- just about impossible.

On something like VisualBasic you can package-up and create an installer for
your app with one click. Anyone can then install it and end-up with an icon on
the desktop they can click and run the app. The "path to exe" is simple.

Again, I don't have time to dig deeper. We love Python and use it extensively
for our web (with Django) and desktop work professionally. And, yes, I am
teaching my kids programming with Python. But, no, I don't think Python is the
new Basic, on more than one front.

------
giancarlostoro
I learned Visual Basic 6 as my first language. I appreciated that my
application could for the most part run on any Windows machine without a
massive framework as a requirement. Don't get me wrong though, I love .NET
entirely! I just enjoyed Visual Basic 6, because it felt native, and to some
degree was. I still wish there was a native solution with a RAD environment
like that, Delphi is nice but the syntax is quite friction filled for a
beginner. Nowdays C# is the clear winner, although not yet a native solution
and not yet multiplatform without friction.

Edit:

More on topic:

My personal opinion is that scripting languages like Python and Ruby, and for
the brave teachers Lisp (Racket, Clojure, etc) make excellent programming
languages. Instead of forcing yourself to learn the requirements of C-like
languages, you get to focus a lot more on the concepts, and a lot less on
syntax issues that I see more than often enough with new students to
programming.

~~~
eterm
Didn't VB6 applications in the most part require the visual basic runtime?

(Although I think there was an option to compile to native?)

~~~
giancarlostoro
I believe up to VB5, then in VB6 it was finally natively compiled. I had
projects in VB6 that people would try to decompile, the best they got was
Assembly. Unlike .NET which without external tools will give you back almost
everything (except of course comments).

------
FilterSweep
Its a bit more nuanced because we are all people who know varying degrees of
code and have already "been there," so to speak. To learn Python I'd argue
you'd have to know a bit (read: not much) of the UNIX environment and args
before you jumped in, and my difficulty with it in college was that I had only
learned from compiled languages with all of the libraries pre-built for me.
However, I would have bypassed all of those difficulties if I had learned how
to be a "sudoer" from the beginning. I think going the HTML --> CSS -->
Vanilla Javascript route could possibly get kids coding before they lose their
first teeth. Kids are already very savvy with their mobile browsers.

------
lttlrck
BASIC was more than just the BASIC language (which wasn't particular good), it
was the environment and integration with the hardware that made it a
successful springboard for countless developers.

Being built into home micros was part of it, but it also included built-in
switching video modes, drawing, audio, I/O, even inline assembler (not in all
variants, but certainly the better ones). This creates a _very_ effective and
accessible learning curve.

Javascript is the closest modern equivalent - but the language and it's API's
are too complex. A browser-based BASIC (compiling to Javascript of course),
exposing all the above in a sane synchronous manner would be interesting.

------
mcphage
> The replacement for BASIC has been clumsy at best. How do we introduce fancy
> GUIs, graphical animation, and ‘splosions to beginner programmers? Visual
> Basic? HTML/Javascript? Some random, closed source “4 kidz” programming
> language whose company will fold in three years? NO!!! You can’t be
> serious!!!

The link on "No! You can't be serious!" was to Hackety Hack, by
_why_the_lucky_stiff. The language was Ruby, not a random, closed-source, "4
kidz" programming language. And it's a good language for teaching.

------
hello_there_you
I believe hello world in ruby is even shorter than python (if that is what
counts as a measurement here), since you can just use "p" as short of "puts",
so:

p 'Hello world'

~~~
mateuszf
Hello world in Clojure:

"Hello world"

~~~
JupiterMoon
One can do the same with the python console.

------
arikrak
It's true that Java needs boilerplate code even for "hello world" but this
isn't a real issue and the IDE produces it for you. The general need for more
boilerplate is a slight nuisance, which makes languages like Python and Ruby
slightly better for getting started. (Though Java's ability to catch compile
errors is helpful for beginners... )

------
agentultra
One of the included batteries is a built-in Turtle graphics system. A bare
Python installation is far better than the BASIC of my day. It's just much
more difficult to get into since our machines don't just boot into an
interpreter or even ship with one in the case of Windows.

------
edw519
My story:

    
    
      1976 to 1985: COBOL (hell)
      1985 to 1999: BASIC (joy)
      1999 to now:  BASIC + Javascript (turbojoy)
    

When I encounter something I can't easily build with my current toolset, I'll
look for the "new BASIC". So far, that's never happened.

~~~
ourmandave
What version of BASIC are you using today?

~~~
edw519
databasic

[https://en.wikipedia.org/wiki/List_of_BASIC_dialects](https://en.wikipedia.org/wiki/List_of_BASIC_dialects)

------
cygwin98
You can still do QBasic though. There is an open-sourced implementation called
QB64 [1]. QB64 is also cross-platform that can run on
Windows/Linux/Mac/Android.

[1] [http://www.qb64.net](http://www.qb64.net)

------
krwck
[http://prog21.dadgum.com/203.html](http://prog21.dadgum.com/203.html)

------
cma
A pretty good counter argument:
[http://prog21.dadgum.com/203.html](http://prog21.dadgum.com/203.html)

Javascript doesn't require setting up apache, etc. for a kid to learn like the
submission says; you can just use a static html file on your file system or
dropbox etc.

edit: ignore the above about apache, missed that that was in the next bullet
point about PHP, not javascript

~~~
mankyd
Python doesn't require Apache either. The submission doesn't suggest that it
does. It only mentions Apache in reference to PHP.

In face, Javascript _does_ (until Node came along) generally require a
browser, and some HTML to go with it. Python gets along just fine as a single
file from the command line, much like Basic.

~~~
cma
For kids learning programming, browsers are more generally available than
commandlines with python installed. Doubly so if they want to share what they
make like kids used to do with basic on floppies.

------
awkward
python's problem is that while it goes the distance to make the simplest
possible program as simple as possible, simplicity bleeds off very quickly as
you add functionality.

The shortest well behaved program, for example, looks like this:

    
    
      if __name__ == "__main__":
        print "Hello World!"
    

and the shortest program that is strictly equivalent to the java program is
closer to this:

    
    
      class Hello(object):
        @classmethod
        def main(cls):
          print "Hello World!"
      
       if __name__ == "__main__":
        print "Hello World!"
    

Based on my experience, there's a lot people learning python who spend a lot
of time at the stage where they "just don't get OO", and my opinion is that
the reason is the language is bad at teaching them. It's like a submarine of
complexity waiting under the simplified syntax for basic scripting.

~~~
Too
Why is this being downvoted? Classes might not be what everybody needs but
this pretending that hello world can be written in 1 line is just inviting
people to write sloppy code, false advertising is what it is.

In my experience namespace pollution because things are written outside a
function is a very common cause of bugs and maintenance problems in production
python code. People coming from C/Java/similar think that "if" has scope but
it doesn't, only functions do. If i see "main()-code" outside a function
during a code review i immediately disregard that whole script.

Any program that actually does something, except just printing hello world,
would more likely look like this:

    
    
        import sys
        def main(args):    
            function_local_variable = "yay"
            print("hello world")
    
        if __name__ == "__main__"
            pollute_global_namespace = "yes"
            main(sys.argv)
    

Short of the braces and the variables i added for clarity it actually has more
lines than the java-version.

~~~
dragonwriter
> Classes might not be what everybody needs but this pretending that hello
> world can be written in 1 line is just inviting people to write sloppy code.

IMV, sloppy unstructured code is a fine place for many (especially very young)
programmers to start, and it simplifies the onramp significantly (and,
actually, for simple scripts, relatively unstructured code in python is
sufficient for lots of real-world uses, too.)

    
    
      if __name__ == "__main__" 
    

...is the k of thing you need only if you are deliberately designing something
to be used as both a script and a library, which there are very good reasons
to do for many real world python files, but it certainly is not universally
necessary. And using classes for hello world is excessive Java-ism.

------
phkahler
The link in TFA to his book is borked.

------
meeper16
Why not Pascal?

