Teaching Robotics with PropGCC and SimpleIDE
Phil Pilgrim (PhiPi)
Posts: 23,514
In another thread I mentioned my experiences and preferences for teaching robotics with the ActivityBot and shared my criticism of GCC as the vehicle for doing that. It spawned a discussion that was off-topic for the thread in which it occurred, so I'm moving the relevant posts here.
-Phil
____________________________________
As some of you know by now, I'm teaching a once-a-week class with the ActivityBot using GCC and SimpleIDE. Despite the excellent curricular materials on learn.parallax.com, I feel very strongly that the students would be much further along in both general programming skills and robotics concepts if the curriculum had been designed around Spin with the Propeller Tool instead of C. But this isn't the thread for language comparisons, and I don't want to take it further OT with my comments.
BTW, Heater, I would never want to program the Prop in Perl. Sheesh!
Rick, any effort to cast light in the shadows is to be encouraged. I wish you success in your endeavor.
-Phil
-Phil
____________________________________
me wrote:I was rather hoping [PropGCC] would die eventually under the weight of its own archaic complexity.
Wow. I seem to have struck some raw nerves with my attempt at humor. 'Sorry about that!David Betz: "Not funny." mindrobots: "ouch!" Heater: "Outrageous. A bit rich coming from a Perl monger."
As some of you know by now, I'm teaching a once-a-week class with the ActivityBot using GCC and SimpleIDE. Despite the excellent curricular materials on learn.parallax.com, I feel very strongly that the students would be much further along in both general programming skills and robotics concepts if the curriculum had been designed around Spin with the Propeller Tool instead of C. But this isn't the thread for language comparisons, and I don't want to take it further OT with my comments.
BTW, Heater, I would never want to program the Prop in Perl. Sheesh!
Rick, any effort to cast light in the shadows is to be encouraged. I wish you success in your endeavor.
-Phil
Comments
There is a reason us young teenagers were introduced to the concepts of programming by means of BASIC. That's BASIC on a mainframe by the way not a C64.
Such a system removes all the cruft and unintelligible boiler plate gibberish and gets you straight into what you want to do at the moment.
The Prop and Spin and the Prop Tool have this property.
The Arduino and it's IDE also has it.
SimpleIDE and propgcc, as much as I love them, do not have that.
As for SimpleIDE, one unnecessary speedbump is the lack of automatic Prop detection on the various available serial ports (
When you want to teach somebody what programming is all about you might want to start with the idea that programs can do simple calculations. A good start would be: Of course in C you cannot do that you have to write: You have lost your audience after the first three lines. Oh and there is a semicolon missing so it all fails even if they are persistent anyway.
But it gets worse. You can't just type that in and have it produce a result. Oh no, you need a "project" and mess with directories, why for god sake? By this time your audience is back to playing Agree Birds.
I'm sure us guys who have been immersed in this soup of weird symbols and syntax for years cannot see how blinding it is to a beginner.
To help with C's arcane syntactical and semantic requirements, there are some new 'Smarter Editors' showing in some IDEs.
This effectively adds a simple C parser into the editor, and it gives yellow alerts in the Left editor column.
examples : I delete a trailing semi-colon, the hover on the yellow [?] that appears, says "missing semicolon"
If I edit to this
if (VarName = 0)
the yellow alert now says "possible assignment in condition (VarName = 0)", fixing as if (VarName == 0) removes alert.
If I remove or add a {, or ), it says 'Syntax error', and a cursor after any {} (), highlights the matching brace.
All of this greatly helps novices, whilst not strictly fixing the arcane syntactical and semantic requirements, it makes them more tolerable.
-Phil
-Phil
First time I heard "attention to detail" was in boot camp. It suited me just fine. It's the way the world should be. I think most people do not care about attention to detail, the lack of it's practice is evident everywhere - commercials, movies, driving habits, product manuals, dentistry... you name it. It should be taught in schools, and I guess it is sometimes alongside things like math but we would do well to have it be its own subject. If everyone learned "attention to detail" all our lives would be much different than they are today - movies would be better for one thing...
Attention to detail is required in all programming, it is required in Spin too.
I often give my beginning physics students program templates that already include the burdensome details so that they can focus on isolated sections of code, for example a loop structure or a series of physics equations. After they experience the satisfaction of a working program, they are more interested in learning the details. It is like fishing, first you need an attractive lure to get their attention.
What is the age group for this class?
Can some form of LINT functionality be added to SimpleIDE?
Comments:
Attention to detail is important, however you have to understand the details before you can pay attention to them.
Since the educators in this case and many others want 'C' this needs to be about how to best teach 'C' not to throw rocks at it. In other words "it is what it is", so how do we best deal with it.
A road block has been identified with the issue of the "build failed" error in SimpleIDE when the real issue is the prop is not on the expected port. Can this be easily fixed?
C.W.
Which details?
At the point you start off attempting to kindle some curiosity and enthusiasm for programming to a rank beginner, who may be 10 years old or 60, The details you want them to focus on might be:
a = 3 + 2
Anything else is a confusing mind-numbing diversion. Trees in front of the forest. Information overload. That will kill that curiosity and enthusiasm stone dead in seconds.
Attention to detail is important. Especially so in mathematics for example but there we start with 1,2,3...Not differential calculus.
Jazzed has forgotten he was ever ignorant of such things.
David, Python would be a good example. Very easy to kick off with but a very powerful languages used by experts.
JavaScript would be another.
See Espruino and MicroPython projects.
Then there is node.js. Just type "node" at the command line and start talking to it.
And the Espruino of course.
Spin makes things a lot easier than C for that quick start I believe. What with removing the need for so many brackets and braces and the lack of header files. Also typing into the PropTool or similar and hitting "run" is pretty quick interaction.
C is out because it's too much for rank beginners.
One of us had better get down to getting MicroPython or JS running. I imagine only on the P2 though.
On the other hand the Aduino has demonstrated that rank beginners can get on very well with C++ if you hide the grungy boiler plate of headers, main() etc. And carefully don't mention all the shitty parts of the language in the tutorials. Oh, and don't even tell them it is C++!
Apple's XCode editor 'sees' simple editing issues dependent on the source language you are editing and recommends a fix. Actually, it offers to fix the problem for you. Something like that would really help new coders to learn those "nitty" details of more complex or should I say, "picky" languages (C, C++, Objective-C, C#, JavaScript, etc.).
Here's what XCode came up with when I left off the semicolon at the end of a statement:
Personally, I really liked Spin when I came over to the Propeller from Arduino and Desktop App development. The language was simple and hard rules like indenting to create code blocks actually helped in writing code that is easy to read. I think back to my days of learning BASIC and I remember having to force myself to use lots of REM statements to document just so I would understand it at a later date.
An IDE like an updated SimpleIDE that is built for Spin and C development (who knows, maybe another language once Prop II is out) and has features that allow new users as well as experienced users to get the most from their programming time, would be excellent.
Phil mentioned that SimpleIDE's Project view got in the way of new students learning. Well, SimpleIDE offers a "Simple View" that hides all the details of projects. Enhancing Simple View to provide more 'helps' for new coders, some templates for Spin and C, could give an experience similar to Arduino's IDE. I personally, find the Arduino IDE less than helpful while writing code, but it has gotten lots of non-technical types and young people writing code.
Why not just make a list of features for an enhanced SimpeIDE? Then, Parallax may sanction that as a future direction (if they have not already done so ).
dgately
Back to braces, one thing I've noticed is that the kids are very sloppy with indentation and brace placement.* I let them get by with it, too, since there's so little time in one class period to get any real work done that style becomes a less than tertiary concern. With a language like Spin or Python, though, style is enforced as part of the syntax, which I see as a distinct advantage.
-Phil
* To be honest, the example code in learn.parallax.com uses a brace style that's contrary to what I'm used to in Perl. I like the opening brace on the same line as its antecedent, and compact constructs like } else {. So I'm reluctant to tell the kids that one style is better than another, since it's pretty much a matter of taste. Besides, they're writing short, throw-away programs that don't last longer than one class period. -P.
It's a nice approach, same the with the Arduino and it's variants(Enegeria and Pinguino).