Hacker News new | past | comments | ask | show | jobs | submit login

> We start teaching with a simplified language called "karel" ... It's just a few commands and a dog.

Off topic, but curious: why does the language have semi-colons?




Because it's Java.

Also, significant whitespace is a pain in the ass.


It seems to be JavaScript, not Java.

Semi-colons are great for real programming. They help deal with ambiguity when you want to split something over several lines yadda yadda let's not have the debate here.

But I don't see it's utility in something like this. It becomes one of those "just because" answers if someone asks why you need to put a semi-colon at the end of the line.

I could understand it if it was pitched at an "almost ready to write real code", but from what I've seen, and looking over the chapter headings, that doesn't seem to be the case.

I guess really I'm trying to look at the balance between using a DSL in a real language and using a toy DSL with a simple syntax when introducing basic concepts and shaping how people think about problems.

I use "real" to mean anything written outside of the CodeHS playpen.


It looks like there are many, many implementations of Karel the Robot.

I first saw Karel watching the Engineering Anywhere CS106a videos provided by Stanford. That course was in Java but used Karel at the beginning to get students used to writing programs, in this case instructions to the robot. If things like why ; and what is this `public void` had to be introduced before the groundwork for understanding what they were doing, it was done with a 'do this and we'll be able to explain why shortly.' Which to me, is a perfectly valid way of introducing things.

Because the Karel implementation there was Java, controlling the robot was just Java. You learned Java syntax as you played in the sandbox. You used that syntax as you moved out of the sandbox.

FYI the semi-colon at then end of the lines, if I remember correctly, was explained with this is how you tell the computer in this language we're done with a statement. No different then us using periods in English at the end of a sentence, its just the rules of this language.

As an aside, I really liked the Stanford CS106a course videos. I think the instructor did a very good job introducing Java and programing in general.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: