Live data from Hacker News

UCLA introductory programming classes should focus more on Python, not C++

dailybruin.com

61–70 of 92 posts

Re: UCLA introductory programming classes should focus more on Python, not C++

#61
post #56

Earlier quoted context omitted.

C++ has all this "language-specific" overhead that you kind of have to wade through before you can get to doing anything really productive. Python is easy to use and be productive with out of the box, has a complete feature set, doesn't require manual memory management and has far more expressive errors. It really depends on the emphasis of an intro programming course. If the goal is to cover the basic control struct…

It almost feels as if more universities should have two different "introductory" CS courses: one for non-majors, and another for majors. I would however express that in my CS curriculum (only 6 years ago) we did not start using C++ until my junior/senior year, and instead stuck with Java.

I'm not sure about segmenting intro courses by majors, but there is good research that suggests that segmenting CS1 by level of background knowledge has a significant positive impact on future coursework [0]. I suspect that a larger proportion of students who eventually study CS have a higher degree of background knowledge as well, so this probably makes sense.

[0] https://dl.acm.org/citation.cfm?id=2445248, https://dl.acm.org/citation.cfm?id=2255982

Re: UCLA introductory programming classes should focus more on Python, not C++

#62

I don't know if I should feel good about this. I graduated from UMich back in 2015, and we tend to do a lot of the core CS courses in C++. After working full time for ~2 years, learning to code on a lower level helped me understand computers better and write better code. There are kids around my age group who don't do as much C/C++ and dislike it because of the "pointer" concepts. They find them hard, but these guys…

Pointers aren't the bad thing about C++.

Syntax, templates, etc. are. C++ is a mess, and there are plenty of better alternatives.

Re: UCLA introductory programming classes should focus more on Python, not C++

#63
I hate python. It's an awful language and should be burned with fire. And yet its my go-to language when I just need to handle some small problem. It's so bad, and I use it anyway because it gets the job done. I never use C++ any more. (well, I used C once last year to create a brute force DNA search algorithm that was 30x faster than our previous implementation, but that kinda proves my point). fuck, i learned to program in BASIC.

I was gonna say "maybe Node", but there are a lot of python libraries that benefit academics.

But it sounds like the course we're talking about here is for actual CS majors, in which case, UCLA, are you fucking mental? Python?

I think the issue here, though, is that C++ is fucking garbage now. It's utterly horrible to use, bloated in all the wrong places while utterly non-existent in places that would make day-to-day use of the language viable. Last year I used C (not C++) to get the job done. You'd have to be insane to build a large scale product in C++, and in the places you really need performance, C or assembly is better.

I think UCLA is correct to drop C++. But teach C instead, not python.

Re: UCLA introductory programming classes should focus more on Python, not C++

#64

I don't know if I should feel good about this. I graduated from UMich back in 2015, and we tend to do a lot of the core CS courses in C++. After working full time for ~2 years, learning to code on a lower level helped me understand computers better and write better code. There are kids around my age group who don't do as much C/C++ and dislike it because of the "pointer" concepts. They find them hard, but these guys…

Python is probably as effective as C++ for preparing students for more challenging CS classes in other languages [0]

[0] https://dl.acm.org/citation.cfm?id=1734437

Re: UCLA introductory programming classes should focus more on Python, not C++

#65
post #17

on lower-level implementation details related to how machines interpret code – knowledge that non-computer science students are unlikely to use after they graduate. Yeah, the world really needs a load more developers with no idea how computers work. We don't see any of those in interviews already.

We definitely need more developers who can't leverage more than 10% of the CPU's actual power. Its literally impossible to have any clue about performance without understanding the hardware. Sure you can profile and gain 5-10% after micro-optimizing what the profiler tells you. But you will never, ever get the 200-1000% performance gains you can only get by accounting for the hardware at the very architecture level,…

99.99% of programmers will never need a machine level understanding of the programming language and architecture they use.

Really the only people I see might be machine level understand are 3D engine developers and high speed stock traders. VERY few other people need to understand how you need to organize your collections so that they are brought over in the correct page size from the L3 to L2 cache.

From what I have seen many programmers have no clue as to when to optimize something. They want to optimize everything which is a huge waste of time.

As for programming classes, they are pointless in modern society but most(ALL?) companies still like to see that you have jumped through the hoops correctly. And that you can be trained correctly to "Be a good team member".

Re: UCLA introductory programming classes should focus more on Python, not C++

#66

Earlier quoted context omitted.

We definitely need more developers who can't leverage more than 10% of the CPU's actual power. Its literally impossible to have any clue about performance without understanding the hardware. Sure you can profile and gain 5-10% after micro-optimizing what the profiler tells you. But you will never, ever get the 200-1000% performance gains you can only get by accounting for the hardware at the very architecture level,…

I don't see what any of this has to do with C++, especially modern C++. The only "low-level" detail from lower level systems course I find that is still relevant on a daily basis is cache-alignment - which I doubt they would cover in a 101 course anyways. Almost everything else either 1. the compiler does better or 2. you'd have to know how to fight the compiler to achieve. Anything that would let you achieve 200-100…

SIMD. As you say, "you have to fight (or escape to assembly) the compiler to achieve" SIMD, even in C++. But in C++, you can correctly align the memory in preparation. In Python? Not so much.

Re: UCLA introductory programming classes should focus more on Python, not C++

#67

I don't know if I should feel good about this. I graduated from UMich back in 2015, and we tend to do a lot of the core CS courses in C++. After working full time for ~2 years, learning to code on a lower level helped me understand computers better and write better code. There are kids around my age group who don't do as much C/C++ and dislike it because of the "pointer" concepts. They find them hard, but these guys…

Python is probably as effective as C++ for preparing students for more challenging CS classes in other languages [0] [0] https://dl.acm.org/citation.cfm?id=1734437

Thanks a lot for this reference. Do you happen to know of any other research in this area? I'm looking for academic work on the topic myself and not finding as much as I'd hoped for.

Re: UCLA introductory programming classes should focus more on Python, not C++

#68

Earlier quoted context omitted.

Python is probably as effective as C++ for preparing students for more challenging CS classes in other languages [0] [0] https://dl.acm.org/citation.cfm?id=1734437

Thanks a lot for this reference. Do you happen to know of any other research in this area? I'm looking for academic work on the topic myself and not finding as much as I'd hoped for.

Any other research about languages in CS1 or about CS1 generally?

An easy way to find a bunch: https://scholar.google.com/scholar?hl=en&as_sdt=0%2C48&q=lan... ;)

On another note, SIGCSE just ended so you can find all the latest and greatest here: https://sigcse2018.sigcse.org/index.html

Re: UCLA introductory programming classes should focus more on Python, not C++

#69

Earlier quoted context omitted.

What's so bad about using C++ as a first language? My college uses C++, and I'm very happy that they did so. Transitioning into higher-level languages is very easy, and at no point while I was learning the language did I think "Damn, I wish we used Java/Python". I really have no complains.

C++ has all this "language-specific" overhead that you kind of have to wade through before you can get to doing anything really productive. Python is easy to use and be productive with out of the box, has a complete feature set, doesn't require manual memory management and has far more expressive errors. It really depends on the emphasis of an intro programming course. If the goal is to cover the basic control struct…

>C++ has all this "language-specific" overhead that you kind of have to wade through before you can get to doing anything really productive.

For that reason I'm surprised by the lack of enthusiasm for just starting students in C.

By university, I imagine most students have already spent some time noodling around enough to understand some basic paradigms. C does not have the barrier that C++ has in that way. It's so much smaller, which is great, and no less useful. Soon after learning the basics a student may want to jump to something else, but then they'd be fully equipped.

Not that I'm against the Python approach— but for somebody looking for a deeper understanding C seems like a good choice since you can either drill down into memory management, or (as long as you don't do anything drastic) be somewhat lazy about it (with modern computers).

Python— I agree with many people in the thread—is very suitable for non-majors or a more applied approach. I am consistently trying to encourage non-programmer friends, family, others to take a stab at it because of the increase in productivity or ability it gives them with their machine they use on a daily basis.

... To the other questions— how much do you really need to know to be considered a CS? Surely you could pare it down to theoretical physics if you wanted to and eventually end at some unanswered questions somewhere between electron behaviour and quantum physics, no? Then you're a computer scientist.

Kidding aside and perhaps off topic—but much of the discussion in this thread causes me to wonder why so many interviews surround the ability to re-implement common (stdlib) algorithms, or on the web-side polyfills for existing language features, rather than understand some basics about how memory works from a programming perspective.

Re: UCLA introductory programming classes should focus more on Python, not C++

#70
post #17

on lower-level implementation details related to how machines interpret code – knowledge that non-computer science students are unlikely to use after they graduate. Yeah, the world really needs a load more developers with no idea how computers work. We don't see any of those in interviews already.

You fail to justify why C++ conveys an idea of "how computers work" better than assembly, or machine code, or learning the basics of transistors, capacitors, signals etc. Why does C++ have the "right amount" of abstraction, when it sweeps under the rug a vast body of physics and EE?

> better than assembly, or machine code,

I was studying assembly in the second year. What is the problem? It was really easy because in my early years I was writing 64k demos.

> or learning the basics of transistors, capacitors, signals etc.

It's the simplest part of all computer architecture. I think I can explain what is D flip-flop/transistors in one hour.

> Why does C++ have the "right amount" of abstraction, when it sweeps under the rug a vast body of physics and EE?

C++ has OOP, has a smart and raw pointers, STL(not the best, but better than C). Right now I'm working on a project where I need process more than 50Gb in 10 minutes. Python script uses 110Gb of RAM because there are no pointers. I don't know why the previous developer chose Python for this tool.

Post reply on HN