ArticleslgStudy

science

SNAP (programming language)

SNAP (programming language) is a 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, short for Stylized, Natural, and Procedural, is an educational programming language designed by Michael Barnett while working at RCA in 1968 and later used at Columbia University to teach programming in the humanities. It is an imperative programming language, like many languages of the 1960s, but was deliberately verbose, attempting to look more like conversational English in the fashion of HyperText and late…

Key takeaways

  • SNAP (programming language) belongs to 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, short for Stylized, Natural, and Procedural, is an educational programming language designed by Michael Barnett while working at RCA in 1968 and later used at Columbia University to teach programming in the humanities. It is an imperative programming language, like many languages of the 1960s, but was deliberately verbose, attempting to look more like conversational English in the fashion of HyperText and later languages. Unlike other educational languages of the era, SNAP was not intended to be interactive and was designed to be programmed via punch cards. To save cards, multiple period-separated statements could be written on every card, so the resulting code often looked like a single paragraph.

History In 1964, Michael Barnett joined RCA's newly-formed Graphic Systems Division which had been formed to commercialize the photo-typesetting technology they had licensed from Rudolf Hell. Originally known as Digiset, RCA sold the systems under the name Videocomp. About 50 Videocomp systems were sold over its history. In 1964 and 1965, Barnett developed a page description language known as PAGE-1 to write programs that resulted in Videocomp output, similar to the way the later PostScript language produces pages on laser printers. One of the early applications of this system was to publish Social Sciences Index by the H. W. Wilson Company. This led to Barnett's interest in the social sciences and his increasing interactions with H. W. Wilson and Columbia University's humanities department. Barnett took a position at H. W. Wilson in 1969. He had also started to teach courses on library automation at the Columbia School of Library Service, and in 1970, computer programming in the humanities. He joined the Columbia faculty full-time in 1975. The first version of SNAP was written by William Ruhsam of RCA in FORTRAN IV for the RCA Spectra 70, although a version for the IBM 360 in OS-360 was also produced. some time in 1967 or 1968. The language generated a fair amount of comment, especially in the early 1970s, but appears to have had little direct influence on later languages.

Description

General concepts SNAP allowed multiple statements to be placed on a single line, and used the period as the statement separator. This produced code that looked like English sentences, and was generally organized into blocks that looked like paragraphs. SNAP did not use line numbers for editing, and instead used in-code labels for branch targets, as was the case in FORTRAN. In SNAP, a label could be placed anywhere in the code by surrounding the textual name in parentheses like (FIRST LABEL). Labels were not separate statements, and did not require a period after them. Variables names could contain spaces, which is relatively rare for programming languages even today. Variables could hold strings or numbers, but different syntax was used to assign each one. For numbers, a simple syntax was used, SET I TO 1. SET was also used to perform mathematical operations, like SET I TO THE PRODUCT OF 10 AND J. A simpler syntax was offered for the more common increment and decrement operations, INCREASE M BY 1. or DECREASE M BY 2. For strings, a longer syntax was typically used, CALL "THIS IS A STRING" THE NEWSTRING. Substrings were accessed using a HyperTalk-like syntax by referring to the ordinal position, for instance, CALL THE J-TH CHARACTER OF NEWSTRING THE NEWCHAR., or CALL THE M-TH THROUGH N-TH CHARACTERS OF THE INPUT THE OUTPUT. SNAP also offered array-like collections known as "lists". Internally, these were stored as comma-delimited strings. Most of the string-related commands could be used to work with these by adding THE ... LIST. to the end. For instance, one could read a series of cards using READ THE CARD LIST., which would read each card as a separate string into the CARD variable. Items within a list were accessed using the same ordinal syntax, for instance PRINT THE 5-TH CARD, or COPY "NEW STRING" AND CALL IT THE 7-TH CARD. Lists of numbers could be created using SET THE NUMBER LIST TO 1,2,3,4,5. String variables can also be used as lists, or arrays. This was accomplished using the same ordinal position syntax but referring to the variable name and not the CHARACTER. For instance, CALL "HELLO" THE 1-ST PART. CALL "WORLD" THE 2-ND PART. would create an array called PART with two strings in it. An important point of the SNAP system is that the CALL statement is not static; it does not define KEY as the character at location J when it is encountered in the code, but when any following code accesses KEY. For instance, SET J TO 1. PRINT KEY. INCREASE J BY 1. PRINT KEY. would result in two different strings being printed. In this fashion, CALL has more in common with the BASIC programming language's DEF FN user-defined functions than it does with the SET statement, which is static. A static copy of a string could be made by COPY OLDSTRING, AND CALL IT NEWSTRING. Other string functions included APPEND one string TO another string., OVERWRITE string-expression ON THE M-TH [AND SUBSEQUENT] CHARACTER[S] OF string-name., DELETE THE M-TH [THROUGH N-TH] CHARACTER[S] OF string-name. and INSERT string-expression (BEFORE|AFTER) THE M-TH CHARACTER OF string-name. Unconditional branches were called using CONTINUE, for instance, CONTINUE WITH THE FIRST LABEL. There was also the alternative form REPEAT THE FIRST LABEL.. There was no difference between them, although the context of the surrounding code generally meant one form or the other was more natural to read. One could also refer to the start of the program with CONTINUE FROM THE BEGINNING. "As follows" could be used to refer to the next statement, CONTINUE AS FOLLOWS., which could be used to clarify branches. Conditional branches used an if–then(–else) structure:

As in most languages, the OTHERWISE section was optional. Note the use of AND to make a compound statement within the then section, offering a block structure. For string comparisons, one used IS or the optional IS THE SAME AS. SNAP included a number of other keywords that had no behaviour of their own that were added simply for syntactic sugar. Among them were THE, A, FROM which the programmer could add in many locations to make the syntax more readable. Typical uses included READ A RECORD and REPEAT FROM THE LOOP START.

… excerpt ends here. Continue reading the full article.

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 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 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 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.

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, short for Stylized, Natural, and Procedural, is an educational programming language designed by Michael Barnett while working at RCA in 1968 and later used at Columbia University to teach programming in the humanities. It is an imperative programming language, like many languages of the 1960s…

Why does SNAP (programming language) matter?

Because it connects several 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

  • Educational programming languages

Keep exploring