News for hackers. Stuff that matters.
Re:Python is now the most popular introductory language at t... by hans0l074 on Tuesday July 08, 2014 @03:46AM (#8003420)
I do not know any Python (yet) - and my comment is probably off-topic. I spent a fall semester at Northeastern U, Boston in '97 and took a graduate course in Data Structures which was taught in C. I loved this course and finished top of the class (It helped that I was already familiar with C from an undergrad engg course). I fell in love with C. Implementing dequeues, linked lists, trees etc. with C was a pleasure - I learnt a lot about memory management responsibilities, smart error handling and began to understand how programming can be beautiful. Many years later when I started learning and working with Java, I felt that if this course had been taught with Java, I would not have gained as much (I could be wrong). The simple steps of typing your code in the standed editor supported by the environment (we were using a flavour of Unix in school), saving your work, compiling on the CLI and seeing the results - we just had to focus on our algorithm and nothing else. Your sentence "Many of our students have never programmed with a text editor before our unit, and dropping them into the big boilerplate world of Java micro-management was not good for them or for the course" stands out for me in this context. Since I know zero Python, I wonder how it compares. This reminds of Joel Spolsky's essay : http://www.joelonsoftware.com/articles/ThePerilsofJavaSchool...
Re:Python is now the most popular introductory language at t... by candeira on Tuesday July 08, 2014 @07:30AM (#8003971)
Our unit is a first year unit, and runs for twelve weeks.

This means that we have ten weeks to take people who may have never programmed by typing text into an editor and teach them enough CS and programming that they can implement their own hashmap in Python and reason about its big O performance in one week, start programming in MIPS assembly the next week, and implement function calls in assembly and reason about stack frames the following week.

Anything we can do to make their learning curve less steep is good. You say that your Data Structures course was graduate level, and that you were already familiar with C from a lower course. These are two big differences between you and our first year intake.

Now, like Spolsky, I too have a bit of the Yorkshireman in me, and I wish our students would be forced to work with simple text editors and the command line, instead of having the IDE to do some of their lifting for them. I wish they were taught more maths too. And spelling, now that we are at it. And C, why not.

But when you say that in your course you "just had to focus on our algorithm and nothing else", it echoes exactly our intention when we picked Python for this unit. We wanted the language that would allow our students to focus on the fundamentals, and spend the least time and effort on the incidentals. We were already running the unit in Java, which was an inherited decision. I think Python was the best of our available choices.

Re:Python is now the most popular introductory language at t... by Goladus on Tuesday July 08, 2014 @10:13AM (#8004582)
I've commented before in a variety of places that if I were to design a first-year curriculum that would have suited me best, it would start with python in much the way that is discussed in this thread, focusing on the concepts and algorithms and general concepts of coding.

But the next course would be a hardcore introduction to C, embracing the language peculiarities instead of shunning them and trying to stick to concepts. I think at least once in an undergrad's career, preferably sooner than later, they should go through the process of learning the nuts and bolts of C.

I've probably been doing my own thing for too long to know for sure whether C is still the best choice, all I know is that NOT having the sort of class I describe, early in my college career, made things far more difficult later on.

Re:Python is now the most popular introductory language at t... by aninhumer on Tuesday July 08, 2014 @11:06AM (#8004838)
Indeed, I'm surprised by how often people make arguments that seem to assume the only options are C from the start, or no C at all.

When you're teaching systems programming, all the things that have to be done by hand in C are precisely the things the students are supposed to be learning. But for almost everything else, they're pointless details that obscure what you're actually trying to teach.

Teaching multiple languages also has the advantage of showing people how they're mostly not that different.

Re:Python is now the most popular introductory language at t... by candeira on Tuesday July 08, 2014 @11:42PM (#8007954)
> When you're teaching systems programming, all the things that have to be done by hand in C are precisely the things the students are supposed to be learning. But for almost everything else, they're pointless details that obscure what you're actually trying to teach.

Exactly.

Re:Python is now the most popular introductory language at t... by aganders3 on Thursday July 10, 2014 @11:49AM (#8015362)
I had a course kind of like this. My intro CS class was taught in Java, and the following summer or semester I took a 1-credit course called something like "C (and C++) for Java Programmers".
Re:Python is now the most popular introductory language at t... by sand500 on Tuesday July 08, 2014 @02:27PM (#8005931)
Why does your data structure course cover assembly? I am just curious because in my school, they teach assembly bottom up, starting from digital logic and transistors and eventually get to C.
Re:Python is now the most popular introductory language at t... by candeira on Tuesday July 08, 2014 @07:55PM (#8007396)
I think it's a combination of three factors:

1. Historically, before it was taught in Java, this unit was taught in C, and it would have been a natural transition from building data structures via explicit pointer manipulation to explaining stack frames as a specialised data structure for handling scoped variables in function calls.

2. Despite the move to a higher level language (and, from assembly and machine code, even C is a higher level language), it's good for the students to get some exposure to the machine model, and what is going on deeper in the stack of turtles.

3. The lecturer who runs the course also has a bit of the Yorkshirewoman in her. So students learn a tiny bit of MIPS like they should eat their spinach and shower with cold water, uphill both ways, in the snow, or something.

Re:Python is now the most popular introductory language at t... by zo1 on Tuesday July 08, 2014 @08:45AM (#8004234)
Most of that article is rendered moot with this section:

"Now, I freely admit that programming with pointers is not needed in 90% of the code written today, and in fact, it's downright dangerous in production code. OK. That's fine. And functional programming is just not used much in practice. Agreed.

But it's still important for some of the most exciting programming jobs."

Pretty much saying that everything he just spoke to us is purely for the "exciting programming jobs". And let's face it, most of us do not have that unless we go out of our way to pigeon hole business problems into being fun and exciting.

Re:Python is now the most popular introductory language at t... by gaius on Tuesday July 08, 2014 @02:49PM (#8006049)
Yes it's funny, these places are teaching Python for the same reason they taught Java: it's "easy" and will get you a job. Yet we slate Java-schools, and cheer Python because it's trendy.

The truth is, universities shouldn't care what industry does, because "real-world" computing is more about fashion than it is about any sort of science. And if you do it right people can learn any language they need (case in point, I learnt FORTRAN at college, now I do Python for a living and OCaml as a hobbyist).

Re:Python is now the most popular introductory language at t... by Goladus on Tuesday July 08, 2014 @06:36PM (#8007101)
Yes it's funny, these places are teaching Python for the same reason they taught Java

That's not what I'm seeing at all. What I'm seeing is discussion of specific traits about Python that make it especially suited for a beginner language. And I'm seeing these arguments made over and over and over again, convincingly, in a way that was NEVER done for Java.

Re:Python is now the most popular introductory language at t... by sourc3 on Wednesday July 09, 2014 @06:45AM (#8008953)
If these Python classes were given to an industrial engineer or a chemistry major who just needs enough programming knowledge to crunch numbers/create scripts I would definitely get the approach and agree with it.

However, if you want your Computer Science majors to be able to create the next runtime like the JVMs, .NETs etc. or be able to do some device programming they need to learn C/C++.

A decade after going through a top-tier CS undergraduate program what saddens me is that a lot of university students today, think that Computer Science is cobbling github sourced code with their choice of scripting language. Yes, the startup market is hot and sometimes that's all you need but CS is much more than that. CS is about understanding the underlying models and concepts rather than a language. If you are totally missing how memory management is done, how data structures are laid out in memory, how typing works you are missing a big chunk of code-base out there in the world today.

I think the new wave of CS students, who are expected to solve larger problems, need to understand how billions of devices/apps are running in today's technology so they can create something better in the future.

Re:Python is now the most popular introductory language at t... by zo1 on Wednesday July 09, 2014 @07:33AM (#8009069)
"However, if you want your Computer Science majors to be able to create the next runtime like the JVMs, .NETs etc. or be able to do some device programming they need to learn C/C++." 98% of all developers don't actually need to write the next JVM, or .NET or something.

"think that Computer Science is cobbling github sourced code with their choice of scripting language." This is the beauty of programming, and I'm sorry you can't appreciate that. Not everyone is willing to stab themselves in the eyeball trying to re-implement the .NET/JVM wheel or other low-level library.

It's the same reason the majority of us don't write assembler anymore. We've moved on and abstracted away from that arcane knowledge. Does that mean that arcane knowledge is irrelevant? For most of us, yes. For others, no.

"Yes, the startup market is hot and sometimes that's all you need but CS is much more than that. CS is about understanding the underlying models and concepts rather than a language." Meanwhile, in the real world, CS is not really necessary for most business problems. No matter how much you wish to romanticize it as a discipline.

Re:Python is now the most popular introductory language at t... by Goladus on Wednesday July 09, 2014 @11:57AM (#8010327)
However, if you want your Computer Science majors to be able to create [...] they need to learn C/C++.

It doesn't have to be the first language introduced. It should be second. My other comment in this thread: https://news.ycombinator.com/item?id=8004582

CS is about understanding the underlying models and concepts rather than a language.

Programming Language implementations are exploratory tools critical to understanding those underlying models and concepts. Indeed, in my experience the "CS is about understanding the concepts" logic is more often than not used as an excuse NOT to teach C.

Re:Python is now the most popular introductory language at t... by RogerL on Wednesday July 09, 2014 @03:34PM (#8011776)
My first language was Basic (in 1982).

The second was assembly.

I've gotten by in my career (to put it mildly).

What "top tier" undergraduate program is graduating students that can't lay out data structures in memory, don't know types, and so on?

Re:Python is now the most popular introductory language at t... by sourc3 on Wednesday July 09, 2014 @08:12PM (#8012927)
Having recruited 3 dozen interns/jr.programmers from schools in the tri-state area and overseas in the past 5-6 years, you would be amazed how many students don't get these basics.

Those schools actually DO try to teach students about these concepts. How do I know? I personally have spoken to the deans of CS departments. Now imagine these same students, who no longer even hear of concepts such as garbage collection, pointers, etc. because it just works in their chosen language.

I believe the era of a single language for your career is long gone. Most people in their 20s and even 30s today will go through at least 4-5 different languages throughout their career.

Personally, I learned and enjoyed C++ 15 years ago but I do not find it practical for anything I do today. However, the same "impractical" knowledge allows me to get familiarized with a new language in a few weeks and start producing working software.

I don't quite care what language students learn as long as the concepts are understood. However, if the language they first start with hides most of these fundamental concepts, they no longer have any incentive to even learn how anything works.

Re:Python is now the most popular introductory language at t... by Goladus on Monday July 14, 2014 @09:35AM (#8030801)
My first language was Basic (in 1982). The second was assembly.

This is not terribly different than what I suggest. I'm saying in the modern world, Python fills the role of Basic and C fills the role of assembly.

The abstract idea is:

First Language: Clean and simple, to introduce the very idea of coding algorithms for a computer.

Step two: Low-level language requiring a lot of attention to detail. Should be useful for exploring low-level details about computer architecture as well as writing real programs.

Notably: Java doesn't fit very well into either category. There's a lot of overhead for pure beginners, and too many layers between the programmer and the hardware

Re:Python is now the most popular introductory language at t... by hnriot on Tuesday July 08, 2014 @01:56PM (#8005769)
"we have ten weeks to take people who may have never programmed by typing text into an editor and teach them enough CS and programming that they can implement their own hashmap in Python"

that seems utterly pointless to me.

Re:Python is now the most popular introductory language at t... by Goladus on Tuesday July 08, 2014 @06:43PM (#8007132)
Maybe, I'd have to see the actual class.

Remember that if this is a 4-year curriculum, they may eventually be expected to write code for a hashmap in C or some other low-level language as part of a data structures or algorithms class. And often, a class like that will spend time on analysis and algorithm design tradeoffs. The best way to understand why accessing a hashmap can be done in O(1) time is to actually code one for yourself.

This may simply be a preview.

Re:Python is now the most popular introductory language at t... by candeira on Tuesday July 08, 2014 @08:59PM (#8007590)
> they may eventually be expected to write code for a hashmap in C or some other low-level language as part of a data structures or algorithms class (...)

> This may simply be a preview.

No, this is it as far as the core units go.

This is the first course on data structures and algorithms.

There is a second year course that deals with further data structures and algorithms: we teach amortized performance, proofs by induction, some randomized data structures (skip lists and maybe another), different tree-based structures (I remember red-black trees and patricia trees), some graph search algorithms and a bit more than I forget now. And currently we are doing it in Python for the first unit, and in any language that the student and their tutor can agree on for the second unit.

Remember: these are just class exercises, not real implementations. Of course nobody is going to write actual functioning data structures in Python[1] and expect them to be usable for general purpose programming[2]. That would be daft!

[1] https://bitbucket.org/pypy/pypy/src/8920909d084ec0d42535b955...

[2] http://pypy.readthedocs.org/en/latest/

Re:Python is now the most popular introductory language at t... by pwang on Thursday July 10, 2014 @12:31AM (#8013627)
> Of course nobody is going to write actual functioning data structures in Python

Or even http://toolz.readthedocs.org/en/latest/

Daft, indeed! :-)