I'm a little curious about some of the style choices in python code. For example:
# used by Sebastian
for k in range(len(measurements)):
p = sense(p, measurements[k])
vs
# shorter, saner, and more Pythonic
for m in measurements:
p = sense(p, m)
I guess the old aphorism applies: a good Pascal programmer can write Pascal in any language. (Not to criticize Sebastian's programming ability, only to wonder about the pedagogical choice.)
I also thought that was odd, and used the latter version in the first few exercises. But later there was some code of the form:
def move(p, U):
q = []
for i in range(len(p)):
s = pExact * p[(i-U) % len(p)]
s = s + pOvershoot * p[(i-U-1) % len(p)]
s = s + pUndershoot * p[(i-U+1) % len(p)]
q.append(s)
return q
where the index is used to access the previous and next elements in a list.
There's a more idiomatic way to get this index variable(http://stackoverflow.com/questions/522563/accessing-the-inde...), but using a consistent, easy to understand iteration method allows the poor confused student (i.e. me) to spend more time focusing on the concept being taught.
So the code could be intentional, or could be an accident. But I expect that sooner rather than later there will be some data to show which method, if any, is better for the students, and the classes will be adjusted accordingly.
By the way, did anyone else find these exercises addictive? I can begin to appreciate why the Farmville cow-clickers keep at it.
since i'm a target audience for this course (non-technical person aspiring to learn how to code), how would i learn proper programmer convention (ie the Python way) vs. the computer scientist convention?
The first observation is that there is no computer scientist convention, only a heterogeneous collection of bad habits. :) Again, unlike this post's uncle and grandparent, I'm unwilling to assume that Sebastian is a bad coder in general, but this particular code is unPythonic. Maybe that's because he's a bad coder, maybe that's because he had teaching goals that I don't fully understand.
I am aware of two reasonable answers to the "how do I learn idiomatic style" question (in any language, although Python is the only language in which I personally have deliberately sought a better accent).
1) Read great codebases. For Python, the #1 target here is probably the standard library. People also often mention high-profile projects like Django or Twisted; since I haven't tried that I don't know what percentage of that code is beautiful, but I'm guessing it's probably a mix (so you'd have to apply some judgement).
2) The path I have taken is to read a lot of blogs and Stack Overflow questions and so on. Consider this:
http://stackoverflow.com/search?q=pythonic
In particular, answers by Alex Martelli are reliably very informative (even if I find his prose style a little sub-optimal).
3) Oh, and this is a bit abstract, but if you haven't typed 'import this' into your Python interpreter, you should do that, for some guidance about the abstract ethics of "being Pythonic".
The version used by Sebastian targets a wider audience who are not familiar with the pythonic idioms and have just skimmed a bit of python to do the course. Using a loop over array index is the way many students iterate over an array. This should not reflect on Sebastian's coding ability.
Which makes it easier to translate into typical procedural languages like c and c++, which is not completely irrational to assume for embedded systems like robotics. And because many tricks and concepts will be array-index-based, you can just go ahead and use them right from the start.
I agree that simplicity of learning is a good goal. This is why I didn't raise the issue of the several dozen times where he uses an very ugly for loop where a very nice list comprehension would be the Pythonic thing to do. Being Pythonic is not the highest goal in software, I get that, and if you're trying to focus on learning robotics rather than learning Python, list comprehensions add friction.
But in the case of iteration across a list, using an idiomatic iterator is far from unique to python, and it's very readable to someone who has never seen it.
And I thought about the C/C++ thing, but the reason I said "Pascal programmer" rather than "C programmer" is because surely no-one trying to ease the translation to C would have used all those list.append() calls with which Sebastian is so liberal.
Honestly, the class, "Programming a Robotic Car" sounded pretty lame. When am I going to program a robotic car? Never. As cool as it sounds in principle, I figured it would be pretty domain-specific and relevant only if you were doing autonomous robotics.
However, I must say that the syllabus looks amazing, and pretty hardcore. It appears to have less to do with robotic cars per se and more to do with applied controls and online machine learning. Particle filters? Kalman filters? Extracting signals from noisy sensor data? Shallow planning and search? In a way that's made applicable and not presented as just a series of proofs and theorems?
Honestly, the class, "Programming a Robotic Car" sounded pretty lame. When am I going to program a robotic car? Never.
Programming is not brick-laying. "Learning to program" is about learning to think and solve all kinds of problems, not learning now to do one specific thing that you are going to do for a job. You become a good programmer by learning about and solving all kinds of problems.
Programming a robotic car sounds incredibly awesome to me; hardly "lame", even though I never intend to work in robotics. In college, I took courses like "Filesystems" (no, I don't intend to write a filesystem), "Operating Systems" (no, I don't intend to be a Linux kernel dev), and so forth. Just because that's not what I'm doing doesn't make them interesting, useful, and fun.
A programmer who has only solved a very narrow range of problems -- and considers others s/he's not too familiar with to be "lame" -- is generally not a very good programmer.
I mean, I agree with you in principle. I think programming a robotic car would be really cool. There's a difference between a foundation (FS, OS, algorithms, etc) and lots of random specialist exposures, though.
I consider myself a generally good programmer. I've been doing it since I was ~6-7, so 15 years now, five of them professionally. I've solved problems in dozens of domains, using probably 20 languages in every major paradigm. But my background is in life sciences, and I've been increasingly feeling like checking out every "cool" technology for the consumption value is a great way to end up a dabbler. It's a little bit of a false dichotomoy, but not entirely. How does this matter to me? is a good first-order heuristic when you're already working 80 hours a week.
That said, I do know the fun of diving into things that seem interesting without necessarily having an immediate application -- I learned most of my languages and technologies that way -- but for some reason, "Programming a Robotic Car" I guess just didn't seem intrinsically interesting as stated. Maybe "I'm never going to use this" is the wrong rationalization for that reaction.
I'm pretty sure "programming a robotic car" involves solving all sorts of problems, not merely ones related to the fact that it is a car, and it is robotic.
Even in ordinary college CS, you're almost always faced with very specific assignments, like "write a memory allocator" or "write a search algorithm to help the cat find the mouse in this maze". The intent is to teach you a wide range of ideas and techniques; the specific goal of the task isn't really what's important.
Yeah, that's what I'm saying. The title made me think it would be specialist coverage, but it's actually widely-applicable tools just taught in the context of robotic cars. I'm pretty sure you could teach such a class either way.
The "Robotic Car" is nothing else but a way of attracting people to the course. Reading the contents of the course, we could easily substitute "Programming a Robotic Car" by "Artificial Intelligence for Robotics". I would like to see a bit more of Theory of Control on the topics but I guess it requires advanced Algebra.
Every time that I read about technology I feel like we have to realize that every time more generalists will be needed. Mechanics, dynamics, control, computer vision, energy, fluids, signal processing, artificial intelligence, statistics are some of the skills needed for a real Robotic Car, and of course, nobody can expect to learn them in 7 weeks.
My guess would be that the title of the class was aimed at students of ai-class.org, in which he touched on several of the topics you mention in the context of his work in automated driving. When I saw the title of the course it immediately struct me that this would be a deeper look into all the cool things he pointed out in ai-class.
I'm on my Junior year in CS major and I think I will take CS101 on Udacity. Not only do I think Udacity can do a better job than my college, but I think I can learn new things.
Key point here is that although the courses sound potentially advanced, they seem targeted towards people who are beginners at programming/computer science. I'm not entirely sure if this is stressed enough on the site.
However I'm also curious what the later units will look like, as I completed the final quiz in a few minutes for the first search engine unit without watching any lectures and without any python knowledge. Very basic stuff.
Having done the AI class last year, I have to say that I'm really positively surprised how much they apparently learned from the results of that class. Sebastian's style is way better now, with those digital scribbles and the combined programming step by step exercises for particle filters. That was exactly the stuff that threw me off sometimes at AI class (and I bet quite a few of others).
I only looked over the 101 course, and maybe it's not aimed at someone who already has an understanding of those concepts, but I felt like it was a really fast fly-by of topics and skipped a lot of things.
Thinking of the best way to teach this stuff is something I spend a bit of time doing, and honestly I'm not sure what the right approach is. Once I thought you should learn from Ada's work and the looms all the way up to things like the Enigma machine, and jump into the things that started happening in the 50s research. Basically, grow your knowledge from the ground up and make all the same discoveries.
The other approach is to take a high-level fly by of concepts like strings. Most of us here on HN know that strings and how they work aren't as simple as presented in the 101 videos and there's so much more to know about them.
I'm concerned that this style of teaching (implementing concepts without understanding how they work) is also the style that's lead to a lot of confusion in my personal learning experience as I progressed. Once upon a time everything in the browser like HTTP and rendering was magic and I wrote sloppy web apps. In a similar vein, I never really "got" calculus until I read a book that explained the history of how Newton made up "infinitesimals", Leibniz made up "derivatives" and someone else made up limits. I had no idea how calculus worked until I understood the origins... sure I could write differential equations based on some cheat-sheet, but that deep-rooted understanding never came along until I walked through Newton's shoes. And to be honest, it was simply the dy/dx notation that made no sense to me, and none of my teachers could explain it to me, it was always "oh, that's the derivative of that axis value" (might as well have said "oh, a monad is a monoid in the category of endofunctors").
On the other hand, learning and doing things without that deep understanding is exactly how I started programming and I turned out okay.
For those wondering, the first week's worth of videos/tutorials is live and watchable if you sign up (i.e. it's not a dead end like most Coursera courses currently). The quiz interface (being inlined with the video content), is quite clever.
The tech for online learning is still being developed.so the courses offered are those close to the developers'interests and competencies, much like how the internet was first used for and by scientists. But the tech will spread.
Uh, I'm a developer and I work with a bunch of developers. Trust me, programming is not our numero uno interest in life. :-)
Judging from our office discussions, the most popular courses would have to be on picking up chicks, making moonshine, and all sorts of crazy money-making schemes.
I'd love to see something like this for math. A lot of these ML, AI courses have prerequisites in math that is pretty distant for me.
I know Khan is highly praised, and I have found help there, but I find the site very unstructured. Perhaps it works best when you have an existing syllabus or path to follow next to it.
Python is really fairly easy. You shouldn't have much trouble with it unless you are a beginner in programming in general. Even then it should still be possible with a little extra work.
The course contents doesn't open on a android tablet. It says loading... for sometime, and it just stops after that. I tried with stock browser and Dolphin browser and both have the same issue.