Earlier quoted context omitted.
> Given any programming task, you're just going to end up with better code in pretty much any other language, especially a functional one. This is the exact bull * that good hearted Haskell and Lisp guys have to face and fix because of arrogant people like you. First of all, a good PHP programmer is a good programmer. End of story. You can write crystal clear code in PHP that anyone who started with C (how many I won…
> because of arrogant people like you > you are entitled to spew crap like that since you are the holder of truth? We ban users who address other users repeatedly like this, so please don't do it again on HN. Comments here must be civil and substantive. https://news.ycombinator.com/newsguidelines.html
Python is the new BASIC
121–130 of 137 posts
Re: Python is the new BASIC
#122Earlier quoted context omitted.
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 Javascr…
> Python, fwiw, is a better BASIC. The justifications you give for that make it seem like JavaScript is the new BASIC while Python is a better Logo (less ubiquitous language that is structurally better for pedagogy, though disadvantaged simply by being less ubiquitous.) > Windows is the place where it hurts. And still the dominant desktop platform. Which would be less important, as mobile eclipses desktop, if mobile…
You quoted me -- I said Python is a better BASIC; implying that while Javascript might be the new BASIC, Python is better at being one. Let that be clear!
The turtle graphics module is only one example. Python ships with plenty of other useful libraries and tools that make it great for experimenting and learning.
Let's not sell BASIC short -- its success wasn't just about ubiquity. It was designed by John G. Kemeny and Thomas E. Kurtz to help Dartmouth students write programs to do work. They thought it was a shame more people didn't know how to program computers. I think they succeeded with their original goals[0].
Python has the advantage of being invented some twenty-five-ish-odd years later. After a couple decades of development it has grown into a language and system that far surpasses BASIC in its ability to teach people how to write programs and be productive right away. It's better than BASIC and teaching more people how to program, imho.
Javascript is definitely more ubiquitous. I wish it was easier to use and came with better libraries and things in the browsers. It's everywhere but it's not easier to use than Python. And Python's not as obscure as you'd think... don't discount the market share of Apple + Linux systems combined. If Windows jumps on board and packages a Python distribution: watch out (as if, but hey).
The new BASIC... jury is still out for me. I like both languages just fine. Javascript is a little bit more ubiquitous but it's not any easier to get into in my experience; at least not with modern browsers hiding the web console and providing little in the way of built-in code editors (and to say nothing of the DOM getting in the way of everything from drawing graphics to the screen to accessing the keyboard).
Re: Python is the new BASIC
#123Re: Python is the new BASIC
#124Earlier quoted context omitted.
> This is the exact bull* that good hearted Haskell and Lisp guys have to face and fix because of arrogant people like you. No. It is not. It takes a lot more effort to produce the code of same quality in php. For one thin, you have to consider that one has to keep and endless list of gotchas and edge cases (yes, all languages have these, but the list is nowhere near as long as it is in php) in mind when writing any…
Isn't the word 'array' quite obvious that it will create an array? Since PHP 5.4 you actually have the shorthand "[]" version available but it is still obvious to anyone who is using PHP or JavaScript (though JS arrays aren't hash maps like PHP's -- you need an object for that). But I agree, it's crystal clear for anyone with a minor PHP knowledge. For the rest it's just "clear". (It will still work calling $a['1'] w…
Oh yea. Try this.
$a = array ('1' => 'one');
foreach ($a as $k=>$v) {
if ($a === '1') {
echo "found one";
}
}
Surprise! Never prints "found one".THAT is the issue! I used '===' so I should be safe from type coercion issues, right? Well, a hidden rule in php says no.
See this bug..oops feature, when it bit even experienced php programmers here
https://www.reddit.com/r/PHP/comments/2zhg6z/how_true_is_thi...
See that post and the comment from the user e-tron. Both of them who are experienced php programmers
Re: Python is the new BASIC
#125Very 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…
I miss these in the new generation of languages. You could do so much cool stuff with swithcing to graphics mode and using pixel, line and circle commands. I was able to write a (1) shooter where you shoot down a plane that moves horizontally across the screen and the projectile was subject to 'gravity'. (2) A program that 'morphs' one outline to another. (3) A wireframe/3d space shooter.
I was able to build all this without the internet, with plain high school math and physics. And I wonder if I was a kid who grew up in todays environment, I would have been able to build the same. I have the internet, but I doubt I would be enticed into making stuff like that, like I was enticed by QBasic. I mean, one minute you are printing multiplication tables, the next minute you are turning individual pixels on/off on the screen. I remember it being a very empowering feeling.
Re: Python is the new BASIC
#126Earlier quoted context omitted.
> Python, fwiw, is a better BASIC. The justifications you give for that make it seem like JavaScript is the new BASIC while Python is a better Logo (less ubiquitous language that is structurally better for pedagogy, though disadvantaged simply by being less ubiquitous.) > Windows is the place where it hurts. And still the dominant desktop platform. Which would be less important, as mobile eclipses desktop, if mobile…
Frankly i fear that the tech world is getting less and less tinker friendly decade by decade. At least in the case of off the shelf products.
That's kind of a constant in the tech world with every technology; I remember as a kid old timers making that complaint about radios. For a long time, its been made about cars. And, yeah, more recently, personal computers.
Re: Python is the new BASIC
#127Earlier quoted context omitted.
Frankly i fear that the tech world is getting less and less tinker friendly decade by decade. At least in the case of off the shelf products.
> Frankly i fear that the tech world is getting less and less tinker friendly decade by decade. That's kind of a constant in the tech world with every technology; I remember as a kid old timers making that complaint about radios. For a long time, its been made about cars. And, yeah, more recently, personal computers.
With radios it has been that moving for tubes to transistors to ICs has upped the minimum tools needed to get anything done.
With cars emission laws and such had introduced something similar via computerized injection etc.
But with computers etc the complexity was there for the start, but the tinker hostility has, IMO, come from a change in business from selling hardware to the hardware being a terminal for "content". Thus the tinkering hostility comes from propping up DRM under the guise of "security".
Re: Python is the new BASIC
#128Earlier quoted context omitted.
Isn't the word 'array' quite obvious that it will create an array? Since PHP 5.4 you actually have the shorthand "[]" version available but it is still obvious to anyone who is using PHP or JavaScript (though JS arrays aren't hash maps like PHP's -- you need an object for that). But I agree, it's crystal clear for anyone with a minor PHP knowledge. For the rest it's just "clear". (It will still work calling $a['1'] w…
>It will still work calling $a['1'] with the quotes so what exactly is the issue? Oh yea. Try this. $a = array ('1' => 'one'); foreach ($a as $k=>$v) { if ($a === '1') { echo "found one"; } } Surprise! Never prints "found one". THAT is the issue! I used '===' so I should be safe from type coercion issues, right? Well, a hidden rule in php says no. See this bug..oops feature, when it bit even experienced php programme…
> Bad idea? Sure. But once you know the enemy you can deal with it
Why surround yourself with more enemies than those that inherently exist in your business logic/problem domain? The problem with PHP is all of those "no big deal tiny issues" add up to something reminiscent of death by 1000 papercuts.
Re: Python is the new BASIC
#129Earlier quoted context omitted.
Isn't the word 'array' quite obvious that it will create an array? Since PHP 5.4 you actually have the shorthand "[]" version available but it is still obvious to anyone who is using PHP or JavaScript (though JS arrays aren't hash maps like PHP's -- you need an object for that). But I agree, it's crystal clear for anyone with a minor PHP knowledge. For the rest it's just "clear". (It will still work calling $a['1'] w…
>It will still work calling $a['1'] with the quotes so what exactly is the issue? Oh yea. Try this. $a = array ('1' => 'one'); foreach ($a as $k=>$v) { if ($a === '1') { echo "found one"; } } Surprise! Never prints "found one". THAT is the issue! I used '===' so I should be safe from type coercion issues, right? Well, a hidden rule in php says no. See this bug..oops feature, when it bit even experienced php programme…
if ($k === '1') instead of if ($a === '1')..