Live data from Hacker News

Why I push for Python

lorenabarba.com

21–30 of 129 posts

Re: Why I push for Python

#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 vendors provide Matlab example code (and not Python code), and all of my peers use Matlab. When I have a problem they can usually help me solve it, if I'd been using Python I would've been all by myself and likely unable to finish the task.

And really, these are the most important things to consider when choosing a language. As it stands, Matlab is the right language to choose, at least for me.

Re: Why I push for Python

#22
post #11
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…

I started typing a really verbose and roundabout answer that really just amounted to this. I don't even really agree with learning Python first. If you can get over the hurdle that is learning C (or really even just Java), you have the benefit of learning so much more about computing and the fact that types are implicitly being adhered to, memory is being managed beneath the surface, garbage collection, etc. I learne…

That's a reflection of the skill/desire of the programmer and not their initial introductory language. A naturally curious and intelligent person who wants to get better at their craft is going to learn about this stuff. Some people are happy learning enough to get by, and that's ok. Not everyone is destined to learn everything about their machine down to how disk controllers work.

Personally, I barely learned enough C to even be dangerous, and it's had no negative effects on my work. I have a reasonably good understanding of how Python works at the abstractions that I need to. If I need to learn more, I go figure it out. In truth, the most useful stuff I learn about writing efficient code comes from reading articles/blogs that give medium-level overviews of how a language implements certain features and how it effects your software. Would knowing C help with that? Not in the slightest.

Re: Why I push for Python

#23
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…

There are basically two things we call "programming".

One is the specification of a process in algorithmic terms - the abstract, but rigidly defined sequence of transformations on input data into output data. This is a field of mathematics.

Two is the building of a physical system to take input data and produce output data, these days by configuring a complex machine comprised of many different pieces of silicon, each of which takes a string of bits and understands a concrete machine language. We have built a high tower of abstractions, so many different silicon-based computing machines can be programmed the same way without programmers going insane. This is a field of engineering.

You need to teach both. They are two completely different skillsets and a successful developer needs to understand both sides - the mental tools necessary to make algorithms, and the engineering skills necessary to make machines that implement algorithms. You don't start from discrete mathematics and then proceed to trying to bang them inside a computer, nor do you start from silicone and then pretend this is the basis for algorithms.

Both are starting points and you need to approach both as their own thing, not a continuation of the other. To this end, it would be for the best to teach both C and Python at the same time. I find that the two aspects of programming are their own mindsets and things learned in the beginning of each don't really carry over to the other.

And then hope the student can put one and two together.

Re: Why I push for Python

#24
post #6
post #2

I'm a huge Python fan (90% of my code is Python, work and private), but I don't think any more it's still the language to push. I have not much experience but it seems Go, Ruby, and Scratch seem to be the one's people should be heading towards (which one depends on the level of skill required). But it's really just my feeling, I have no data to proof it.

I'd have to agree, Go is suited to more intermediate level students and Scratch for extreme beginners and younger children, but Ruby? Ruby is like a harder to read, slower, less used python. Once rails falls(and it is falling) ruby will become a niche language.

I think Go isn't particularly suited for students at any level. It is a language built for applications that aim to scale extremely well in the cloud, and usually it is being used to replace small parts of a larger infrastructure. Go does not look as inviting for general web development (when runtime speed is not as essential as features) or general programming outside the web/cloud.

Re: Why I push for Python

#25

Python was the first language I learned in college, and I have to agree with the OP's opinion on this. While transitioning to C++ in later courses did involve some pain points, I felt like python was a great way to ease into the programmer mindset and get the basic concepts out of the way before delving into the more low-level stuff like pointers, and later with OOP. Not to mention that Python is becoming the Lingua…

PHP would be even more powerful to you ;)

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

Re: Why I push for Python

#26
post #2

I'm a huge Python fan (90% of my code is Python, work and private), but I don't think any more it's still the language to push. I have not much experience but it seems Go, Ruby, and Scratch seem to be the one's people should be heading towards (which one depends on the level of skill required). But it's really just my feeling, I have no data to proof it.

Go is a highly specialized language made for very specific use cases and mind, and still missing features that are essential in many programming domains (dynamic linking and real generics come to mind).

Ruby has no real reason to be if you're already using Python. Nothing wrong with that language (although I consider its programming culture to be inferior in many aspects) but it doesn't really do anything that Python doesn't do, even if it has a few more syntax tricks, which are at best a nice but superficial advantage, at worst another point of confusion and bugs.

Scratch is impractical, and a toy language. Whatever ease of use it has is very quickly surpassed by the need to be productive.

Re: Why I push for Python

#27
post #2

I'm a huge Python fan (90% of my code is Python, work and private), but I don't think any more it's still the language to push. I have not much experience but it seems Go, Ruby, and Scratch seem to be the one's people should be heading towards (which one depends on the level of skill required). But it's really just my feeling, I have no data to proof it.

> Go

Requires curly braces and type declarations. These are easy for beginners to screw up.

> Ruby

Ruby's syntax makes me want to gouge my eyes out -- it's every bit as bad as Perl. I'm an expert and I hate Ruby. I wouldn't dream of exposing beginning CS students to that crap unless I wanted to convince them to change their major.

> Scratch

This is a toy language in a toy environment. I don't know the language well enough to judge its syntax, but the author's goal is "...rather swiftly bringing [students] to a level of skill where they can use computing in their other courses: to analyze data for those lab reports, to learn linear algebra, to solve problems in particle mechanics, problems involving differential equations, maybe even to write a program to control a robot." Scratch doesn't seem well-suited to this role, but there's enough language and library support for Python to be used in all these roles and many more.

Re: Why I push for Python

#28
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…

Big existing codebases always hinder language adoption.

But Python is becoming the lingua franca of scientific computing, owing to great open source tool and libraries. Very soon hardware vendors will always provide python example code, python "drivers" or REST-like APIs.

I don't say this lightly, and this statement is hardly ever right, but in this specific instance, Python is clearly the better "language" compared to Matlab, even in scientific computing. The syntax and quirks in Python are more consistent than in Matlab and general programming is a lot easier.

Re: Why I push for Python

#29
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…

"Research" is a wide area. I personally used Python in HCI research during all my time in grad school, and thoroughly enjoyed it.

What field are you in, if I may ask?

Re: Why I push for Python

#30
post #2

I'm a huge Python fan (90% of my code is Python, work and private), but I don't think any more it's still the language to push. I have not much experience but it seems Go, Ruby, and Scratch seem to be the one's people should be heading towards (which one depends on the level of skill required). But it's really just my feeling, I have no data to proof it.

Go is a highly specialized language made for very specific use cases and mind, and still missing features that are essential in many programming domains (dynamic linking and real generics come to mind). Ruby has no real reason to be if you're already using Python. Nothing wrong with that language (although I consider its programming culture to be inferior in many aspects) but it doesn't really do anything that Python…

I appreciate your effort to explain in more detail how it actually might be. +1 for that.
Post reply on HN