LinkedIn principal author Doug Winnie explains the principles of refactoring code and how updating code can help improve your projects and your skills as a programmer. Refactoring code usually is based on three rationales. The first being improved performance, the second is to better support new features, and the third is to improve legibility of your code.
- Coding is an iterative process.…You'll create code that solves a problem and then,…perhaps weeks or months later,…you'll come back to that same code,…and wonder what you were thinking when you wrote it.…Perhaps you learned a new practice…that makes the code better,…or you overlooked something when you first wrote it.…Regardless of the reason,…when you update your code to make it work better,…you are refactoring it.…Refactoring is a common practice with programming.…As you add new capabilities to your programs,…you'll revisit and update older code.…
The trick with refactoring is to make sure…that any changes you make won't have…adverse affects on the rest of the program.…Take this example.…If I have a program that stores three values,…I might later decide it makes more sense…to store those values in an array.…When I refactor the code,…I set up the values differently as an array.…But I'm only partially done.…Because I need to make sure that…all the old references…to the previous variables are updated.…Otherwise I'll introduce errors into my code.…
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.