UCLA introductory programming classes should focus more on Python, not C++
dailybruin.com
dailybruin.com
Students that are unfamiliar with programming are encouraged to take this course before the C++ course.
Unclear from afar...
Python is good in the multi-paradigm sense but it abstracts too much away. C++ gets in the way of learning the higher level concepts. Scheme is great for teaching but not really used. I think Julia sits comfy in the middle and can be a great teaching language once its tooling evolves more. It's the only language I know of where some people are writing lazy functional code with metaprogramming, others are writing high-level scripting language vectorized code, while others are writing inline LLVM and controlling stack vs heap allocations, and it all makes sense. I wouldn't use it in a first programmer's course quite yet because the books and tooling need a little bit more, but in a few years I see it as a great option for a university to choose than can span multiple courses, from beginning programming all the way to the algorithms courses and HPC.
Why? Teaching different languages for different kind of requirements make much more sense.
Time spent getting a class to learn new syntax is unnecessary and takes a long time.
On the other hand, a new language (ideally) teaches you a new way to think about problems. If you have a concrete problem to focus on, that part becomes much easier and intuitive.
Keeping an entire class on the same page is.
Introducing a new side-topic would be detrimental to traditional lecture-based courses.
...not that they are a particularly good method in the first place.
It starts with Lua(Jit) -which is a very simple, powerful, Schemy language. Lua is used both as a runtime and as a metaprogramming layer for a Lua-ish interface to LLVM IR (including SIMD) that requires static typing and manual memory management. It is intended to be the implementation layer of compilers and JITs and it is created by and for the HPC community.
All it really needs is more attention, documentation and tutorials.
(Disclaimer: I started SageMath and CoCalc.)
For CS students, there's a good argument for starting with the fundamentals and adding abstractions later. It's not the only way to learn it, but if the CS department wants to start there for CS students, that's reasonable.
Ironically I spend about 90% of my time in Java code. That said understanding the fundamentals is super-valuable when root-causing JNI issues or trying to speed up the VM in cases where normal Java approaches don't cut it.
For example, the standard library does not have access to language features hidden from users.
I don't think Python is a bad first language to learn, but I think that it's important to consider the audience of these introductory CS classes. These classes aren't really designed JUST to teach you programming (I say this as a person who never coded before CS31). This is why the UCLA Computer Science faculty recently introduced CS97, which is actually an introductory programming course taught in Python for absolute beginners. That way those who are already comfortable with coding can ease themselves into learning about lower-level implementation they may not have been exposed to before, and absolute beginners can supplement their introductory _Computer Science_ class with an introductory programing class as well.
As for the argument that C++ isn't good learning language, I beg to differ, it gets you very close to the meat of how programming works, without the layers of abstraction that higher languages offer. C++ requires that you understand memory, its allocation, and allows you easily to see how it interacts.
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.
Professors don't like having to waste time in their classes teaching a language, so there's a strong pull to unify as much as possible, so you can be 100% sure that your students have some form of knowledge before they get into your class.
So, the "switch" would be changing that big block of core, required classes.
So when they switch languages, they mean moving all this curriculum to another language at once. The higher level courses don't change.
There was plenty of focus on problem solving and developing interesting programs. The language didn't get in the way at all.
One thing we had that seems lost today is the nice, simple programming environment with Borland Turbo C++. These days I suppose people use Visual Studio but can kids really go home and get up and running quickly? Embarcadero exists but the license is prohibitive. Perhaps if there was some way to get them working in a unix environment--which is what they'll end up in anyway--but teachers would be right to balk at the idea of teaching a new OS...
But I still had a fascination with C. I tried to do a few networking projects using C which turned out to be more tiring than expected thus abandoning the whole project. I think if we would have stuck with C/C++ all the way through the Algorithm's class it would have been much more helpful. Java/Python is way too easy to pickup later on your own and reproduce the same results that one would in C/C++.
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 also don't know other CS concepts like how a GC works or pass by value vs. pass by reference.
Our professors have good reasoning for why the school does this: "By teaching you everything in C++ first, you'll find it much easier to pick up any other programming language".
Syntax, templates, etc. are. C++ is a mess, and there are plenty of better alternatives.
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
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.
Tl;dr: agreed that low level computing fundamentals are helpful to every developer, disagreed that intro classes are the right place for them.
That said, there is definitely something to be said for learning a lower-level language fairly early on I think. It's much easier to go from worrying about pointers vs values, manual memory management etc to not having to think about them than it is the other way round.
Knowing more and deeper information is usually a good thing, but students don't need to learn it all at an introductory level which I think this article is focusing on.
Aside: I'm not convinced that Python is a perfect first language either - its error messages are very unhelpful when you're learning. Also I think a "NAND to Tetris"-style curriculum could work, but C++ would still not be the first step for this.
Also, look at the second half of that sentence. This is not about "developers". If you're a business or physics student who's taking one elective programming course over a bachelor's degree would you be better served if that one course was in Python? Yes, absolutely.
There's also a risk you'll set students back if it's not effective so there are definitely ethical concerns and it requires interrupting a professor's load for the quarter. That said, CS educators conduct research like this all the time and there's probably a lot of value in studying this kind of change.
It really depends on the emphasis of an intro programming course. If the goal is to cover the basic control structures of a higher level language (conditionals, loops, switch statements, functions) and the fundamentals of object oriented programming, and get into some basic algorithms and data structures, then Python probably has less baggage and is more terse and expressive than something like C++.
[0] https://dl.acm.org/citation.cfm?id=2445248, https://dl.acm.org/citation.cfm?id=2255982
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.
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, something you can't fix by just profiling later on.
What even is the point of having programming classes if alls they do is teach what you can learn yourself with an online tutorial?
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-1000% performance gains in Python vs C++ (besides, again cache alignment) is likely not something you would cover in a intro level course. (I know C++ is faster Python, but that has nothing to do with "accounting for the hardware at the very architecture level")
Well, you can learn everything covered by even the most exhaustive CS degree by yourself using open resources. Low level knowledge is not locked away in some ivory tower. You certainly don't have to join a modern priesthood to gain access to high quality learning material, no matter how much the priests tell you otherwise :)
I've been reading that book, too, and agree with the sentiment
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".
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.
Most applications aren't written on the machine level, nor do they have the complexity that requires machine level knowledge. Embedded systems programming is, at this point, a separate disciple than generic software engineering.
The only regular exception I see to this is the poor curriculum around most Java oriented BS programs. I've seen many candidates come from a Java focused school that couldn't even write their own code without a full hand-holding IDE.
For CS/CSE and engineering majors we take the CS31 (intro to CS)/32 (data structures and algorithms)/33 (operating systems) series - these primarily use C++ (if not C, assembly, etc.)
https://cacm.acm.org/blogs/blog-cacm/176450-python-is-now-th...
Similarly, most high schools offer introductory programming courses. I would expect almost every CS major to have taken these classes prior to being admitted to the major.
If you didn't take those courses in high school, there are avenues to acquire that knowledge before taking the CS required courses.