ArticleslgStudy

computer science

Snap! (programming language)

Snap! (programming language) is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Snap! (programming language) rather than just read about it. In short: Snap! (formerly Build Your Own Blocks) is a free block-based educational graphical programming language and online community.

Snap! (programming language) — main illustration
Snap! (programming language) — illustration

Key takeaways

  • Snap! (programming language) belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Snap! (programming language) to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Snap! (programming language) from memory before moving on to harder problems.

Reference excerpt

Snap! (formerly Build Your Own Blocks) is a free block-based educational graphical programming language and online community. Snap allows students to explore, create, and remix interactive animations, games, stories, and more, while learning about mathematical and computational ideas. The Snap! editor, and programs created in it, are web applications that run in the browser without requiring installation. It is built on top of Morphic.js, a Morphic GUI, written by Jens Mönig as 'middle layer' between Snap! itself and 'bare' JavaScript.

User interface In Snap!, the screen is organized in three resizable columns containing five regions: the block group selector (top of left column), the blocks palette (left column), the main area (middle column), and the stage area (top of right column) with the sprite selector (also called the sprite corral) showing sprite thumbnails below it. In the interactively resizable stage area are shown the graphical results of the scripts running in the script area and/or interactively double-clicked individual blocks in any palette. Individual blocks can be dragged from the palette onto the scripts area to be associated with the selected sprite.

Snap!'s blocks are divided into eight groups: Motion, Looks, Sound, Pen, Control, Sensing, Operators, and Variables. The layout of these groups in the block group selector is shown in the table below. The central area can show scripts, costumes/backdrops, or sounds associated with the selected sprite. What that area shows depends on the selected tab.

Metaprogramming, reflection, and macros

Mascot

Alonzo, the mascot of Snap!, is a modified version of Gobo from Scratch, with permission from the Scratch Team. He is named after Alonzo Church, the inventor of lambda calculus, and his hair is based on the Greek letter lambda.

Special-purpose blocks (libraries)

Extended sets of blocks can be found in Snap! libraries, such as the 'streams' library that enables one to make the complete, infinite Fibonacci sequence, for example, using the special blocks ('stream', 'show stream', 'tail of stream', and 'map ( ) over stream' block) from the library. Many other libraries are available, such as the 'list utilities' library, the 'words, sentences' library, the 'iterations' library, the 'animation' library, the 'frequency distribution' library, the 'audio computation' library, the 'bar charts' library, the 'world map' library, the 'colors and crayons' library, the 'strings and multi-line input' library, the 'parallelization' library, etc. for other special purposes.

Limitations Limitations include:

No native cloud variables (can be created using extensions) 10 megabyte file cap for uploading (Snap! Cloud only) The Javascript block is opt-in, and can only be run in the editor.

History The web-based Snap! and older desktop-based BYOB were both developed by Jens Mönig for Windows, OS X and Linux with design ideas and documentation provided by Brian Harvey from University of California, Berkeley and have been used to teach "The Beauty and Joy of Computing" introductory course in computer science (CS) for non-CS-major students. Jens was a member of the Scratch Team before creating Snap!. BYOB is still available for downloading.

License The source code of Snap! is released under the GNU Affero General Public License version 3 (AGPLv3) license and is hosted on GitHub. The earlier, desktop-based 3.x version's code is available under a license that allows modification for only non-commercial uses and can be downloaded from the UC Berkeley website or CNET's download.com and TechTracker download page.

Platforms

Snap! runs on the major web-browsers on Windows, iOS, MacOS and Linux devices. Supported web-browsers include:

Firefox Chrome (and most Chromium based browsers) Opera GX Microsoft Edge Safari

Implementation Snap! is built on top of Morphic.js, a Morphic GUI, which serves as 'middle layer' between Snap! itself and 'bare' JavaScript. It uses an HTML5 Canvas application programming interface (API). All things visible in Snap! are morphs themselves, i.e. all buttons, sliders, dialog boxes, menus, entry fields, text rendering, blinking cursors etc. are created with morphic.js rather than using HTML DOM elements. Snap! caches the shapes of sprites so the sprite doesn't have to be re-drawn onto a new Canvas element every time the mouse moves over its bounding box. It does not cache blocks, however. Instead it manages the insides of C-shaped blocks through the morphic "holes" mechanism. All user interaction is triggered by events, which are passed on from the root element "the world" to its submorphs. Dropping a morph causes it to become embedded in a new 'owner' ('parent') morph. In Morphic the preferred way to run an animation is to register it with the World by adding it to the World's animation queue. The World steps each registered animation once per display cycle independently of the Morphic stepping mechanism.

Recognition Snap! has been recognized by the Logo Foundation, and reviewed in an online magazine for programmers. As of December 2014, 100 New York City (NYC) high schools introduced University of California, Berkeley's “Beauty and Joy of Computing” as a new AP Computer Science Principles course, using Snap!. Jens and Brian received the National Technology Leadership Summit (NTLS) 2020 Educational Leadership Award for lifetime achievement based in part on Snap!.

Notes

References

External links Official website

Illustrations

Snap! (programming language) illustration
Snap! (programming language): Three resizable columns, containing five regions, in Snap!'s IDE at startup
Three resizable columns, containing five regions, in Snap!'s IDE at startup
Snap! (programming language) illustration

Worked examples

Example 1 — a first encounter with Snap! (programming language)

Start with the simplest possible case. Write down what Snap! (programming language) claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Snap! (programming language) before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Snap! (programming language) ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Snap! (programming language)

In research
Snap! (programming language) appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Snap! (programming language) in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Snap! (programming language) is common in secondary-school and first-year university syllabi. It links to neighbouring topics American children's websites, Block-based visual programming languages, Educational programming languages, so understanding it makes those chapters shorter.
In everyday life
Look for Snap! (programming language) outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Snap! (programming language)” →

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Snap! (programming language) in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Snap! (programming language) means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Snap! (programming language) out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Snap! (programming language) in simple terms?

Snap! (formerly Build Your Own Blocks) is a free block-based educational graphical programming language and online community.

Why does Snap! (programming language) matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Snap! (programming language)?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Snap! (programming language).

Tags

  • American children's websites
  • Block-based visual programming languages
  • Educational programming languages
  • Free educational software
  • Pedagogic integrated development environments
  • Smalltalk programming language family
  • Software developer communities
  • Video game IDE
  • Video game development software

Keep exploring