10 ms·
Python is the new BASIC
- mangeletti 11y agoArticles 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
- impostervt 11y agoAs 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 11y agoTrue, 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 11y agoOr maybe the one that comes pre-installed everywhere (like BASIC back in the day).
- reustle 11y agoI usually JavaScript is a great second language (after you pick up Python)
- deleted 11y ago[deleted]
- woah 11y agoHeh, callbacks seem to confuse experienced programmers more than they confuse little kids.
- BerislavLopac 11y agoI 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
- cma 11y agoA 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 11y agoPython 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 11y agoFor 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.
- eykanal 11y ago* Javascript is highly internally inconsistent (http://wtfjs.com/ http://wtfjs.com/) * Javascript is incredibly easy to screw up (http://www.codeproject.com/Articles/182416/A-Collection-of-JavaScript-Gotchas http://www.codeproject.com/Articles/182416/A-Collection-of-J...) * Practical use of Javascript requires understanding of HTML, CSS, the DOM, as well as the concept of browser inconsistencies Not sure I agree with that article.
- kcorbitt 11y agoWhen 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.
- wiremine 11y agoI 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 11y agoI think minecraft red stones are turing complete. Someone built a simple processor with those red stones.
- wiremine 11y agoAh, good to know! Got any links?
- fauxfauxpas 11y agohttp://www.minecraftforum.net/forums/minecraft-discussion/redstone-discussion-and/348979-working-cpu-with-ram-branching-etc-save-added http://www.minecraftforum.net/forums/minecraft-discussion/re...
- rasz_pl 11y agoHow about minecraft written in python? https://github.com/fogleman/Minecraft https://github.com/fogleman/Minecraft https://github.com/boskee/Minecraft https://github.com/boskee/Minecraft or python bindings to original minecraft http://www.jjinux.com/2013/05/drawing-sierpinskis-triangle-in.html http://www.jjinux.com/2013/05/drawing-sierpinskis-triangle-i... http://python-minecraft.readthedocs.org/en/latest/contents.html http://python-minecraft.readthedocs.org/en/latest/contents.h...
- giancarlostoro 11y agoI 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 11y agoDidn't VB6 applications in the most part require the visual basic runtime? (Although I think there was an option to compile to native?)
- giancarlostoro 11y agoI 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).
- david927 11y agoYesterday 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.
- JupiterMoon 11y agoThere are linters to handle syntax issues like tabs for spaces. Furthermore every text editor I've ever used has supported automatic handling of tabs/spaces and how many to indent. Not sure on publishing but maybe try packaging it properly (I believe python apps can be wrapped into .exe files) and putting the package into something like dropbox folder? It's 2015 and these problems are solved already.
- david927 11y agoLinters I take back "brightest minds"
- JupiterMoon 11y agoWhy?
- anentropic 11y agoit's 2015 and you're still using the wrong editor
- moistgorilla 11y agoWhat? He doesn't even mention anywhere in his comment what editor he is using
- orf 11y agoAnd he didn't need to, any editor that mixes space indents with tabs is the wrong editor.
- ZitchDog 11y agoNope, 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.
- petilon 11y agoJavaScript is great because it is so versatile. You can make command-line programs (using node), server programs (node) and even native apps (using react native) using JavaScript. However JavaScript is not a well-designed language and for that reason it is not a good first language. That's why things like TypeScript exist and it makes OOP easier among other things. ES6 is a big improvement too. In the long run I think JavaScript will win because it is being improved and has huge momentum, but right now Python is the better first language.
- hliyan 11y agoAgreed. Callback hell in JavaScript is reminiscent of the GOTO-hell we used to suffer as BASIC programs grew larger. Like you said, with all its problems it was still ubiquitous and practical. So is JavaScript.
- scriptproof 11y agoconsole.log("Hello") is not more complicated than print("Hello"). For the callbacks it is actually possible to not use them. See how to: http://www.xul.fr/javascript/no-callback.php http://www.xul.fr/javascript/no-callback.php (and it is even very simple). That is just a matter of style.
- jacquesm 11y ago> console.log("Hello") is not more complicated than print("Hello"). Actually, it is (it requires a package prefix) and it's: print "hello" (Print was never a function in BASIC but a statement)
- 11y ago
- agentultra 11y agoOne 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.
- jasode 11y ago>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
- hello_there_you 11y agoI 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 11y agoHello world in Clojure: "Hello world"
- JupiterMoon 11y agoOne can do the same with the python console.
- awkward 11y agopython'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.
- cosarara97 11y agoJava "teaches" its users OOP by forcing it on them. Python provides the tools to get things done without it - that's why the learners "don't get it", because they don't need it, and they don't see it as a solution to a problem (or at least this was the case when I was learning python). What you have there is un-pythonic. Once you have a good reason to build a class with static methods, it will most likely not look too bad.
- Too 11y agoWhy 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.
- megaman22 11y agoVery 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 11y agoMaybe 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 11y agoYou could say the same if they bundled in Java, C#, or JavaScript. You ultimately have to make a choice.
- moistgorilla 11y agoYou have to do that with almost every language (not including Java to C# or vice versa)
- edanm 11y agoJavascript has a lot of similarities to Python, actually. Why would you consider it so different? I'd consider Javascript closer to Python than to C/C++/Java, for example.
- 11y ago
- FilterSweep 11y agoIts 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.
- bite_victim 11y ago> PHP is not the new BASIC. Combine the HTML/CSS/JavaScript arguments above, and throw in setting up Apache and a thoroughly bloated namespace. PHP is a poor candidate. Yes, we hate PHP. Hurrr! It is so hard to setup Apache to run it especially considering how easy it is for Python. OH, and yes, PHP doesn't have a CLI! PHP is only good for web because I say so. What? PHP does have a CLI? It is in fact the same process to set it up with Apache (mod_wsgi/mod_php)? It is also possible to build an emulator in PHP?! (http://phspectrum.sourceforge.net/ http://phspectrum.sourceforge.net/) NOOO! PHP is only good for web and it is used by mindless guys (a certain asian population like it a lot!!!) so all of this is irrelevant!!!
- sigzero 11y agoPHP and CLI? Sure it has it. PHP isn't installed by default even in many of the places that Python is. I have never met a Sys Admin that uses PHP as his CLI scripting language and I would shake my head and walk away if one did.
- debaserab2 11y agoBut you find plenty who would choose bash or perl. Or do you shake your head them too?
- protomyth 11y agoThis is the one lesson of PHP that seems to be ignored by a lot (most?) new languages. If you want your language to be popular with beginning web programmers, then provide system administrators with a dead simple way to install it. Add package, done. Then make sure it doesn't cause too much trouble or at least upgrades easily. If it takes almost no effort to install your language and any modules that users might need, then the system administrator will just add it to the list of things to install. PHP is everywhere because its very easy.
- mtberatwork 11y agoIt's really only "easy" if you are using mod_php. If you are using PHP-FPM, FastCGI, etc, as most people do who run production PHP, then things get about as complicated as using uWSGI, mod_wsgi, etc with Python. On that note though, getting mod_wsgi up and running with Apache is really quite simple.
- runn1ng 11y agoMods: Please add "(2008)" to the title.
- edw519 11y agoMy 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 11y agoWhat version of BASIC are you using today?
- edw519 11y agodatabasic https://en.wikipedia.org/wiki/List_of_BASIC_dialects https://en.wikipedia.org/wiki/List_of_BASIC_dialects
- cygwin98 11y agoYou 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
- arturhoo 11y agoAs 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 11y ago+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 11y agoExactly, 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/
- iguessthislldo 11y agoAs much as I love python now for scripting and other simple tasks now, Processing was the first "real" programming platform I encountered (after learning the forgive the pun basics with BASIC on my trusty TI-89). It was simple to use, and introduced me to OOP, which blew my mind coming from TI-BASIC. I would recommend Processing to anyone that asks about getting started in programming.
- phkahler 11y agoThe link in TFA to his book is borked.
- lttlrck 11y agoBASIC 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.
- euroclydon 11y agoProfessional 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.
- krwck 11y agohttp://prog21.dadgum.com/203.html http://prog21.dadgum.com/203.html
- arikrak 11y agoIt'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... )
- meeper16 11y agoWhy not Pascal?
- 32bitkid 11y agoAnecdotally, 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 11y ago>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.
- petilon 11y agoI 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.
- mcphage 11y ago> 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.
- rebootthesystem 11y agoNo, 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.