Live data from Hacker News

Why I push for Python

lorenabarba.com

111–120 of 129 posts

Re: Why I push for Python

#111

No doubt Python is a pleasant language to code with (if you don't mind forced indentation of your code). But to be fair this article should compare it to Groovy for instance and probably not Java; doing so would make the push for python a tad more challenging. I took another look at Groovy again recently (haven't played with it since version 1.8) and i'm beginning to feel that i should have invested more time in lear…

Grails adoption share has been falling rapidly lately. It rose on Rails's coattails and it's falling that way too. Other architectures are taking over: vert.x, node.js, Play!

Standalone groovy scripting isn't used as much nowadays either. I suspect Oracle's going to push Nashorn Javascript it shipped with Java 8 for your JVM scripting needs.

Groovy has been getting lots of new users because of Gradle's increasing popularity, though your typical build file is 20 to 100 lines long. Gradle still ships with Groovy 1.8 anyway so you haven't missed out not keeping up!

Re: Why I push for Python

#112
post #95
post #86

Earlier quoted context omitted.

You have quite a few muddled definitions that you trip yourself over in your post. First you say that you're an engineer, which means you're an "applied scientist". Then afterwards you go on to claim that computer scientists aren't really "engineers" by your definition. Then further down you go on and say that they're instead "specialists". Sounds like you just had to find another word other than "Engineer" there, so…

>First you say that you're an engineer, which means you're an "applied scientist". I am. >Then afterwards you go on to claim that computer scientists aren't really "engineers" by your definition. They're not. At least, not in Canada. It's against the law to call yourself an engineer if you don't actually hold an engineering degree from an accredited institution. >I can't tell if you're just confused about what all th…

[deleted]

Re: Why I push for Python

#113
post #36

It seems the only argument for pushing Python is that it sidesteps the need to understand fundamental programming concepts. Sure Python is easy to read and easy to write, but that's not really the point. To teach somebody print "hello world" in Python is not really teaching them much at all... Teaching someone the C equivalent would cover functions ("what is 'void main()'?"), entry points and how programs are loaded…

Why do you have to teach them the boring stuff first? The point is to get them interested in programming. They can learn how the hardware, compilation, linking, and algorithms work later. Above all, get them interested. If you capture their imagination, they'll be receptive to--even independently curious about--the details. I'm speaking anecdotally now, but please do not bore young students. There's no way I would ha…

Sorry but hardware, compilation, linking, and algorithms are anything but boring. Even as a beginner I was very intrigued by all of them, even if I did not understand them as well.

Re: Why I push for Python

#114
post #85
post #52

Earlier quoted context omitted.

No, you absolutely don't need to start with C. You need to learn C (or some equivalently low-level language) eventually .

I don't even think you need to learn it eventually . For a similar argument, ask if most programmers need to learn assembly or further down the stack, EE, eventually. The answer is a resounding no. Extrapolating this even further, in the future "programmers" will be people who are just very good at issuing NLP commands to computers. They won't type strings of characters into consoles.

I agree. We don't need to know instruction encoding, because we can use assembly, or assembly, because we can use C, or C, because we can use Python. What you need to know is, well, what's needed to use the particular language and system architecture to its maximum potential. And that's more of a training and conceptual thing than a C/assembly thing.

Re: Why I push for Python

#115

Earlier quoted context omitted.

I agree, they are horrible flaws. Though to be fair, you have to understand why JavaScript has as many flaws as it does. I believe this is largely due to the context in which it was created. First, it was written in the absolute minimal amount time possible. "If it fits, it ships", really applies here. Second, JavaScript was designed to make sub 200 line scripts that add basic interactivity to web pages, not to make…

That was true in 1995. It's now 2014. There has been ample time to fix the many flaws. There's no justifiable reason why, nearly 20 years on, JavaScript is still so inherently busted in so many ways.

I can't disagree with you at all, though I don't necessarily share the same level of contempt for javascript. The thought of creating a "new" and "fixed" language to replace it brings the xkcd comic on standards to mind (#927).

I would argue there is a justifiable reason. Before I do bear in mind I accept it may not be a good reason, or one without workarounds, but hindsight makes both of those much easier to see than in the day to day development.

Backwards compatibility. The two words which really haunt web developers everywhere, on so many levels. We don't want old sites to break in new browsers, or new sites to break in old browsers, so fixing major issues of such magnitude would require at a minimum a unique version that could be differentiated from older sites. And when was the last time you saw a version of javascript specified in a websites code?

So then a situation occurs where we could use the new code and "do it right," but we would need fallbacks for old browsers. Or, we could "do it wrong," only use the old way, and development would take significantly less time. While over time the new way likely would win out, it would be a long and drawn out process taking enough developers and managers putting their feet down and saying, no, while this will take more time, cost more money, for the exact same functionality, it is the right thing to do for the future of the language. And getting their bosses to accept that tough sell.

The above seems very similar to HTML5 and IE6/7 support. And how long has that fight been going on?

So yes, one would think the flaws should be fixable, but looking at it from an in the moment perspective as opposed to through the lens of history, it isn't completely incomprehensible as to why they still exist.

Another thought that just popped into my head, is for the majority of the life of javascript, it was used by web developers, many of whom would by todays standards be much closer on the spectrum to "my nephew who designs websites" than a software engineer. It wasn't until much more recently that it began to heavily be used by engineers who pushed the limits much further and ran into these problems. It makes me curious on when the first documented case of these issues was brought up. Was it 20 years ago, or maybe only in the last 5?

Re: Why I push for Python

#116
post #60

If I had to overly generalize, programmers tend to fall into the "builder" and "curiosity" camps. I grew up using a Borland C++ compiler that didn't list which line numbers were missing semi-colons. I didn't mind going over my code to find the missing semi-colon, but plenty of my classmates were frustrated. They weren't interested in how compilers worked, how code was parsed and debugging information was lost in the…

When teaching young children, 'to ease students in' is a good idea. But for first-year college students, it's the worst thing you can do to them. The ones who chose the right course will be okay either way, but the ones who chose the wrong course won't get to find out until it's too late to switch, at least not without having wasted a nontrivial chunk of their lives. The overriding criterion for a first-year college programming language is to have a difficult learning curve to give students accurate information as early as possible about the nature of the subject they've signed up for.

Re: Why I push for Python

#117

Earlier quoted context omitted.

I'm just starting out teaching my daughter (10). Any recommendations on how best to get her started with JS?

It's not javascript, but my daughter loves Logo. She's a little younger than 10, so it's still off and on and a lot of parental involvement.

Have you tried

  import turtle
in Python?

Re: Why I push for Python

#118

Earlier quoted context omitted.

Why do you have to teach them the boring stuff first? The point is to get them interested in programming. They can learn how the hardware, compilation, linking, and algorithms work later. Above all, get them interested. If you capture their imagination, they'll be receptive to--even independently curious about--the details. I'm speaking anecdotally now, but please do not bore young students. There's no way I would ha…

Sorry but hardware, compilation, linking, and algorithms are anything but boring. Even as a beginner I was very intrigued by all of them, even if I did not understand them as well.

Yeah, sorry, but that's you. I can bring my own anecdotal evidence to the table and say that for me, compilation, linking and algorithms were very secondary to the thrill of typing in "commands" to the computer and have it do all the work for me automagically. Programming, which I learned in college, was a very pleasant method of getting around all that boring math by letting me figure out how to solve the problem and then having my computer do the mechanical calculations.

Re: Why I push for Python

#119

Earlier quoted context omitted.

How would PHP be even more powerful?

I was half joking, the parent said python was incredible powerful to him because it allow him to make money quickly, some would say php is king in that domain. By quickly he meant from the process you start learning your first programming language to be able to make money with that language.

I both agree and disagree with the truth part of your joke.

I agree in that a bunch of people I know started out with Wordpress or even Joomla, and managed to get a site working for a paying client relatively quickly. And making money was a great motivator for them to get better, and 'grow' out of php, or at least start using better CMS' or frameworks (or write their own wordpress plugins). I've found that especially designers who 'know a bit of html' seem to get pretty far with Wordpress and a bit of jQuery they copy and paste.

The result is usually an abomination in my eyes, but hey, if they're getting by doing it, and especially if it's a gateway to getting better at actual programming, why not? That's how I did it!

But I I also partly disagree in that I've also met quite a few web 'developers' who did so well 'snippeting' their Wordpress/joomla sites together, that they never moved beyond that and eventually succumbed to fierce competition. Because now they're competing with non-programming designers who can build fancy looking websites with cool interactivity, and are better at making it look good.

Because I've seen both good and bad come out of it, I usually try to gauge what kind of person I have in front of me when they approach me for help or advice.

If it's someone who doesn't seem to have the inherent curiosity to become a better programmer, I might just help them set up their first wordpress site and do my best to keep them from doing too much 'damage'.

If I do see a bit of curiosity, I try to gently steer them towards other solutions (Middleman + heroku, or Ruby on Rails for example) that are a nice midpoint between some 'coding' and seeing quick results.

And if I think I have full-blown future programmer in front of me, I just throw tons of stuff at them, usually right in the browser dev console, (closures, callbacks, functional-style programming) and relish seeing them try to figure it out and go home and tinker with a Fiddle! Those are my favorites.

Re: Why I push for Python

#120
post #36

It seems the only argument for pushing Python is that it sidesteps the need to understand fundamental programming concepts. Sure Python is easy to read and easy to write, but that's not really the point. To teach somebody print "hello world" in Python is not really teaching them much at all... Teaching someone the C equivalent would cover functions ("what is 'void main()'?"), entry points and how programs are loaded…

note: void main should be int main(at least in c++)

You could just give

    from __future__ import print_function
    import os
    def main():
        print("hello world from:" + os.name)
    if __name__ == "__main__":
        main()
as the hello world that covers functions(main/print), entry points(python runs the code top to bottom defining classes and functions at the top level and running any other code it encounters, to allow importation of libraries we put the code we wish to run in a special block that only runs it when the script is the only being directly run, not imported), we imported os and used os.name to demonstrate a library, + is an operator.
Post reply on HN