10
$\begingroup$

This question is specific for teachers of the United States College Board's AP Computer Science Principles class.

I'm looking for a block based programming language that allows for:

  • Procedures that return values
  • For each that will iterate through lists

In addition, we are to teach basic 2D robot programming with commands such as TURN_AROUND(), MOVE(), TURN_RIGHT() etc.

My research has come up with MIT's Scratch IDE; but I was wondering if there is a better choice for high school students.

$\endgroup$
  • $\begingroup$ There is no such thing as a procedure that returns something. Procedures are subroutines that do something. A function is a subroutine that has no side effects and returns something. (except that they do not need to be implemented with subroutines, it is the behaviour that matters.) Though these terms are often mixed up, and I know of no language that 100% enforces the separation (command/query separation). $\endgroup$ – ctrl-alt-delor Jun 15 '17 at 18:01
  • $\begingroup$ @richard A pure function has no side effects. Most (all?) non-functional programming languages don't enforce purity of functions, so you'll find plenty that have side effects (but still return stuff). $\endgroup$ – JAB Jun 15 '17 at 18:17
  • $\begingroup$ Though Scratch might seem a little juvenile for high school students, if you can overcome the students' initial distaste for something that appears to be tailored towards younger children, Scratch can truly be a powerful tool to teach. I've seen Scratch successfully illustrate complicated concepts in CS principles on multiple occasions. $\endgroup$ – Sam Weaver Jun 15 '17 at 21:03
  • $\begingroup$ @jab yes “I know of no language that 100% enforces the separation” $\endgroup$ – ctrl-alt-delor Jun 15 '17 at 21:27
11
$\begingroup$

You will probably want to look into Snap!. It was built upon Scratch and would probably meet your needs. This is from its About page:

Snap! (formerly BYOB) is a visual, drag-and-drop programming language. It is an extended reimplementation of Scratch (a project of the Lifelong Kindergarten Group at the MIT Media Lab) that allows you to Build Your Own Blocks. It also features first class lists, first class procedures, and continuations. These added capabilities make it suitable for a serious introduction to computer science for high school or college students.

Additionally, I asked a question a few weeks ago about the differences between Scratch and Snap!. You might find this discussion helpful: "What can Snap! do that Scratch cannot?"

Edit: In the context of AP CS Principles, it may also be helpful to know there is a full curriculum available from Berkeley that utilizes Snap!. It is called The Beauty and Joy of Computing.

$\endgroup$
  • 3
    $\begingroup$ yes snap. I have heard that it is used to teach first your undergrad. It certainly seems to have all the features needed. Even lambdas. If is a proper functional programming language (like lisp). $\endgroup$ – ctrl-alt-delor Jun 15 '17 at 17:57
  • $\begingroup$ There is also Blockly, but I haven't used it before, so I can't vouch for it. $\endgroup$ – Peter Jun 15 '17 at 18:07
  • $\begingroup$ @Peter Blockly (which I worked on) is really an editor, not a language. Languages can be built on top of it, as App Inventor is. $\endgroup$ – Ellen Spertus Jun 20 '17 at 23:14
2
$\begingroup$

Not strictly block based, but I like Codesters as a nice midway point. It has a DnD interface but the blocks you drop become Python code.

$\endgroup$
2
$\begingroup$

Code.org has a CS Principles curriculum available for free, and I think this would meet your needs. https://studio.code.org/courses/csp

I've never used it with a class, but it starts with an implementation of blockly (https://developers.google.com/blockly/) and transitions to Javascript in Units 3 and 5. It also allows students to create apps, using AppLab. It starts with a turtle and moves through to user interfaces and beyond.

$\endgroup$
2
$\begingroup$

While I definitely recommend Snap!, for completeness sake you might take a look at:

  • Scratch -- though w/o custom functions this may be limiting
  • PencilCode -- a blocks+text environment around CoffeeScript
  • GP (gpblocks.org) -- a desktop environment that looks similar to Scratch/Snap! But has dozens more blocks as well as a very interesting model for exploring classes and inheritance.
  • AppInventor -- using blocks to build Android apps.

For me, Snap! strikes a good middle ground between freedom and complexity.

$\endgroup$
  • $\begingroup$ Welcome to Computer Science Educators! This answer could really benefit from explanations on why Snap! might be a good option. $\endgroup$ – ItamarG3 Aug 9 '17 at 7:57
  • $\begingroup$ Also, feel free to come by The Classroom and say hi. That's where we all tend to hang out. ;-) $\endgroup$ – Ben I. Aug 9 '17 at 15:09
1
$\begingroup$

On CodeHS we have a block-to-text based programming environment and a full curriculum for AP CS Principles that you can use for JavaScript. It has a unit to teach JavaScript, including functions and lists among other topics, and also starts with a unit on Karel the Dog. Karel the Dog is a JavaScript implementation of the Karel programming language, which is very similar to the style of problems on the AP CSP exam. Karel knows the commands

move(); putBall(); takeBall(); turnLeft(); and later turnAround();

Essentially it is the same as 2D robot programming but with a dog instead of a robot, which is a bit friendlier.

You can use this with blocks or text - it's just in JavaScript, and you or students can also easily build their own worlds. Hope that helps!

$\endgroup$
0
$\begingroup$

StarLogo Nova is another MIT project. It's block based like scratch, but I personally find it much nicer to use, and it allows (I think) for more complex programs. It is more simulation oriented than scratch, but you can still make just about anything with it. Also, it has a flying turtle for a logo:

enter image description here

It's got a nice setup for classes - each user has a profile with a public and a private gallery. You can add collaborators to projects, set up some form of "class" on the system, though I don't know quite what that entails, etc.

Here's a screenshot of the coding environment with some code for a project I did in it:

enter image description here

On the left, you have a menu with the different coding blocks, the drop down has categories very similar to those in scratch. The tabs on top of the coding section are basically for the different "agents" and for the "world". This program, if you're wondering why there's a "Killers" tab, is to simulate an epidemic. There's support for all sorts of things - procedures that return values, movement of "turtles" which are basically robots on the screen, etc.

Here's a screenshot of the section of the screen that shows the result of your program:

enter image description here

This shows the level of complexity you can get too - you can have output graphs and number boxes, input sliders, etc. You can also keep it very simple - the two things that are pretty much always there are the "setup" and "forever" buttons. This screenshot was taken right after "setup" was pressed - it initialized the turtles, widgets, breeds in the right proportions, etc.

I'd definitely recommend this language.

$\endgroup$
0
$\begingroup$

Python has a turtle graphics module that is quite a bit of fun to play around with. It is simple to use and you can have your students write functions to drive it and to draw custom graphical elements such as stars.

Turtle graphics can be used to make looping visual. You can also add an event-driven element by making your drawing panels mouse-sensitive. The Python site has complete documentation. Tough exercise: Draw an American flag. Easier: Draw a Texas flag; making a five-sided star is a fun puzzle.

You can incorporate this into your class and experiment with it a variety of levels.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.