Answers.Body: <p>Perhaps students should be required to at least learn to read pseudo-code.  </p>
  
  <p>Some algorithms or concept are unsuited for clear expression in some languages (e.g. the ones pre-requisite for the course).  Those concepts might be more simply explainable using a pseudo-code that does not require the clutter of a lot of syntactic sugar or other gymnastics.</p>
  
  <p>Perhaps they should be allowed pseudo-code for exam or quiz questions in those areas as well.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-23T20:57:18.417Z
Answers.LastActivityDate: 2017-05-23T20:57:18.417Z
Answers.UserDisplayName: hotpaw2
Answers.Body: <p>Pseudo-code is not an option. You have to have it.</p>
  
  <p>The purpose of such a course is not about the expression of algorithms in a nearly ready to run form.  It is about the work involved in their development. The strategies you use. The ideas you consider, try and abandon as they don't seem so good.</p>
  
  <p>So how could we use a formal language to write down fuzzy ideas ?</p>
  
  <p>Given a problem, like "compute how many leap years there are between y1 and y2", you have to try different ideas. And these ideas are not yet wholly developed. So it is much too early to put them under the form of code.</p>
  
  <p>But you still have the need to keep the ideas in written form, if you want to remember/transmit them.</p>
  
  <p>An idea may be</p>
  
  <pre><code>A. test all years between y1 and y2
     count these that are leap years
  </code></pre>
  
  <p>another could be</p>
  
  <pre><code>B. use a formula about multiples of 4, 100 and 400.
  </code></pre>
  
  <p>This is not supposed to be a complete description of the final algorithm. But it is an idea which has to be written, as a first step of the work.</p>
  
  <p>A second step would be to give more details. For the second solution :</p>
  
  <pre><code>B.1 use a formula f for leap years from year 0 to y
      compute the difference  f(y)-f(0)
  </code></pre>
  
  <p>An a third step</p>
  
  <pre><code>B.2 f(y) = number of multiples of 4
           - number of multiples of 100
           + number of mltiples of 400
  </code></pre>
  
  <p>A decent ready-to-program version emerges only now</p>
  
  <pre><code>B.3 function leap_years_from_0 (y) 
         =  (y / 4) - (y / 100) + (y / 400)
  
      function leap_years_between(y1, y2)
         =  leap_years_from_0(y2) - leap_years_from_0(y1) 
  </code></pre>
  
  <p>In such a course, the important point is the journey between the problem and the solutions.   It is not the exposure of algorithms/programs in there final version.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-01-07T18:41:13.280Z
Answers.LastActivityDate: 2018-01-07T18:46:40.077Z
Answers.LastEditDate: 2018-01-07T18:46:40.077Z
Answers.UserDisplayName: Michel Billaud
Answers.Body: <p>It is possible to teach algorithms in particular, and a lot about programming in general using a pseudocode. However, the pseudocode needs a firm definition or else it can lead to sloppy thinking. If a student is permitted to make "statements" in the pseudocode that imply, for instance that P=NP, then the statement isn't worth much, nor is the "algorithm" so expressed. </p>
  
  <p>I'll note that <a href="https://en.wikipedia.org/wiki/Edsger_W._Dijkstra" rel="nofollow noreferrer">Edsger Dijkstra</a> wrote most of his papers in pseudocode, but it was carefully defined. <a href="https://en.wikipedia.org/wiki/David_Gries" rel="nofollow noreferrer">David Gries</a> wrote his famous book <a href="https://rads.stackoverflow.com/amzn/click/0387964800" rel="nofollow noreferrer">The Science of Programming</a> using this same pseudocode. </p>
  
  <p>However, each statement in the language (even the empty statement <em>skip</em>) was carefully defined using pre and post-conditions so that the effect of the statement and resulting programs were precisely defined. And even the pre and post-conditions are precisely defined. </p>
  
  <p>This language (pseudo-laguage) can be fairly easily translated into other imperative languages, but it is harder to take advantage of the features of other paradigms such as functional or object-oriented. </p>
  
  <p>So, yes, it can be done. It has been done. It has been done by masters. But it isn't a lot easier than using a "real" language. It has quirks, like any language. Some programs are harder than others, of course. It is even possible to write a compiler for Dijkstra's language (I've done so, actually), making execution possible. However, the reason for the language wasn't execution, but precise clarity of expression of algorithms with precise semantics. </p>
  
  <p>One possible problem with learning algorithms this way, however, is the the resulting pseudo-programs tend to be rather monolithic. Complex programs have long statements with lots of structure. The method, if not carefully used, seems to de-emphasize building complex things out of small interacting parts. This isn't inherent in using pseudo-code, but the instructor needs to be careful about the use so that complexity doesn't overwhelm understanding. But the same is true in real languages. Not everything needs to be done in <em>main</em>. </p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-27T13:19:19.627Z
Answers.LastActivityDate: 2018-05-27T13:19:19.627Z
Answers.UserDisplayName: Buffy
Answers.Body: <h1>Yes, the first algorithms class should be taught in pseudo-code</h1>
  
  <p>(And teach logic tables too.)</p>
  
  <p>If the objective of the class is to teach algorithms and programming, not a programming language, the pseudo-code is the way to focus on the objectives, not the tools. Flow charting <em>can</em> be included, but need not be either.</p>
  
  <p>Programs written in pseudo-code don't have syntax errors, or compile-time errors. They don't have strict type-classing or confusingly abbreviated function names. They only have logic and design.</p>
  
  <p>After a program is written in pseudo-code it can be "run" on your desktop, the real one, not the metaphor created by Xerox (yes, Xerox, in 1970). Doing such a so-called "Hand-check" helps find logic errors and develops a better understanding of programming theory than jumping right into a formal language, no matter how "simple" it is. It's also a convenient skill to have as a functioning programmer for the occasions when logic error do get compiled and the environment does not include a step debugger. Some employers still test for that skill. (see the <a href="https://www.kent.ac.uk/careers/tests/computer-test.htm" rel="noreferrer">University of Kent's remarks</a>.)</p>
  
  <p>For simple instruction on how to hand-check code see <a href="http://users.csc.calpoly.edu/~jdalbey/101/Resources/codetrace.html" rel="noreferrer">this</a> from Dr. John Dalbey of CalPoly.</p>
  
  <p>Lastly, to allow a veteran educator to weigh in I'll mention the <a href="https://blogs.msdn.microsoft.com/alfredth/2007/06/22/programming-proverbs-21-hand-check-the-program-before-running-it/" rel="noreferrer">blog of Alfred Thompson about Hand-checking</a>.</p>
  
  <p>Until computers can do <em>what we mean</em> we have to live with them doing <em>what we tell them</em>, and that's going to involve errors in how we say what we mean.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-30T12:09:04.817Z
Answers.Text: This is the first answer I've seen that took on a first *algorithms* class, which is very different from a first *programming* class.
Answers.UserDisplayName: Ben I.
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-30T12:10:43.787Z
Answers.Text: All I did was read the title.
Answers.UserDisplayName: Gypsy Spellweaver
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-31T09:52:28.577Z
Answers.Text: @Choirbean Sorry if the title is not obvious, but it does say algorithms. I don't think you can teach algorithms without programming, nor programming without algorithms unless you are really only teach a programming language, which is not so useful.
Answers.UserDisplayName: ecc
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-31T10:12:31.343Z
Answers.Text: @GypsySpellweaver I really liked your answer. The most important thing a CS teacher should ask themselves is "What am I grading here?", "Do i want students to show me they understand the material or that they can succesfully build a program without the build failing?"
Answers.UserDisplayName: ecc
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-31T12:29:35.850Z
Answers.Text: @ecc You can teach programming without using the "word" _algorithm_, or the concepts behind it, but programs _are_ algorithms. Doing so, however, short changes the students in both their programming skills and their life skills. Conversely, teaching algorithms does _not_ require programs, or computers. A cake recipe is an algorithm, as is any set of instructions to do anything. Check out [Wikipedia](http://en.wikipedia.org/wiki/Algorithm).
Answers.UserDisplayName: Gypsy Spellweaver
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-31T12:35:00.660Z
Answers.Text: You are right. But given the context of this discussion, saying a recipe is an algorithm is just being pedantic and you know that's not what's being talked about.
Answers.UserDisplayName: ecc
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-31T12:38:25.137Z
Answers.Text: That's in response to part of what you comment to Choirbean above, about not teaching algorithms without programming. And sometimes "recipe" is used in computers anyway, such as the *nix make/build process is commonly called a recipe.
Answers.UserDisplayName: Gypsy Spellweaver
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-30T12:03:08.027Z
Answers.LastActivityDate: 2017-06-15T16:49:39.820Z
Answers.LastEditDate: 2017-06-15T16:49:39.820Z
Answers.UserDisplayName: Gypsy Spellweaver
Answers.Body: <p>No, it shouldn't.  It's an appealing idea, but when kids are just starting in programming, one of the few straws they have to grasp at is that it is, on some level, very concrete.  I type:</p>
  
  <pre><code>std::cout &lt;&lt; "Hello World!";
  </code></pre>
  
  <p>... and out prints "Hello World!".  Without the ability to run and troubleshoot code, I'm afraid that everything will become abstract, and most students will simply flounder.</p>
  
  <p>You can choose a language with easier syntax, such as Python, or a visual language like Scratch, but the kids really need something to actually run and manipulate if they are to make early progress.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-23T15:26:18.853Z
Answers.Text: The code example here is just way too abstract for a beginner IMO.
Answers.UserDisplayName: vacip
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-23T15:33:03.647Z
Answers.Text: If you're teaching a first "Hello World" program, there will often be mysterious syntax that the kids won't understand at first.  `System.out.println("hello world");`, `printf("hello, world\n");`, `putStrLn "Hello World"`, pick your poison.
Answers.UserDisplayName: Ben I.
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-23T15:40:36.130Z
Answers.Text: And this is a big problem. You will want to keep the number of exotic symbols to a minimum. Why `::`, not just `:`? What is `<`? What is `std` and why not just call it `Standard` then? "I saw my brother use `=` when he was programming, was he doing it wrong?" Etc... There is a difference between a brainfuck code and `print "hello world"` or   `program HelloWorld;` `begin` `writeln('Hello World');` `end.`. Human readability is important.
Answers.UserDisplayName: vacip
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-24T07:48:41.733Z
Answers.Text: You say the ability to compile is important. But why? As someone learning how programming works, the different programming paradigms, etc, why is it important that I deal with compiling code? An interpreted language seems much more practical. I hated when I had to spend so much time fixing my Eclipse setup to make it build my Java project so I could focus on the task at hand.
Answers.UserDisplayName: ecc
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-24T10:35:15.850Z
Answers.Text: I was being super informal with the word "compile" and casting a large umbrella to indicate both, which is not technically correct. Plus the whole statement was stronger without it, so I removed the word.
Answers.UserDisplayName: Ben I.
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-03T00:44:59.773Z
Answers.Text: I'm surprised by @BenI.'s comment. If you want your computer to say `"hello world"`, why not just write the program `"hello world"`? Why do you need any of these "poison"s?
Answers.UserDisplayName: Shriram Krishnamurthi
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-03T01:53:44.763Z
Answers.Text: Because the alternative to a language with syntax is a language that they can't actually run.
Answers.UserDisplayName: Ben I.
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-23T14:41:58.660Z
Answers.LastActivityDate: 2018-01-07T09:03:53.107Z
Answers.LastEditDate: 2018-01-07T09:03:53.107Z
Answers.UserDisplayName: Ben I.
Answers.Body: <p>I think this heavily depends on the environment. Is this a science university? A middle school? An engineering high school?</p>
  
  <p>Pseudo code has its uses. At university level, with years of programming to come, you should use pseudo code - they will need to learn it anyway, and they need to understand the theory without strongly connecting it to one programming language - mostly because all programming languages have their unique idiocy, and it is hard for a beginner to distinguish between the language being weird or the algorithm being complicated.</p>
  
  <p>If you are teaching kids at elementary/middle schools, then pseudo code is just not rewarding enough. It still has its uses though. For example have them write a pseudo code for each other to use a vending machine (1: select beverage, 2: press button, 3: insert coin, 4: repeat until credit=price etc.). Can be a good introduction to the whole concept.</p>
  
  <p>The problem is that by teaching algorithms through an actual programming language, you are also teaching the language itself. So, like I said, this heavily depends on the environment and the goal of the course.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-24T11:41:33.253Z
Answers.Text: While this is not the most popular question so far, I think I like this one the best
Answers.UserDisplayName: ecc
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-23T15:24:14.847Z
Answers.LastActivityDate: 2017-05-23T15:24:14.847Z
Answers.UserDisplayName: vacip
Answers.Body: <p><strong>No</strong>, classes should favor actual programming languages.</p>
  
  <p>Ideally, students should should be able to:</p>
  
  <ul>
  <li><p>Run code examples.</p></li>
  <li><p>Apply code analysis tools to code examples, both to better understand the examples and to become familiar with code analysis.</p></li>
  <li><p>Experiment with modifying code.</p></li>
  </ul>
  
  <p>However, it's important to select a reasonable language.  Unfortunately some instructors select pet esoteric or proprietary coding systems out of personal preference.  While it's true that students should be able to apply the same skills to the languages that they actually care about, it's a huge disservice.</p>
  
  <p>A good default language for a course should be:</p>
  
  <ul>
  <li><p>High-level, unless the course is specifically on low-level concepts.</p>
  
  <ul>
  <li>Provides benefits like pseudo-code while still being real.</li>
  </ul></li>
  <li><p>Be free to work with using reasonable tools.</p>
  
  <ul>
  <li><p>Good examples include Java and C#.</p></li>
  <li><p>Bad examples include Mathematica and Matlab.</p></li>
  </ul></li>
  <li><p>Have helpful, easy-to-use debugging tools.</p>
  
  <ul>
  <li>Students shouldn't have to wonder about why the code doesn't compile or where the mistake in their code is.</li>
  </ul></li>
  <li><p>Very quick compile times, so students can do rapid trial-and-error.</p></li>
  <li><p>Generally, prefer strongly typed languages, and avoid unsafe operations.</p></li>
  </ul>
  
  <p>Personally I'd go for Visual Studio 2017 with C#.  Or, if a significant portion of students use Linux/Apple, then fallback to Java.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-24T07:45:27.693Z
Answers.Text: I would strongly advise against locking students to a vendor off the bat. Notice I'm not implying students are CS students. You can teach CS to other engineering students, for instance. My Mechanical Engineering friends had some programming and algorithms courses where they did algorithms is pseudo code on paper and also some exercises and projects in Visual Basic.
Answers.UserDisplayName: ecc
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-23T15:02:52.203Z
Answers.LastActivityDate: 2017-05-23T15:02:52.203Z
Answers.UserDisplayName: Nat
Answers.Body: <p>Pseudo-code feels like one of those things invented before I learnt to code, as a response to the complexity of reading and to a lesser extent writing code in assembler (or even machine code). </p>
  
  <p>When it was <em>impossible</em> to explain a program without recourse to explaining every single term (starting with 'every line needs a number, start off with increments of 10 so you can add more in later'), it made sense to start the explanations with a less formally structured code.</p>
  
  <p>Now, code can be written using drag-and-drop templates, or in fairly readable readable language (with beginner friendly error handling) so there is really no need to introduce pseudo-code.</p>
  
  <p>Where pseudo code <em>still</em> makes sense is in a scenario where you need a formalised but more abstract language - for example the architectural definition of an instruction set. Something which you want to be able to write a formal parser for, and still retain human readability.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-23T14:50:14.937Z
Answers.LastActivityDate: 2017-05-23T14:50:14.937Z
Answers.UserDisplayName: Sean Houlihane
Body: <p>When I was studying, my professors had different approaches when teaching programming to beginners:</p>
  
  <ul>
  <li><p>Choose a language with which the professor is comfortable and fulfills the course requirements but might not be so popular in the real world. I had this experience with <a href="https://www.wolfram.com/mathematica/" rel="noreferrer">Mathematica</a> programming. We would spend lots of time dealing with this language and as a result less time dealing with the programming language per se.</p></li>
  <li><p>Teach in a flavor of pseudo-code. This makes it "harder" to commit errors cause by compilers, interpreters and syntax in general and allows the students to focus in the problem. Naturally has the disadvantage that you can't run your code anywhere.</p></li>
  </ul>
  
  <p>What do most professionals and students prefer when teaching/learning algorithms and basic programming?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-06-16T14:39:11.883Z
Comments.Text: Students *do not* prefer to deal with the IDE. That's just a frustration point. That actually brings another point. Newbies don't know any IDEs so they'll use whatever the teacher thinks is best, not the actual good tools.
Comments.UserDisplayName: ecc
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-05-23T14:57:12.293Z
Comments.Text: would you consider flowcharts (like if/else flows) as a flavor or pseudo-code?
Comments.UserDisplayName: andytilia
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-05-23T15:07:37.473Z
Comments.Text: It seems to me that you need some programming language to actually run things and test ideas.  It is one thing to understand what makes something work and another to actually execute it.
Comments.UserDisplayName: ncmathsadist
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-05-23T15:24:56.873Z
Comments.Text: Are we talking elementary school, high school, university, adult education? Programming **or** Algorithm class?
Comments.UserDisplayName: vacip
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-05-25T22:00:11.477Z
Comments.Text: The question can help to give some ideas about what the 'no-programming language' approach looks like: https://cs.stackexchange.com/questions/29830/how-can-i-teach-computer-science-without-using-computers .
Comments.UserDisplayName: Discrete lizard
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-05-25T22:08:33.867Z
Comments.Text: I second that this question should distinguish between basic programming or a basic algorithms, as both the audience and the learning goals often differ: does the student want to design algorithms or does the student want to do more programming? (Although the tasks are related, they are quite different still)
Comments.UserDisplayName: Discrete lizard
Tags: <pseudo-code>
Title: Should the first Programming/Algorithms class be taught in pseudo-code?
ThreadText: # Should the first Programming/Algorithms class be taught in pseudo-code?
  
  (Asked by: username_0 on 2017-05-23)
  
  When I was studying, my professors had different approaches when teaching programming to beginners:
  
  * Choose a language with which the professor is comfortable and fulfills the course requirements but might not be so popular in the real world. I had this experience with [Mathematica](https://www.wolfram.com/mathematica/) programming. We would spend lots of time dealing with this language and as a result less time dealing with the programming language per se.
  * Teach in a flavor of pseudo-code. This makes it "harder" to commit errors cause by compilers, interpreters and syntax in general and allows the students to focus in the problem. Naturally has the disadvantage that you can't run your code anywhere.
  
  What do most professionals and students prefer when teaching/learning algorithms and basic programming?
  
  **Tags:** pseudo-code
  
  > **Comments:**
  > **username_1**: would you consider flowcharts (like if/else flows) as a flavor or pseudo-code?  
  > **username_2**: It seems to me that you need some programming language to actually run things and test ideas.  It is one thing to understand what makes something work and another to actually execute it.  
  > **username_3**: Are we talking elementary school, high school, university, adult education? Programming **or** Algorithm class?  
  > **username_4**: The question can help to give some ideas about what the 'no-programming language' approach looks like: https://cs.stackexchange.com/questions/29830/how-can-i-teach-computer-science-without-using-computers .  
  > **username_4**: I second that this question should distinguish between basic programming or a basic algorithms, as both the audience and the learning goals often differ: does the student want to design algorithms or does the student want to do more programming? (Although the tasks are related, they are quite different still)  
  > **username_0**: Students *do not* prefer to deal with the IDE. That's just a frustration point. That actually brings another point. Newbies don't know any IDEs so they'll use whatever the teacher thinks is best, not the actual good tools.  
  
  ---
  
  ## 8 answers
  
  ### Answer by username_8 on 2017-05-30. Score: 12 | Accepted answer
  
  # Yes, the first algorithms class should be taught in pseudo-code
  
  (And teach logic tables too.)
  
  If the objective of the class is to teach algorithms and programming, not a programming language, the pseudo-code is the way to focus on the objectives, not the tools. Flow charting *can* be included, but need not be either.
  
  Programs written in pseudo-code don't have syntax errors, or compile-time errors. They don't have strict type-classing or confusingly abbreviated function names. They only have logic and design.
  
  After a program is written in pseudo-code it can be "run" on your desktop, the real one, not the metaphor created by Xerox (yes, Xerox, in 1970). Doing such a so-called "Hand-check" helps find logic errors and develops a better understanding of programming theory than jumping right into a formal language, no matter how "simple" it is. It's also a convenient skill to have as a functioning programmer for the occasions when logic error do get compiled and the environment does not include a step debugger. Some employers still test for that skill. (see the [University of Kent's remarks](https://www.kent.ac.uk/careers/tests/computer-test.htm).)
  
  For simple instruction on how to hand-check code see [this](http://users.csc.calpoly.edu/~jdalbey/101/Resources/codetrace.html) from Dr. John Dalbey of CalPoly.
  
  Lastly, to allow a veteran educator to weigh in I'll mention the [blog of Alfred Thompson about Hand-checking](https://blogs.msdn.microsoft.com/alfredth/2007/06/22/programming-proverbs-21-hand-check-the-program-before-running-it/).
  
  Until computers can do *what we mean* we have to live with them doing *what we tell them*, and that's going to involve errors in how we say what we mean.
  
  > **Comments:**
  > **username_9**: This is the first answer I've seen that took on a first *algorithms* class, which is very different from a first *programming* class.  
  > **username_8**: All I did was read the title.  
  > **username_0**: @Choirbean Sorry if the title is not obvious, but it does say algorithms. I don't think you can teach algorithms without programming, nor programming without algorithms unless you are really only teach a programming language, which is not so useful.  
  > **username_0**: @username_8 I really liked your answer. The most important thing a CS teacher should ask themselves is "What am I grading here?", "Do i want students to show me they understand the material or that they can succesfully build a program without the build failing?"  
  > **username_8**: @username_0 You can teach programming without using the "word" _algorithm_, or the concepts behind it, but programs _are_ algorithms. Doing so, however, short changes the students in both their programming skills and their life skills. Conversely, teaching algorithms does _not_ require programs, or computers. A cake recipe is an algorithm, as is any set of instructions to do anything. Check out [Wikipedia](http://en.wikipedia.org/wiki/Algorithm).  
  > **username_0**: You are right. But given the context of this discussion, saying a recipe is an algorithm is just being pedantic and you know that's not what's being talked about.  
  > **username_8**: That's in response to part of what you comment to Choirbean above, about not teaching algorithms without programming. And sometimes "recipe" is used in computers anyway, such as the *nix make/build process is commonly called a recipe.  
  
  ---
  
  ### Answer by username_9 on 2017-05-23. Score: 18
  
  No, it shouldn't. It's an appealing idea, but when kids are just starting in programming, one of the few straws they have to grasp at is that it is, on some level, very concrete. I type:
  
  ```
  std::cout << "Hello World!";
  
  ```
  
  ... and out prints "Hello World!". Without the ability to run and troubleshoot code, I'm afraid that everything will become abstract, and most students will simply flounder.
  
  You can choose a language with easier syntax, such as Python, or a visual language like Scratch, but the kids really need something to actually run and manipulate if they are to make early progress.
  
  > **Comments:**
  > **username_3**: The code example here is just way too abstract for a beginner IMO.  
  > **username_9**: If you're teaching a first "Hello World" program, there will often be mysterious syntax that the kids won't understand at first.  `System.out.println("hello world");`, `printf("hello, world\n");`, `putStrLn "Hello World"`, pick your poison.  
  > **username_3**: And this is a big problem. You will want to keep the number of exotic symbols to a minimum. Why `::`, not just `:`? What is `<`? What is `std` and why not just call it `Standard` then? "I saw my brother use `=` when he was programming, was he doing it wrong?" Etc... There is a difference between a brainfuck code and `print "hello world"` or   `program HelloWorld;` `begin` `writeln('Hello World');` `end.`. Human readability is important.  
  > **username_0**: You say the ability to compile is important. But why? As someone learning how programming works, the different programming paradigms, etc, why is it important that I deal with compiling code? An interpreted language seems much more practical. I hated when I had to spend so much time fixing my Eclipse setup to make it build my Java project so I could focus on the task at hand.  
  > **username_9**: I was being super informal with the word "compile" and casting a large umbrella to indicate both, which is not technically correct. Plus the whole statement was stronger without it, so I removed the word.  
  > **username_10**: I'm surprised by @BenI.'s comment. If you want your computer to say `"hello world"`, why not just write the program `"hello world"`? Why do you need any of these "poison"s?  
  > **username_9**: Because the alternative to a language with syntax is a language that they can't actually run.  
  
  ---
  
  ### Answer by username_3 on 2017-05-23. Score: 6
  
  I think this heavily depends on the environment. Is this a science university? A middle school? An engineering high school?
  
  Pseudo code has its uses. At university level, with years of programming to come, you should use pseudo code - they will need to learn it anyway, and they need to understand the theory without strongly connecting it to one programming language - mostly because all programming languages have their unique idiocy, and it is hard for a beginner to distinguish between the language being weird or the algorithm being complicated.
  
  If you are teaching kids at elementary/middle schools, then pseudo code is just not rewarding enough. It still has its uses though. For example have them write a pseudo code for each other to use a vending machine (1: select beverage, 2: press button, 3: insert coin, 4: repeat until credit=price etc.). Can be a good introduction to the whole concept.
  
  The problem is that by teaching algorithms through an actual programming language, you are also teaching the language itself. So, like I said, this heavily depends on the environment and the goal of the course.
  
  > **Comments:**
  > **username_0**: While this is not the most popular question so far, I think I like this one the best  
  
  ---
  
  ### Answer by username_11 on 2017-05-23. Score: 5
  
  **No**, classes should favor actual programming languages.
  
  Ideally, students should should be able to:
  
  * Run code examples.
  * Apply code analysis tools to code examples, both to better understand the examples and to become familiar with code analysis.
  * Experiment with modifying code.
  
  However, it's important to select a reasonable language. Unfortunately some instructors select pet esoteric or proprietary coding systems out of personal preference. While it's true that students should be able to apply the same skills to the languages that they actually care about, it's a huge disservice.
  
  A good default language for a course should be:
  
  * High-level, unless the course is specifically on low-level concepts.
  
    + Provides benefits like pseudo-code while still being real.
  * Be free to work with using reasonable tools.
  
    + Good examples include Java and C#.
    + Bad examples include Mathematica and Matlab.
  * Have helpful, easy-to-use debugging tools.
  
    + Students shouldn't have to wonder about why the code doesn't compile or where the mistake in their code is.
  * Very quick compile times, so students can do rapid trial-and-error.
  * Generally, prefer strongly typed languages, and avoid unsafe operations.
  
  Personally I'd go for Visual Studio 2017 with C#. Or, if a significant portion of students use Linux/Apple, then fallback to Java.
  
  > **Comments:**
  > **username_0**: I would strongly advise against locking students to a vendor off the bat. Notice I'm not implying students are CS students. You can teach CS to other engineering students, for instance. My Mechanical Engineering friends had some programming and algorithms courses where they did algorithms is pseudo code on paper and also some exercises and projects in Visual Basic.  
  
  ---
  
  ### Answer by username_12 on 2017-05-23. Score: 3
  
  Pseudo-code feels like one of those things invented before I learnt to code, as a response to the complexity of reading and to a lesser extent writing code in assembler (or even machine code).
  
  When it was *impossible* to explain a program without recourse to explaining every single term (starting with 'every line needs a number, start off with increments of 10 so you can add more in later'), it made sense to start the explanations with a less formally structured code.
  
  Now, code can be written using drag-and-drop templates, or in fairly readable readable language (with beginner friendly error handling) so there is really no need to introduce pseudo-code.
  
  Where pseudo code *still* makes sense is in a scenario where you need a formalised but more abstract language - for example the architectural definition of an instruction set. Something which you want to be able to write a formal parser for, and still retain human readability.
  
  
  ---
  
  ### Answer by username_5 on 2017-05-23. Score: 1
  
  Perhaps students should be required to at least learn to read pseudo-code.
  
  Some algorithms or concept are unsuited for clear expression in some languages (e.g. the ones pre-requisite for the course). Those concepts might be more simply explainable using a pseudo-code that does not require the clutter of a lot of syntactic sugar or other gymnastics.
  
  Perhaps they should be allowed pseudo-code for exam or quiz questions in those areas as well.
  
  
  ---
  
  ### Answer by username_6 on 2018-01-07. Score: 1
  
  Pseudo-code is not an option. You have to have it.
  
  The purpose of such a course is not about the expression of algorithms in a nearly ready to run form. It is about the work involved in their development. The strategies you use. The ideas you consider, try and abandon as they don't seem so good.
  
  So how could we use a formal language to write down fuzzy ideas ?
  
  Given a problem, like "compute how many leap years there are between y1 and y2", you have to try different ideas. And these ideas are not yet wholly developed. So it is much too early to put them under the form of code.
  
  But you still have the need to keep the ideas in written form, if you want to remember/transmit them.
  
  An idea may be
  
  ```
  A. test all years between y1 and y2
     count these that are leap years
  
  ```
  
  another could be
  
  ```
  B. use a formula about multiples of 4, 100 and 400.
  
  ```
  
  This is not supposed to be a complete description of the final algorithm. But it is an idea which has to be written, as a first step of the work.
  
  A second step would be to give more details. For the second solution :
  
  ```
  B.1 use a formula f for leap years from year 0 to y
      compute the difference  f(y)-f(0)
  
  ```
  
  An a third step
  
  ```
  B.2 f(y) = number of multiples of 4
           - number of multiples of 100
           + number of mltiples of 400
  
  ```
  
  A decent ready-to-program version emerges only now
  
  ```
  B.3 function leap_years_from_0 (y) 
         =  (y / 4) - (y / 100) + (y / 400)
  
      function leap_years_between(y1, y2)
         =  leap_years_from_0(y2) - leap_years_from_0(y1) 
  
  ```
  
  In such a course, the important point is the journey between the problem and the solutions. It is not the exposure of algorithms/programs in there final version.
  
  
  ---
  
  ### Answer by username_7 on 2018-05-27. Score: 0
  
  It is possible to teach algorithms in particular, and a lot about programming in general using a pseudocode. However, the pseudocode needs a firm definition or else it can lead to sloppy thinking. If a student is permitted to make "statements" in the pseudocode that imply, for instance that P=NP, then the statement isn't worth much, nor is the "algorithm" so expressed.
  
  I'll note that [Edsger Dijkstra](https://en.wikipedia.org/wiki/Edsger_W._Dijkstra) wrote most of his papers in pseudocode, but it was carefully defined. [David Gries](https://en.wikipedia.org/wiki/David_Gries) wrote his famous book [The Science of Programming](https://rads.stackoverflow.com/amzn/click/0387964800) using this same pseudocode.
  
  However, each statement in the language (even the empty statement *skip*) was carefully defined using pre and post-conditions so that the effect of the statement and resulting programs were precisely defined. And even the pre and post-conditions are precisely defined.
  
  This language (pseudo-laguage) can be fairly easily translated into other imperative languages, but it is harder to take advantage of the features of other paradigms such as functional or object-oriented.
  
  So, yes, it can be done. It has been done. It has been done by masters. But it isn't a lot easier than using a "real" language. It has quirks, like any language. Some programs are harder than others, of course. It is even possible to write a compiler for Dijkstra's language (I've done so, actually), making execution possible. However, the reason for the language wasn't execution, but precise clarity of expression of algorithms with precise semantics.
  
  One possible problem with learning algorithms this way, however, is the the resulting pseudo-programs tend to be rather monolithic. Complex programs have long statements with lots of structure. The method, if not carefully used, seems to de-emphasize building complex things out of small interacting parts. This isn't inherent in using pseudo-code, but the instructor needs to be careful about the use so that complexity doesn't overwhelm understanding. But the same is true in real languages. Not everything needs to be done in *main*.
  
  
  ---
  
  