Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
After the name of the function, we need opening and closing parentheses. These say whether this function expects to have data passed into it which we'll get to later. In this case, empty parentheses means no, it doesn't. Now that we've created this function, we can call it. So somewhere else a little bit later in the program, I can use the name of the function followed by the empty parentheses and a semicolon.
So whether they use the term functions, modules, subroutines, methods, this idea of treating a block of code as a callable unit inside a larger program is a core feature of all programming languages. It makes your programs easier to write and easier to understand. You can split work among different programmers by giving them different parts to write. Now functions can of course get more complex than basic ones shown here. They might not just perform an operation, but they might return values or they might accept data, and we'll see how to do that next.
Get unlimited access to all courses for just $25/month.Become a member
82 Video lessons · 102013 Viewers
61 Video lessons · 88729 Viewers
71 Video lessons · 72554 Viewers
56 Video lessons · 104200 Viewers
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.
Your file was successfully uploaded.