Have you ever wondered what goes on inside those colorful blocks of code you’ve been using? Well, they’re actually made up of JavaScript commands! JavaScript is one of the most popular programming languages used by professional developers around the world. Many top universities, like Harvard and Berkeley, use block-based coding to introduce students to programming because it’s a fun and easy way to start learning.
Once you get the hang of the basics, programmers usually switch to typing out their code. Why? Because it’s faster! Imagine being able to type hundreds of commands without having to search for them in a toolbox or drag them around. While typing might seem slow at first, it’s a skill worth practicing. It helps you become a more efficient coder.
In your coding workspace, there’s a “Show Text” button in the upper right corner. Clicking it lets you switch from block-based coding to typing out your code as text. In upcoming lessons, you’ll start using this typing mode. You can still drag blocks from the toolbox if you want, but you can also type the command names directly. As you type, suggestions for possible commands will appear below your typing area. You can select one of these suggestions to save time.
Autocomplete is a handy feature that many programmers, including myself, use all the time. It helps you by suggesting command names as you type, so you don’t have to remember every detail. However, when typing code, you need to be very precise. This means spelling and capitalizing command names correctly, and including all necessary symbols like parentheses and semicolons. Even a tiny mistake can confuse the computer, and it won’t be able to run your code.
If you make a mistake, don’t worry! The code editor will highlight the error for you, so you can fix it. If you’re really stuck, you can always hit the “Start Over” button to reset your work. And remember, you can switch back to block mode anytime by clicking in the top right corner.
Let’s give typing a try! Don’t get frustrated if you make mistakes—it’s all part of the learning process. Everyone needs a few tries to get it right, so keep practicing and have fun with it!
Explore the JavaScript code editor and find as many different commands as you can. Write down what each command does. This will help you become familiar with the commands and their functions. Try to find at least 10 different commands!
Take a simple block-based program and convert it into text-based JavaScript code. Use the “Show Text” button to switch views and type out the code. Compare your text code with the block code to see if they match.
Practice using the autocomplete feature by typing out JavaScript commands. Start typing a command and see what suggestions appear. Try to complete a small program using only the autocomplete suggestions.
Work with a partner to intentionally create errors in a JavaScript program. Swap programs and race to see who can fix the errors the fastest. Use the error highlights to guide you in finding and correcting mistakes.
Set a timer for 10 minutes and practice typing out JavaScript commands without using blocks. Focus on accuracy and speed. Keep track of how many commands you can type correctly within the time limit.
Here’s a sanitized version of the provided YouTube transcript:
—
Inside the blocks we’ve been using are JavaScript commands. JavaScript is the most popular programming language for professional developers today. Blocks are a great way to get started learning to code, and in fact, top universities like Harvard and Berkeley start teaching this way.
However, once we’ve learned the basics, engineers write code by typing because it allows us to go faster. We can type hundreds of commands without having to find them in the toolbox or drag them out. While you’re learning, typing may be slower at first, but we encourage you to give it a try.
In the upper right corner of your workspace, you can click the “Show Text” button on any puzzle to switch from blocks to typing code as text. In the next lesson, we’ll start you out in typing mode. Here, you can still drag the block from the toolbox, or you can type the command name. As you start to type, you’ll see names of possible commands show below where you’re typing. Instead of typing the whole command name, you can select one of these to move faster.
In my job, I use this autocomplete feature all the time when writing code. When you’re typing code, the computer needs you to be very precise. You need to spell and capitalize the command name exactly, including the parentheses and the semicolon. Even with a small typing mistake, the computer may not understand the code and won’t be able to execute it.
When you make an error on a line, the editor highlights it for you so that you can try changing your text to fix it. If you get stuck, you can always start over with the “Start Over” button, and you can switch back to block mode at any time by clicking in the top right corner.
Okay, let’s give typing a try, and if you make mistakes, don’t get frustrated. It takes everyone a few tries to get it right.
—
This version maintains the original meaning while removing any unnecessary or informal elements.
Javascript – A programming language commonly used to create interactive effects within web browsers. – Example sentence: Many websites use Javascript to make their pages more dynamic and engaging for users.
Coding – The process of writing instructions for a computer to perform specific tasks. – Example sentence: Coding can be a fun way to solve problems and create new applications.
Commands – Instructions given to a computer program to perform a specific action. – Example sentence: In coding, you use commands to tell the computer what to do next.
Programmers – People who write and test code to create software programs. – Example sentence: Programmers often work in teams to develop complex applications.
Autocomplete – A feature in coding editors that predicts and suggests the completion of a word or line of code. – Example sentence: Autocomplete helps speed up the coding process by reducing the amount of typing needed.
Mistakes – Errors in the code that can cause a program to not work as intended. – Example sentence: Debugging is the process of finding and fixing mistakes in the code.
Editor – A software tool used for writing and editing code. – Example sentence: Many programmers use a code editor to write and organize their code efficiently.
Typing – The act of inputting text or code into a computer using a keyboard. – Example sentence: Good typing skills can help you write code more quickly and accurately.
Blocks – Sections of code grouped together that perform a specific function. – Example sentence: In some programming languages, blocks of code are defined by indentation or braces.
Learning – The process of acquiring knowledge or skills, especially in coding and computer science. – Example sentence: Learning to code can open up many opportunities in the technology field.