diff --git a/modules/10-basics/40-instructions/description.en.yml b/modules/10-basics/40-instructions/description.en.yml index a0b7f058..57580b45 100644 --- a/modules/10-basics/40-instructions/description.en.yml +++ b/modules/10-basics/40-instructions/description.en.yml @@ -48,9 +48,7 @@ instructions: | definitions: - name: interpreter description: | - A program executing code in JavaScript + A program executing code in JavaScript - name: Statement description: | - a command given to computer. PHP code is a set of instructions separated (most frequently) by `;`. - - + A command given to computer. JavaScript code is a set of instructions separated (most frequently) by `;`. diff --git a/modules/10-basics/45-testing/description.en.yml b/modules/10-basics/45-testing/description.en.yml index a57bb615..b580ca0b 100644 --- a/modules/10-basics/45-testing/description.en.yml +++ b/modules/10-basics/45-testing/description.en.yml @@ -2,6 +2,7 @@ name: How do we verify solutions? theory: | + Our website verifies your solutions automatically. You may wonder how it works. In the simplest case the system runs your code and analyzes the screen output. Then it compares the actual output against the expected output. @@ -10,7 +11,7 @@ theory: | Let's assume your task is to program a function that adds two numbers. The verification system would give it several combinations of numbers and compare your function's answers with correctly calculated ones. If all actual values match the expected ones, your solution would be considered valid. - This approach is named testing. It is used extensively in the real life day-to-day development process. Developers usually write tests _first_, and only after proceed to writing the program itself. During that process he runs tests multiple time to check how close he got to the desired solution. + This approach is named testing. It is used extensively in the real life day-to-day development process. A developer usually writes tests _first_, and only after proceeds to writing the program itself. During that process he runs tests multiple times to check how close he/she got to the desired solution. That is why our website says “Tests passed” once you solved the task correctly. @@ -18,10 +19,26 @@ theory: |
     ● test
+
     expect(received).toBe(expected) // Object.is equality
+    
     Expected value to be:
       "Hello, World!"
     Received:
       "ello, World!"
   
+ In addition to our tests, it's very useful to experement with code in the console [of a browser](https://developer.mozilla.org/ru/docs/Tools/%D0%9A%D0%BE%D0%BD%D1%81%D0%BE%D0%BB%D1%8C_%D0%B1%D1%80%D0%B0%D1%83%D0%B7%D0%B5%D1%80%D0%B0). In a situation when something isn't clear for you or you want to experiment with code, feel free to do all of this in the console. Ideally, it's best to execute all the code given in the lessons on your own. In addition to console it's also helpful to use the following service [repl.it](https://repl.it/languages/javascript). + +instructions: | + Display the following number: `9780262531962`. + +definitions: + - name: Tests + description: | + code designed to check if a program works correctly; it does so by comparing a set of known valid results against the actual output of the program. +tips: + - | + [jest](http://jestjs.io/) + - | + [TDD](https://ru.wikipedia.org/wiki/Разработка_через_тестирование) diff --git a/modules/10-basics/50-syntax-errors/description.en.yml b/modules/10-basics/50-syntax-errors/description.en.yml new file mode 100644 index 00000000..8baf63bb --- /dev/null +++ b/modules/10-basics/50-syntax-errors/description.en.yml @@ -0,0 +1,33 @@ +--- + +name: Syntax errors +theory: | + If a JavaScript program isn't syntactically correct, interpreter will show a relevant message and a note with a file and line where an error might have occured. **Syntax errors** occur when the code has grammar mistakes. Grammar rules are important in human languages but the lack of it won't affect your ability to read or understand any text. But in programming everything should be strict. Even a tiny violation and your program will not run. A wrong parenthesis order, a `;` that you forgot to add — these are just some examples of such violations. + + Here is an example of code with a syntax error: + + ```javascript + console.log('Hodor' + ``` + + If we run this code we will see the following message: `SyntaxError: missing ) after argument list`. In JavaScript such errors are called "SyntaxError". As we can see it includes a file path and a line number. + + On one hand, syntax errors are the simplest because they are all about code grammar rules and aren't related to any code logic. They can be easily fixed, you just need to find them. + + On the other hand, interpreter will not always tell you the correct position of an error. Sometimes you need to add a forgotten bracket to another place as opposed to what the error message says. + +instructions: | + + This task isn't related to the lesson directly but it would be useful to practice displaying content on the screen anyway. + + Display following text `What Is Dead May Never Die`. + +tips: + - | + [JavaScript errors](https://habr.com/ru/post/249525/) + +definitions: + - name: "Syntax error" + description: "violation of grammar rules in a programming language" + - name: "SyntaxError (Parse error)" + description: "type of errors in JavaScript, which occur when there are syntax errors in the code"