Live data from Hacker News

Why I push for Python

lorenabarba.com

91–100 of 129 posts

Re: Why I push for Python

#91
post #44

Why do people advocate Python and not a dialect of Lisp for beginners? Are prefix notation and parentheses really that terrible in exchange for a completely unified syntax?

When you show someone a mathematical formula using standard infix notation, and then want them to write a program to implement it, it's immensely helpful if the syntax of the language is close to the mathematical notation. Infix operators are a huge boon to readability for beginning programmers, especially those with some science/math background.

This is the subject of some extended discussion in the new PEP proposing a Python infix operator for matrix multiplication. http://legacy.python.org/dev/peps/pep-0465/

Re: Why I push for Python

#92
post #55

Earlier quoted context omitted.

Instead of teaching them about function composition, recursion, data abstraction, and all the interesting concepts of computer science you end up teaching them a bunch of incidental stuff about memory locations and syntax. Python suffers from this less than C, but still much more than Scheme. I really can't imagine advocating for something other than some dialect of scheme (maybe racket) for an intro undergraduate co…

Memory locations? In Python? I don't even know what you're saying.

    a = [1,2,3]
    b = a
    b += [1]
    => a == [1,2,3,1]
a and b point to the same piece of memory even if you don't have to explicitly deal with pointers, you need to reason about them

Re: Why I push for Python

#93
post #41

[deleted]

The fact he got so many things wrong trying to make a C++ hello world from memory actually reinforces his point. All these idiosyncrasies are nothing more than friction to a beginner. These only matter if you're trying to teach C++, not programming as a whole.

Or it means he has simply no clue what hes talking about.

Re: Why I push for Python

#94
post #68
post #55

Earlier quoted context omitted.

Instead of teaching them about function composition, recursion, data abstraction, and all the interesting concepts of computer science you end up teaching them a bunch of incidental stuff about memory locations and syntax. Python suffers from this less than C, but still much more than Scheme. I really can't imagine advocating for something other than some dialect of scheme (maybe racket) for an intro undergraduate co…

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.

Re: Why I push for Python

#95
post #86
post #65

Earlier quoted context omitted.

>Sure Python is easy to read and easy to write, but that's not really the point. That is the point. This isn't for comp. sci. students, this is for engineering students. I know that in America, unlike other countries, "engineer" is a non-protected term and that lots of guys who don't actually have engineering degrees (such as comp sci majors) call themselves engineers. But "actual" Engineers, i.e. the people who have…

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 these terms mean to you, or you're just hurriedly trying to justify your own internal view of superiority over "non-engineers" because you're a "mechanical engineer" and don't like being on the same plane as them.

That's your problem. I'm not confused in the slightest nor do I feel superior. Different skills for different areas of focus.

I specifically referred to computer scientists as "specialists" having more appropriate training. If you're upset because you can't legally call yourself an engineer in my country then that's not my problem.

> They all had a vested interest in protecting the term engineer because if they didn't, it would devalue their worth and the degree they hold. And the government-body given "accreditation" that they lord over people for higher pay.

Sounds like you're the one with an inferiority complex here. I like how you put "accreditation" in quotes as if to imply that accreditation is not really worth anything. That's very mature. The term Engineer is protected in my country due to very real issues of public safety. You don't want someone certifying a skyscraper as safe, only to find out they are an architect, not an engineer, and therefore weren't trained in structural dynamics, metal fatigue, stress analysis, etc. If that architect wants to be able to certify buildings they need to demonstrate competency to the regulatory authorities by completing an accredited program.

You know how they say "don't roll your own crypto, leave it to the experts"? Same thing.

Re: Why I push for Python

#96

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.

There was no desperate need for Unicode everywhere when Python 2 was made. Looking back it's a fix, but other languages have this problem either and can't really be avoided.

Re: Why I push for Python

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

The dedication filter is much of the value the college experience provides. As many people would argue, a degree in CS doesn't actually teach you marketable or relevant skills to a sufficient degree.

Re: Why I push for Python

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

Really? I would argue that every serious programmer needs to eventually learn those things, and most people I talk to agree with me. If you're a business person who wants to learn how to code, that's fine, you don't need a deep understanding of how your machine works; but to be a really good software engineer, I think you need to learn C and assembly, even if you never actually use those languages/concepts directly in your work.

Re: Why I push for Python

#99
I agree, with reservations. Python is great for introducing people to programming; however, it is not necessarily great for teaching computer science concepts.

My 200 level data structures and algorithms class was taught in Python, and it just felt awkward. For example, we constructed an "array" by basically creating an abstraction on top of a list, which did nothing but remove features and introduce overhead. It kind of felt like teaching someone how to make a bike by taking all four wheels off of a car and only putting two back.

Re: Why I push for Python

#100
post #92

Earlier quoted context omitted.

Memory locations? In Python? I don't even know what you're saying.

a = [1,2,3] b = a b += [1] => a == [1,2,3,1] a and b point to the same piece of memory even if you don't have to explicitly deal with pointers, you need to reason about them

You just have to explain that "b = a" means that you're adding a new name to the thing/object named "a". Whether it's in the same memory location or not is an irrelevant implementation detail.
Post reply on HN