LinkedIn principal author Doug Winnie explains how functions work to take multiple actions defined in code and give them a name. The function name is then used to alter the program flow, allowing code to go in and out of functions as defined by the programmer. Functions can simplify coding by taking common steps that are repeated in your program and create reusable sections.
- One of the reasons for the invention of computers…was to automate tasks that have…to be repeated multiple times.…So instead of repeating a group of actions…that need to take place, you can simply say…do these steps and they take place.…The way to do this is with functions.…Functions are groups of actions…that the programmer defines and gives a name.…While variables are named values,…functions are named actions.…Let's look at an example.…If I have three actions that regularly take place.…
It might become annoying to constantly…code these commands in my app.…For instance, I might need to perform…some math to calculate a sales total.…We can then take these actions and group them together…as a function and give it a name.…Now every time we need to get that information…we can simply call that function by its name.…After the code starts running,…when it encounters the function name…the program jumps to that function,…enters it and runs the code that is inside.…
At the end, it then returns back to the code…that called the function and it continues on.…
Join Doug Winnie as he explains the principles of programming and helps you connect to core concepts by exploring three ways that programmers perform their jobs. Doug starts by sharing the history of coding and then dives into functions, values, variables, and parameters used to define actions. He covers capturing input from users, creating conditional tests, using loops with arrays, and object-oriented programming basics. He also takes you beyond programming, into processes like debugging, refactoring, and building iteratively.
- Working with values and variables
- Breaking down tasks
- Customizing functions and parameters
- Building conditional tests
- Creating and changing arrays
- Working with objects and classes
- Debugging and refactoring code
- Going beyond the code as a programmer
Skill Level Beginner
1. Control Computers with Code
2. Define Actions Using Code
3. Repeat Actions and Test for Conditions
4. Objects and OOP
5. Beyond Programming
Debug problems2m 50s
Next steps1m 19s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.