
UCLA introductory programming classes should focus more on Python, not C++ - hongeez
https://dailybruin.com/2018/02/28/mariah-furtek-ucla-introductory-programming-classes-should-focus-more-on-python-not-c/
======
piemonkey
I would like to point out before this discussion moves too far along that UCLA
does in fact have an introductory programming course which is taught using
Python:
[http://web.cs.ucla.edu/classes/enroll/97/](http://web.cs.ucla.edu/classes/enroll/97/)

Students that are unfamiliar with programming are encouraged to take this
course before the C++ course.

~~~
ISL
CS 97 is even mentioned in the article, but perhaps the C++ course is required
for graduation, while 97 might not satisfy that requirement?

Unclear from afar...

~~~
wccrawford
piemonkey said that they're encourage to take the Python one first, meaning
they still have to take the C++ course as well. The Python one is optional and
intended for those who are having trouble jumping straight into C++.

------
ChrisRackauckas
I really like Lisp-based and multi-paradigm languages for teaching because you
both want to span as much of CS as possible in a single language, and you
eventually want to implement languages and compilers as part of the
curriculum. The former requires multi-paradigm, the latter requires good
metaprogramming and homoiconicity. You also want the ability to get low-level
to talk about the assembly code (or LLVM IR), function pointers, and handling
of memory allocations.

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.

~~~
fooker
>you both want to span as much of CS as possible in a single language

Why? Teaching different languages for different kind of requirements make much
more sense.

~~~
thomastjeffery
That would end up being too much to cover during the course.

Time spent getting a class to learn new syntax is unnecessary and takes a long
time.

~~~
fooker
Learning syntax is not really that difficult.

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.

~~~
thomastjeffery
No, it's not.

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.

------
williamstein
UCLA is one of the biggest users of CoCalc.com. They use CoCalc extensively to
teach a course called "LS30: Mathematics for Life Sciences". Well over 1000
students a year in this course program in Python for hours every week (via
SageMath Worksheets) in a lab and at home. The content is really beautiful,
and teaches ideas from Calculus in a much more hands on and motivated way.
Expanding Python education at UCLA would definitely help support the LS30
sequence.

(Disclaimer: I started SageMath and CoCalc.)

------
andrewmutz
It makes a lot of sense for non-CS students to be able to learn CS using
Python.

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.

~~~
vvanders
+1, back when I was considering attending the UC system the fact that Java was
taught almost exclusively pretty much removed them from my list. We had UCSD
students coming to my local community college to take the C course I was in
since it wasn't being taught at UDSD. It always shocked me considering they
had a pretty awesome super-computer lab.

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.

------
ecshafer
Who is the author that makes them an authority on this? I couldn't find much,
but it looks like they are just a student or journalist that writes opinion
pieces. Shouldn't the professors designing the courses have much more say than
someone that does not appear to be an expert?

~~~
jakear
It's an opinion piece in the student newspaper. So it's just a student saying
"this is how I feel".

------
fooker
In my opinion C++ and C are rather good choices for a first language. There is
significantly less 'magic' going on behind the scenes and the language design
choices generally have sane explanations.

For example, the standard library does not have access to language features
hidden from users.

------
Zofren
A CS education, for better or worse (in my opinion - for the better), is
grounded in theory and foundational knowledge. Introductory CS classes are
designed to ease people into programming, yes, but also to give a taste for
concepts that they'll eventually have to become very comfortable with later
on.

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.

------
Meph504
What UCLA is doing, as well as most universities is the difference between a
university and a trade school. these courses do, and should focus on the
fundamentals. University is teaching the theory, and having a fundamental
understanding. Otherwise there are ample trade schools and code camps, that
will skip the fundamentals, and teach you the basics of programming tailored
to the current job markets needs.

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.

------
tomtheelder
CS50, the intro CS course at Harvard, which is notably a large and successful
MOOC in addition, is taught in C. It's a really bizarre choice, and only
serves to add complexity to a topic that already has a fairly high cognitive
barrier to entry.

~~~
walshemj
As opposed to jumping into C++ in all its OO glory?

------
brian_herman
I think fundamentals of programming should be more emphasized not the language
itself.

~~~
jackconnor
This is all that CS has ever been, and is the reason they're teaching in C++
in the first place (it's a low-level language good for learning fundamentals),
which is fine. But a huge part of CS students graduate without knowing how to
code in languages that are reflected in the jobs they are trying to get, which
are mostly python, javascript, and java. If you think the industry is fine,
great, but if you agree with those that think CS degrees should emphasize job
skills a little bit, then teaching courses in Python is a good move.

~~~
walshemj
well that is not a Universities Job is it

------
lowbloodsugar
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.

------
bradleyjg
I’m quite surprised they are still using c++. I thought most schools switched
to java by or in the first half of the oughts.

~~~
electricslpnsld
What does it even mean for a school to 'switch' languages? When I did my
bachelors it was straight up a new language in each class, at the discretion
of the prof in charge. Intro class homework was in Java, data structures was
in C++, operating systems was in C, digital logic design was in Verilog,
bioinformatics was in Python, ...

~~~
steveklabnik
I'm not sure if it was an official policy or not, but at my school, all of the
core classes were in Java. Other classes used other languages where
appropriate, and "core classes" is not synonymous with "degree requirements";
you had to take classes that used not-Java. But Java was considered the
default.

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.

------
defgeneric
When I was in high school C++ was taught as an intermediate language to
sophomores. Most everyone in the class had no issues learning the language. We
were all making our own versions of frogger in the terminal.

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

~~~
bdowling
C++ was a much simpler language back in the Turbo C++ days (early 1990s). If I
recall, there were no namespaces, exceptions, or templates (and no STL). It
was much easier to get started with back then.

~~~
abhishekjha
I graduated recently and we were taught C first and then C++ of OO concepts. I
don't think anybody had issues learning OO concepts this way though most of
what we learnt went out of the window when we started learning Data Structures
and Algorithms in Java. It seemed a lot easier and a lot more could get done
in the same amount of time spent on C/C++.

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++.

------
tzhenghao
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 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".

~~~
techman9
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](https://dl.acm.org/citation.cfm?id=1734437)

~~~
jcrawfordor
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.

~~~
techman9
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...](https://scholar.google.com/scholar?hl=en&as_sdt=0%2C48&q=languages+in+CS1)
;)

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

------
zelos
_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.

~~~
jeremiep
We definitely need more developers who can't leverage more than 10% of the
CPU's actual power.</sarcasm>

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?

~~~
nemothekid
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-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")

~~~
AnimalMuppet
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.

------
quanpod
Whoa... (UCLA c/o 2010, Bioengineering) UCLA used to use C# in the PIC10A
series. I didn't take too many classes in these series, but did audit some
while I was deciding as a non-CS major how technical to become. Personally, I
think it's fine for the Math Department to use Python - there's plenty of
opportunities to do the lower level stuff or unmanaged stuff in other classes
at UCLA.

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.)

------
peterjlee
Here's a 2014 study of top 39 US CS programs on what language they user for
their intro courses. More than half use Python, followed by Java.

[https://cacm.acm.org/blogs/blog-cacm/176450-python-is-now-
th...](https://cacm.acm.org/blogs/blog-cacm/176450-python-is-now-the-most-
popular-introductory-teaching-language-at-top-u-s-universities/fulltext)

------
taoethnoeua98
I think I agree with this article (even if some of its argument is bogus). The
other thing that all programming classes should teach, regardless of whether
they're for CS majors or not is how to debug using a modern (i.e. not command-
line-based) debugger. It's insane that programming is being taught anywhere
without teaching debugging at all, or teaching only very hard-to-use
debuggers.

------
coupdejarnac
I majored in EE at UT Austin around 2000, and our intro programming class was
C++. I doubt there was a good rationale for it other than to cause rapid
attrition of EE majors. I never again used C++ in my studies or
professionally. Learning C would have been much more helpful for my later
embedded systems classes.

------
blackflame7000
UCLA is teaching computer science, not programming. To fully understand and
appreciate the intricacies of modern computers you cant just ignore the
fundamentals because they are too rudimentary. Just ask Tim Duncan about the
importance of fundamentals.

------
hongeez
Guido van Rossum's tweet:
[https://twitter.com/gvanrossum/status/969443110735331328](https://twitter.com/gvanrossum/status/969443110735331328)

~~~
bluefox
Maybe it's "enough" for Guido...

------
robotcookies
Give students a choice. Let them do their own research and figure out what is
best for them and offer more than one option for an intro to programming
class.

------
linuxftw
Computer courses are no different than any other course. What's the first
semester requirement for math? You can graduate high school without taking
advanced mathematics, it doesn't mean you're prepared for college-level math
in the CS field.

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.

------
styfle
I beleive UCI switched to using Python for most CS courses. Previously they
were using Java and I’m sure C++ prior to that.

------
blackflame7000
You can build anything with C++ and Javascript. And now with web assembly, C++
can literally do it all.

------
leitasat
Can't wait for the driving lessons in a self-driving car

------
rootedbox
I think pascal gets you the best of both worlds.

------
grigjd3
There is a lot that is factually wrong with this article. Python is not easier
because it is an interpreted language. C++ is interpreted too. In fact, python
does compile, hence the pyc files. I could go on like this for a while but the
point is, the author doesn't know what he or she is talking about. That
doesn't mean python shouldn't be used, but that this article fails to make the
argument.

~~~
tathougies
C++ is interpreted?

