Answers.Body: <p>Yes. Programming languages that don't have variables still have conditional branching. The paradigm is called "functional programming".</p>
  
  <p>Here is a link to a list of programming languages that support functional programming: <a href="https://en.wikipedia.org/wiki/Category:Functional_languages" rel="nofollow noreferrer">https://en.wikipedia.org/wiki/Category:Functional_languages</a></p>
  
  <p>A list of pure functional languages can be seen at this link: <a href="https://en.wikipedia.org/wiki/List_of_programming_languages_by_type#Functional_languages" rel="nofollow noreferrer">https://en.wikipedia.org/wiki/List_of_programming_languages_by_type#Functional_languages</a></p>
  
  <p>Here is an example functional programming exercise in javascript that I found:
  <a href="https://hackernoon.com/challenge-program-without-variables-javascript-bee89a41455e" rel="nofollow noreferrer">https://hackernoon.com/challenge-program-without-variables-javascript-bee89a41455e</a></p>
  
  <p>Here are some other links of interest:
  <a href="https://stackoverflow.com/questions/1020653/how-can-you-do-anything-useful-without-mutable-state">https://stackoverflow.com/questions/1020653/how-can-you-do-anything-useful-without-mutable-state</a>
  <a href="https://www.cs.ox.ac.uk/geomlab/CAS-article.pdf" rel="nofollow noreferrer">https://www.cs.ox.ac.uk/geomlab/CAS-article.pdf</a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-30T13:17:58.807Z
Answers.Text: So is the dependency (variables or functional)?
Answers.UserDisplayName: ctrl-alt-delor
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-30T03:44:36.673Z
Answers.LastActivityDate: 2017-12-30T03:44:36.673Z
Answers.UserDisplayName: pojo-guy
Answers.Body: <p>This year I managed to present both functions and if-then-else before variables to my (total beginners) students. We're using Processing.</p>
  
  <p>Students are first presented with basic drawing operation (rect, ellipse, fill)</p>
  
  <p>Exercise for Functions : draw a moderately complex picture</p>
  
  <p>Solution (sketch of):</p>
  
  <pre><code> void setup() {
       size(600, 200);
   }
  
   void draw() {
      draw_sky();
      draw_seashore();
      draw_boats();
   }
  </code></pre>
  
  <p>Exercice for if then else : draw a square on the screen, and a circle for the mouse pointer. Circle is red when inside the square, green otherwise. </p>
  
  <p>Well,  mouseX and mouseY are framework variables, actually. We also constants (final), both global and local, so the students get familiar with the notion of scope. A bit later, parameters for functions (drawing the same shape at different places) are introduced. And then, "real" variables representing a user-changeable state (say, last position where a click occured).</p>
  
  <p>A better example, if really dont want the coordinates variables:</p>
  
  <pre><code>void setup()
  {
    size(200,200);
  }
  
  void draw() {
    background(255);
    if (second() % 2 == 0) {
      draw_square();
    }
  }
  
  void draw_square() {
    fill(0);
    rect(50, 50, 100, 100);
  }
  </code></pre>
  
  <p>A more elaborate example is drawing a clock with three needles. Makes a strong motivation to introduce variables for auxiliary computations.</p>
  
  <p>PS: some readers are not familiar with Processing and are too busy to have a look at the documentation, so :</p>
  
  <ul>
  <li>the <code>second()</code> function returns the current second (an int between 0 and 59).</li>
  <li>in a Processing program, the framework calls <code>setup()</code> and then loops around <code>draw()</code>, just like Arduino with setup+loop. Programmer has to provide the draw/setup functions together with functions as responses to events (<code>mousePressed</code>, etc).</li>
  <li>the example shows a blinking square.</li>
  </ul>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-27T15:29:23.950Z
Answers.Text: I don't understand. I nee no selection, or variables in the example.
Answers.UserDisplayName: ctrl-alt-delor
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-27T15:31:20.673Z
Answers.Text: Those are procedures, not functions. And constant variables are (real) variables. Valuables can be mutating or non-mutating (const). In a functional language, all variables are non-mutating. variable ≠ mutating.
Answers.UserDisplayName: ctrl-alt-delor
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-27T17:17:24.930Z
Answers.Text: I would be curious to see a Processing example that uses `if` statements without variables, but `mouseX` and `mouseY` are variables.
Answers.UserDisplayName: Kevin Workman
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-27T20:23:36.937Z
Answers.Text: @ctrl-alt-delor in the Processing documentations, methods are often referred as 'functions". Example https://processing.org/reference/parentheses.html "Parentheses have multiple functions relating to functions and structures. They are used to contain a list of parameters passed to functions and control structures
Answers.UserDisplayName: Michel Billaud
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-29T10:27:05.307Z
Answers.Text: The program you give is impossible to understand, with out a global understanding, and that is missing. This is primarily because of a poor choice of names (yours or the frameworks). E.g. `size` is a noun, so we would expect it to return a value, but it does not. I guess it sets the size (`setSize`). `second` is a noun so should return a second object (what ever that is), but seems to return a number, so maybe it is the second number, but of what. I see no list. For this reason it is not useful. Therefore I will down-vote.
Answers.UserDisplayName: ctrl-alt-delor
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-29T12:10:57.993Z
Answers.Text: I think you are being overly critical here of someone trying to help. The example seems fairly reasonable if you just assume there is a preexisting framework in which the students program. You are being a bit nit-picky on names, and while I agree with the noun-verb concept, not everyone adheres to it so it is unreasonable to expect perfection here.
Answers.UserDisplayName: Buffy
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-29T12:19:47.530Z
Answers.Text: @ctrl-alt-delor understanding a program requires the student a minimum listening to some explanations.  The names are the framework's , except `draw_square()` for which I take full responsability and your down vote for irremediable nebulousness. 
  "list" ? Are you talking about citation of the processing documentation? It explains that parentheses contain a list of parameters, as in `size(600,400)` or `background(255) ` or `second()`. 
  But these considerations are quite out of topic to the question of @KevinWorkman : use of `if` in a program without variables.
Answers.UserDisplayName: Michel Billaud
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-29T12:28:12.647Z
Answers.Text: @buffy no assumption  needed, as the use of the Processing framework was explicitly mentioned. We all have bad hair days.
Answers.UserDisplayName: Michel Billaud
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-29T12:36:41.183Z
Answers.Text: It might be good to discuss this in the classroom: https://chat.stackexchange.com/rooms/59174/the-classroom
Answers.UserDisplayName: Buffy
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-29T15:32:38.070Z
Answers.Text: If some explanation was given, especially around `second()` (as this seems to be the important bit. And does it need an `else` so that `draw` always draws. If you make it clearer, then I could change it to an upvote.
Answers.UserDisplayName: ctrl-alt-delor
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-27T14:30:08.557Z
Answers.LastActivityDate: 2017-12-29T15:49:39.353Z
Answers.LastEditDate: 2017-12-29T15:49:39.353Z
Answers.UserDisplayName: Michel Billaud
Answers.Body: <p>From a practical standpoint, rather than a theoretical one, there are at least two pedagogically defensible ways to do this. Spiral curriculum, and Scaffolding</p>
  
  <h1>Use a Spiral Approach</h1>
  
  <p>I won't assume that you never mention variables early with this approach, but you just don't teach all that needs to be known at the first introduction of variables (or any other topic). To teach like this you mention things that need to be known deeply early on, partly to introduce terminology, but partly to permit simple uses in which deep knowledge isn't needed. Then, for example, variables but without reassignment could be used in setting up some sort of selection or iteration as your lecture focuses on those ideas rather than the variables. At any given point in time students know a little about a few things and a lot about some other things. Then, in the next <em>cycle</em> you go a bit deeper in some topics but also introduce, very lightly, other topics. </p>
  
  <p>The implication is that a student never needs to completely understand any given topic the first time it is presented as it will be seen again. Everything is reviewed constantly in such a course. </p>
  
  <p>For purposes of this particular question, a variable could be initialized somehow and then used within a selection structure. The student need only have the idea that the <em>variable</em> refers to a value and can be thought of as a temporary <em>name</em> for that value. </p>
  
  <p>Teaching a course in a spiral way requires some pre-planning, of course. It isn't enough to put each important topic into the syllabus only once. Neither is it enough to expect that every student will get a lot out of the first introduction and you don't, therefore, need to obsess that everyone is on the same page before moving to the next topic.  </p>
  
  <h1>Use Scaffolding</h1>
  
  <p>An independent way of teaching is to have students first programming experiences done within a pre-defined richly endowed virtual world. The world is constructed so that interesting things can be done early without necessarily building up everything from the beginning. Often these world are simulations. For example, in Karel the Robot and its successors, programs consist first of writing sequences of statements to direct an existing robot. The robot's capabilities are built in and the student simply invokes existing functions/methods to achieve some complex effect. Next the student learns to write methods or functions as just abstractions over some sequence of such pre-build actions <em>and</em> other actions already built by the student. In this way it is functional abstraction that is the first real topic of importance. You can introduce variables or not, and you will certainly do so when you want several robots acting together. But these variables are just object references and little needs to be known about them, including whether they can be reassigned or not. Selection is certainly a reasonable topic in such a world, as is iteration, polymorphism, recursion, or whatever you need to teach. </p>
  
  <p>However, careful thought needs to be given to the characteristics of the simulation <em>world</em>. How rich is the environment. It can be simple, for example, and still be Turing Complete. </p>
  
  <p>Some teachers might choose this path with a single simulated virtual world, and others might choose to use several worlds of increasing sophistication and, perhaps, increasing complexity. I'll note that <a href="http://greenfoot.org" rel="noreferrer">Greenfoot</a> was built precisely to provide an environment in which such simulations and virtual worlds would be easy to build.</p>
  
  <hr>
  
  <p>Both of these techniques are very powerful and have been used by many instructors over a long period of time. Of course, they may be combined to good effect. </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-24T20:17:27.150Z
Answers.Text: Spiraling is the logical combination of *how every expert ever learned their topics* with *good, common sense*.  I have no idea why more curricula aren't written this way.  When I taught vocal music, I so intensively spiraled my curriculum that it became next to impossible to write formal lesson plans in the format required by my district.  I got in trouble for it a number of times, but I still believe strongly that it was a better approach for the students, who thrived.
Answers.UserDisplayName: Ben I.
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-24T20:19:59.410Z
Answers.Text: For New Yorkers, a common question is "How do you get to Carnegie Hall?"
Answers.UserDisplayName: Buffy
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-24T20:20:14.240Z
Answers.Text: And the answer....
Answers.UserDisplayName: Buffy
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-24T20:20:45.327Z
Answers.Text: Practice, practice, practice.
Answers.UserDisplayName: Buffy
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-24T20:13:31.243Z
Answers.LastActivityDate: 2017-12-24T20:18:51.413Z
Answers.LastEditDate: 2017-12-24T20:18:51.413Z
Answers.UserDisplayName: Buffy
Answers.Body: <p>The first 6 or 8 days of the year we work in <a href="http://home.cc.gatech.edu/dorn/jeroo" rel="nofollow noreferrer">Jeroo</a> instead of straight Java (there's a Python mode as well). It serves as a very quick introduction to syntax, ifs, and while loops. I've found it helps when I can go back later in the year with "remember in Jeroo when..."</p>
  
  <p>What Jeroo doesn't have is variables. You can't do things like loop 5 times. You can only loop or if while a Jeroo <code>hasFlower()</code>, <code>isFacing(EAST)</code>, or something like that. </p>
  
  <p>They're not directly using variables, although they're using boolean conditions. I've found that starting with methods like <code>hasFlower()</code> makes the idea of <code>x == 2</code> easier to wrap their heads around when we get to it. </p>
  
  <p>We only spend a few days in Jeroo because students start to get frustrated with what it can't do. You can't tell a Jeroo to loop a set number of times. You can't ask a Jeroo what column or row they're at. You can't ask them how many flowers they have. Any of those frustrations work really well as a hook into why variables are useful. </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-25T18:11:41.200Z
Answers.Text: That brought me down a fruitful little rabbit hole.
Answers.UserDisplayName: Ben I.
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-25T20:58:44.867Z
Answers.Text: I'm pretty sure that Jeroo, like Karel from which it evolved, is Turing Complete.
Answers.UserDisplayName: Buffy
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-26T10:35:05.090Z
Answers.Text: Have you any idea what the licence is? There is not mention on their website, or anywhere else that I can see.
Answers.UserDisplayName: ctrl-alt-delor
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-26T13:45:57.333Z
Answers.Text: Not sure on the license. Never thought to look.
Answers.UserDisplayName: Ryan Nutt
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-25T16:57:49.970Z
Answers.LastActivityDate: 2017-12-25T16:57:49.970Z
Answers.UserDisplayName: Ryan Nutt
Body: <p>I was looking at the CAS progression pathways, and noticed that in column 2 (Programming and development), it has selection (<code>if</code>) before variables.</p>
  
  <p><a href="https://community.computingatschool.org.uk/resources/1692/single" rel="nofollow noreferrer"><img src="https://i.sstatic.net/P8is9.png" alt="CAS - progression pathways"></a><br>
  <a href="https://community.computingatschool.org.uk/resources/1692/single" rel="nofollow noreferrer">https://community.computingatschool.org.uk/resources/1692/single</a></p>
  
  <p>I realise (from talking to the author), that the colour bands and the arrows were added with protect, and should be ignored. They were added for an era that was obsessed with levels, the day before levels were abolished (for key-stages 0-3).</p>
  
  <p>As a lot of teachers still teach in the order that is in this document, I was wondering: <strong>Is it possible to teach selection (<code>if</code>) before variables.</strong></p>
  
  <p>I am asking this, as I am creating a dependency graph, so that I know what has to be taught before what.</p>
  
  <hr>
  
  <p>When I teach Python, I teach both much later, after iteration, procedures, and functions.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-12-24T14:25:56.930Z
Comments.Text: Actually, it seems to have understanding programs (first & second rows) prior to creation of programs (third row). I don't think it implies that there are no variables in the programs to be understood. Especially if variables at that level are just presented as references to values. A complete understanding of variables (as things that can be changed) is necessary for the goals of the first two rows. You are probably reading too much into it.
Comments.UserDisplayName: Buffy
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-12-24T14:27:58.537Z
Comments.Text: OTOH, in an OO world or a Pure Functional world, yes you can, but I don't think that is the intent of the curriculum here.
Comments.UserDisplayName: Buffy
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-12-24T19:02:50.263Z
Comments.Text: This question is related but different https://cseducators.stackexchange.com/q/1482/204
Comments.UserDisplayName: ctrl-alt-delor
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-12-25T01:55:42.283Z
Comments.Text: If it is raining and it’s a weekday, Mary goes to the store. It is raining and it’s Saturday. Does Mary go to the store? We can teach selection in spoken language before we convert to if else in code. You could argue either way for the presence of variables in this sense.
Comments.UserDisplayName: ThisClark
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-12-25T10:39:38.370Z
Comments.Text: As a side note: Would it be possible for you to share the dependency graph with us once you've created it (maybe as a self-answer)? I am really interested in seeing it. Thank you in advance :)
Comments.UserDisplayName: TuringTux
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-12-26T03:11:46.297Z
Comments.Text: Too short for an answer ... Yes. Programming languages that don't have variables still have conditional branching.
Comments.UserDisplayName: pojo-guy
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-12-26T09:40:02.370Z
Comments.Text: @pojo-guy with example that could be an answer.
Comments.UserDisplayName: ctrl-alt-delor
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-12-26T09:41:10.070Z
Comments.Text: @TuringTux yes, It will be in a public repository. And I will try to remember to put it here. Hope I get time to work on it.
Comments.UserDisplayName: ctrl-alt-delor
Tags: <best-practice><lesson-order>
Title: Is it possible to teach selection (`if`) before variables
ThreadText: # Is it possible to teach selection (`if`) before variables
  
  (Asked by: username_0 on 2017-12-24)
  
  I was looking at the CAS progression pathways, and noticed that in column 2 (Programming and development), it has selection (`if`) before variables.
  
  [![CAS - progression pathways](https://i.sstatic.net/P8is9.png)](https://community.computingatschool.org.uk/resources/1692/single)  
  <https://community.computingatschool.org.uk/resources/1692/single>
  
  I realise (from talking to the author), that the colour bands and the arrows were added with protect, and should be ignored. They were added for an era that was obsessed with levels, the day before levels were abolished (for key-stages 0-3).
  
  As a lot of teachers still teach in the order that is in this document, I was wondering: **Is it possible to teach selection (`if`) before variables.**
  
  I am asking this, as I am creating a dependency graph, so that I know what has to be taught before what.
  
  ---
  
  When I teach Python, I teach both much later, after iteration, procedures, and functions.
  
  **Tags:** best-practice, lesson-order
  
  > **Comments:**
  > **username_1**: Actually, it seems to have understanding programs (first & second rows) prior to creation of programs (third row). I don't think it implies that there are no variables in the programs to be understood. Especially if variables at that level are just presented as references to values. A complete understanding of variables (as things that can be changed) is necessary for the goals of the first two rows. You are probably reading too much into it.  
  > **username_1**: OTOH, in an OO world or a Pure Functional world, yes you can, but I don't think that is the intent of the curriculum here.  
  > **username_0**: This question is related but different https://cseducators.stackexchange.com/q/1482/204  
  > **username_2**: If it is raining and it’s a weekday, Mary goes to the store. It is raining and it’s Saturday. Does Mary go to the store? We can teach selection in spoken language before we convert to if else in code. You could argue either way for the presence of variables in this sense.  
  > **username_3**: As a side note: Would it be possible for you to share the dependency graph with us once you've created it (maybe as a self-answer)? I am really interested in seeing it. Thank you in advance :)  
  > **username_4**: Too short for an answer ... Yes. Programming languages that don't have variables still have conditional branching.  
  > **username_0**: @username_4 with example that could be an answer.  
  > **username_0**: @username_3 yes, It will be in a public repository. And I will try to remember to put it here. Hope I get time to work on it.  
  
  ---
  
  ## 4 answers
  
  ### Answer by username_1 on 2017-12-24. Score: 5 | Accepted answer
  
  From a practical standpoint, rather than a theoretical one, there are at least two pedagogically defensible ways to do this. Spiral curriculum, and Scaffolding
  
  # Use a Spiral Approach
  
  I won't assume that you never mention variables early with this approach, but you just don't teach all that needs to be known at the first introduction of variables (or any other topic). To teach like this you mention things that need to be known deeply early on, partly to introduce terminology, but partly to permit simple uses in which deep knowledge isn't needed. Then, for example, variables but without reassignment could be used in setting up some sort of selection or iteration as your lecture focuses on those ideas rather than the variables. At any given point in time students know a little about a few things and a lot about some other things. Then, in the next *cycle* you go a bit deeper in some topics but also introduce, very lightly, other topics.
  
  The implication is that a student never needs to completely understand any given topic the first time it is presented as it will be seen again. Everything is reviewed constantly in such a course.
  
  For purposes of this particular question, a variable could be initialized somehow and then used within a selection structure. The student need only have the idea that the *variable* refers to a value and can be thought of as a temporary *name* for that value.
  
  Teaching a course in a spiral way requires some pre-planning, of course. It isn't enough to put each important topic into the syllabus only once. Neither is it enough to expect that every student will get a lot out of the first introduction and you don't, therefore, need to obsess that everyone is on the same page before moving to the next topic.
  
  # Use Scaffolding
  
  An independent way of teaching is to have students first programming experiences done within a pre-defined richly endowed virtual world. The world is constructed so that interesting things can be done early without necessarily building up everything from the beginning. Often these world are simulations. For example, in Karel the Robot and its successors, programs consist first of writing sequences of statements to direct an existing robot. The robot's capabilities are built in and the student simply invokes existing functions/methods to achieve some complex effect. Next the student learns to write methods or functions as just abstractions over some sequence of such pre-build actions *and* other actions already built by the student. In this way it is functional abstraction that is the first real topic of importance. You can introduce variables or not, and you will certainly do so when you want several robots acting together. But these variables are just object references and little needs to be known about them, including whether they can be reassigned or not. Selection is certainly a reasonable topic in such a world, as is iteration, polymorphism, recursion, or whatever you need to teach.
  
  However, careful thought needs to be given to the characteristics of the simulation *world*. How rich is the environment. It can be simple, for example, and still be Turing Complete.
  
  Some teachers might choose this path with a single simulated virtual world, and others might choose to use several worlds of increasing sophistication and, perhaps, increasing complexity. I'll note that [Greenfoot](http://greenfoot.org) was built precisely to provide an environment in which such simulations and virtual worlds would be easy to build.
  
  ---
  
  Both of these techniques are very powerful and have been used by many instructors over a long period of time. Of course, they may be combined to good effect.
  
  > **Comments:**
  > **username_7**: Spiraling is the logical combination of *how every expert ever learned their topics* with *good, common sense*.  I have no idea why more curricula aren't written this way.  When I taught vocal music, I so intensively spiraled my curriculum that it became next to impossible to write formal lesson plans in the format required by my district.  I got in trouble for it a number of times, but I still believe strongly that it was a better approach for the students, who thrived.  
  > **username_1**: For New Yorkers, a common question is "How do you get to Carnegie Hall?"  
  > **username_1**: And the answer....  
  > **username_1**: Practice, practice, practice.  
  
  ---
  
  ### Answer by username_8 on 2017-12-25. Score: 3
  
  The first 6 or 8 days of the year we work in [Jeroo](http://home.cc.gatech.edu/dorn/jeroo) instead of straight Java (there's a Python mode as well). It serves as a very quick introduction to syntax, ifs, and while loops. I've found it helps when I can go back later in the year with "remember in Jeroo when..."
  
  What Jeroo doesn't have is variables. You can't do things like loop 5 times. You can only loop or if while a Jeroo `hasFlower()`, `isFacing(EAST)`, or something like that.
  
  They're not directly using variables, although they're using boolean conditions. I've found that starting with methods like `hasFlower()` makes the idea of `x == 2` easier to wrap their heads around when we get to it.
  
  We only spend a few days in Jeroo because students start to get frustrated with what it can't do. You can't tell a Jeroo to loop a set number of times. You can't ask a Jeroo what column or row they're at. You can't ask them how many flowers they have. Any of those frustrations work really well as a hook into why variables are useful.
  
  > **Comments:**
  > **username_7**: That brought me down a fruitful little rabbit hole.  
  > **username_1**: I'm pretty sure that Jeroo, like Karel from which it evolved, is Turing Complete.  
  > **username_0**: Have you any idea what the licence is? There is not mention on their website, or anywhere else that I can see.  
  > **username_8**: Not sure on the license. Never thought to look.  
  
  ---
  
  ### Answer by username_4 on 2017-12-30. Score: 0
  
  Yes. Programming languages that don't have variables still have conditional branching. The paradigm is called "functional programming".
  
  Here is a link to a list of programming languages that support functional programming: <https://en.wikipedia.org/wiki/Category:Functional_languages>
  
  A list of pure functional languages can be seen at this link: <https://en.wikipedia.org/wiki/List_of_programming_languages_by_type#Functional_languages>
  
  Here is an example functional programming exercise in javascript that I found:
  <https://hackernoon.com/challenge-program-without-variables-javascript-bee89a41455e>
  
  Here are some other links of interest:
  <https://stackoverflow.com/questions/1020653/how-can-you-do-anything-useful-without-mutable-state>
  <https://www.cs.ox.ac.uk/geomlab/CAS-article.pdf>
  
  > **Comments:**
  > **username_0**: So is the dependency (variables or functional)?  
  
  ---
  
  ### Answer by username_5 on 2017-12-27. Score: 0
  
  This year I managed to present both functions and if-then-else before variables to my (total beginners) students. We're using Processing.
  
  Students are first presented with basic drawing operation (rect, ellipse, fill)
  
  Exercise for Functions : draw a moderately complex picture
  
  Solution (sketch of):
  
  ```
   void setup() {
       size(600, 200);
   }
  
   void draw() {
      draw_sky();
      draw_seashore();
      draw_boats();
   }
  
  ```
  
  Exercice for if then else : draw a square on the screen, and a circle for the mouse pointer. Circle is red when inside the square, green otherwise.
  
  Well, mouseX and mouseY are framework variables, actually. We also constants (final), both global and local, so the students get familiar with the notion of scope. A bit later, parameters for functions (drawing the same shape at different places) are introduced. And then, "real" variables representing a user-changeable state (say, last position where a click occured).
  
  A better example, if really dont want the coordinates variables:
  
  ```
  void setup()
  {
    size(200,200);
  }
  
  void draw() {
    background(255);
    if (second() % 2 == 0) {
      draw_square();
    }
  }
  
  void draw_square() {
    fill(0);
    rect(50, 50, 100, 100);
  }
  
  ```
  
  A more elaborate example is drawing a clock with three needles. Makes a strong motivation to introduce variables for auxiliary computations.
  
  PS: some readers are not familiar with Processing and are too busy to have a look at the documentation, so :
  
  * the `second()` function returns the current second (an int between 0 and 59).
  * in a Processing program, the framework calls `setup()` and then loops around `draw()`, just like Arduino with setup+loop. Programmer has to provide the draw/setup functions together with functions as responses to events (`mousePressed`, etc).
  * the example shows a blinking square.
  
  > **Comments:**
  > **username_0**: I don't understand. I nee no selection, or variables in the example.  
  > **username_0**: Those are procedures, not functions. And constant variables are (real) variables. Valuables can be mutating or non-mutating (const). In a functional language, all variables are non-mutating. variable ≠ mutating.  
  > **username_6**: I would be curious to see a Processing example that uses `if` statements without variables, but `mouseX` and `mouseY` are variables.  
  > **username_5**: @username_0 in the Processing documentations, methods are often referred as 'functions". Example https://processing.org/reference/parentheses.html "Parentheses have multiple functions relating to functions and structures. They are used to contain a list of parameters passed to functions and control structures  
  > **username_0**: The program you give is impossible to understand, with out a global understanding, and that is missing. This is primarily because of a poor choice of names (yours or the frameworks). E.g. `size` is a noun, so we would expect it to return a value, but it does not. I guess it sets the size (`setSize`). `second` is a noun so should return a second object (what ever that is), but seems to return a number, so maybe it is the second number, but of what. I see no list. For this reason it is not useful. Therefore I will down-vote.  
  > **username_1**: I think you are being overly critical here of someone trying to help. The example seems fairly reasonable if you just assume there is a preexisting framework in which the students program. You are being a bit nit-picky on names, and while I agree with the noun-verb concept, not everyone adheres to it so it is unreasonable to expect perfection here.  
  > **username_5**: @username_0 understanding a program requires the student a minimum listening to some explanations.  The names are the framework's , except `draw_square()` for which I take full responsability and your down vote for irremediable nebulousness.  "list" ? Are you talking about citation of the processing documentation? It explains that parentheses contain a list of parameters, as in `size(600,400)` or `background(255) ` or `second()`.  But these considerations are quite out of topic to the question of @username_6 : use of `if` in a program without variables.  
  > **username_5**: @username_1 no assumption  needed, as the use of the Processing framework was explicitly mentioned. We all have bad hair days.  
  > **username_1**: It might be good to discuss this in the classroom: https://chat.stackexchange.com/rooms/59174/the-classroom  
  > **username_0**: If some explanation was given, especially around `second()` (as this seems to be the important bit. And does it need an `else` so that `draw` always draws. If you make it clearer, then I could change it to an upvote.  
  
  ---
  
  