Live data from Hacker News

Why I push for Python

lorenabarba.com

101–110 of 129 posts

Re: Why I push for Python

#101
post #21

I think I could have written this article a few months ago, when I was a huge Python fan and would spend a significant amount of time telling my friends in academia to stop using Matlab and start using Python. Then I started working in a research lab myself, and I haven't used Python since. Very simply, there's an immense amount of code written for Matlab that I can learn from in domain-specific instances, hardware v…

This is an important point. The right tool for the job has to take into account the existing tools inertia.

Having said that, I had a similar situation at my research lab and have now almost replaced Matlab.

This process was mostly organic, starting with me changing my personal post-processing workflow when I switched to IPython Notebook as a logbook and plotting library (i still use gnuplot occasionaly).

Soon I started having to port bits of Matlab and C code to Python and Cython to allow me to continue using the logbook, and I found I was becoming a lot faster at creating new modules and tools, mainly because the programming component was now intricately linked to my workflow (and more fun)

The tipping point was when I converted a notebook into a slideshow for a presentation I had to do for the group. Everybody was more interested in how I made the presentation then in my results, and wanted access to the new tools. I provided them with the git repo (and git tutorial), gave people notebooks I had written to log coding practices and demos of my code (I have poor memory) and encouraged people to contribute back.

Getting people to contribute back is still the hardwork: Everyone is shy to share their code, but the Professors starting preferring IPython Notebooks. New code is now usually written in Python first, and sometimes ported to Matlab and even the hardcore Matlab researchers are starting to show interest because of the speed and flexibility of the new code.

Basically, I found Matlab is definitely replaceable - and can only improve workflow (speed it up if nothing else). There are a few instances when specific hardware requires Win driver access through a Matlab plugin, but there are ways to interface with these too.

Re: Why I push for Python

#102

Earlier quoted context omitted.

http://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/

Not that I am not agree with the link but Python is not caveats free either. The fact that they have to "fix" the language in one version making it incompatible with previous versions is smelly enough to me from a design point of view.

The smell of perfection trying best good is the smell I want to wake up to every morning.

Re: Why I push for Python

#103
post #66

Earlier quoted context omitted.

A lot of the problems with JavaScript aren't "caveats and idiosyncrasies" or "quirks". They're rather horrible and unjustifiable flaws, plain and simple.

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.

Re: Why I push for Python

#104
post #49

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…

Well if somebody is in higher education for computer science, I'm assuming their imagination has already been captured. I'm all for using whatever has the lowest barrier to entry in order to get young people interested in programming.

That's not a very good assumption. A lot of students get their first experience with programming in college.

Re: Why I push for Python

#105
post #7

starting with python is ok as long as theres a C class following. At various work places ive been to, the vast majority of coders know python or ruby or similar languages. They have NO CLUE how the memory is allocated, why some things in python are slower, etc. At some point they go 'its python runtime overhead'. But most of the time they could make the program much faster just by using better data structures in pyth…

When I set out to learn Python, I'd had passing experience with Visual Basic, PHP, Javascript and even a bit of Scheme. I understood what programming was all about, but I hadn't yet overcome the initial struggling to translate the logical flow that I had in mind into code.

Now, almost a decade later, I'm still writing Python. Sure, I write my share of Javascript like most people, but Python is my first and true love.

Python is shallow. There isn't a lot to it - once you understand how magic methods work, you're pretty much at the point where reading the source of the implementation is the next step in understanding.

It wasn't long before I found myself learning the specifics of C data types in order to understand exactly how Python types worked.

In short, my contention is that someone who wants to become a better programmer will become a better programmer regardless of their preferred language.

Re: Why I push for Python

#106

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.

Once again, I entirely agree. I personally wish browsers could run a sand-boxed Python implementation, with some sort of DOM interface. Think `import dom`. Ideally browser's would agree on a hard set of standards ahead of time, so things like jQuery would be unnecessary (even though jQuery is about the only good thing involving JavaScript).

Re: Why I push for Python

#107
post #33
post #4

Earlier quoted context omitted.

Interesting examples you mentioned. Go, I can understand. But why Ruby? It is just as old as Python, behaves very similarly, and its ecosystem for non-web related tasks pales in comparison. And why Scratch? I really enjoy it (I've taught many workshops to kids 6-14 yo with it) but I would absolutely not use it in anything else but introductory classes.

The reason for Ruby is that more playful things seem to happen in that ecosystem. If you want to push something you want to be at the edge right? And although I believe Python and Ruby are equal in many qualities, Ruby is closer to the edge of where the next development happens. That was the reason behind my decision to add that.

> If you want to push something you want to be at the edge right?

Wrong. You need to be at the core. In many areas that I've looked at, most of the activity happening at the edge is just churn from an ignorance of history and a naive blindness or lack of understanding of root problems.

And there is plenty of interesting stuff happening in Python: compilers, visualization systems, devops orchestration, you name it. Don't mistake the noise on HN for reality.

Re: Why I push for Python

#108

Earlier quoted context omitted.

PHP would be even more powerful to you ;)

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.

Re: Why I push for Python

#109

I teach 11 to 18 year olds and I've stopped teaching them Python and started teaching them JavaScript. My main reason for the switch is to overcome the "What's the point of this?" questions that I used to receive. With JavaScript the kids instantly see a result on a platform they're familiar with - a browser. window.alert() is instantly recognisable to them and seems far more relevant than print"" where the output is…

I teach kids in that age as well, and I start out with Python + Pygame.

For an undergraduate level course I would prefer teaching Scheme or C in an introductory class.

Re: Why I push for Python

#110
post #94
post #68

Earlier quoted context omitted.

These aren't computer science students. Most of them won't find recursion and data abstraction interesting in the slightest. If their primary interests were in computer science I'm sure they would have gone into a comp sci program. These students are there to learn programming as a tool to help them solve problems . The elegant recursive algorithm isn't really a goal they have. Their goal is to get a reasonable answe…

That's fair if you're only doing a one semester for non-majors thing. I just saw "our undergraduates" and the debate about learning C and took it to mean starting a CS education with C. Those things I mentioned are how you solve problems though. What I was getting at is learning the low level details of how a computer, or at least C, works isn't problem solving.

>What I was getting at is learning the low level details of how a computer, or at least C, works isn't problem solving.

Agree 100%

Post reply on HN