Live data from Hacker News

Python is the new BASIC

coffeeghost.net

41–50 of 137 posts

Re: Python is the new BASIC

#41
post #20

Earlier quoted context omitted.

Agreed. 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.

console.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 (and it is even very simple). That is just a matter of style.

> 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)

Re: Python is the new BASIC

#42

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.

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 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).

Re: Python is the new BASIC

#43

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…

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...

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

Re: Python is the new BASIC

#44
post #38

> 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 proces…

PHP 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.

But you find plenty who would choose bash or perl. Or do you shake your head them too?

Re: Python is the new BASIC

#45
post #37

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.

What version of BASIC are you using today?

Re: Python is the new BASIC

#46

> 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 proces…

This 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.

Re: Python is the new BASIC

#47
post #9

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 Minecra…

I'd suggest processing for kids starting out. It gives them the visual feedback they need to get hooked. I got a 14yo to build a particle system in < 4hrs and after that he was hooked.

Re: Python is the new BASIC

#48

> 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 proces…

The fact that PHP is hated by anyone who learned PHP and moved onto other, ostensibly better things is the reason why all the hate exists.

Given any programming task, you're just going to end up with better code in pretty much any other language, especially a functional one.

Re: Python is the new BASIC

#49

Earlier quoted context omitted.

console.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 (and it is even very simple). That is just a matter of style.

> 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)

Python 3.5 is out, are you still using the legacy version? SyntaxError: Missing parentheses in call to 'print'
Post reply on HN