Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed PHP User Authentication!
You have completed PHP User Authentication!
Preview
At this point, we have added a lot of new files, some of which have duplicate code. Let’s take some time to refactor them and make our code a little more manageable.
This video doesn't have any notes.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
to extract this out into its own function.
0:00
Refactoring improves the internal
structure of your code
0:01
without changing the external behavior.
0:04
If you find yourself writing the same
thing over and over, it's probably a good
0:07
indication that you have an area of code
that could benefit from refactoring,
0:12
making it easier to maintain that code
in the future in a lot of our files.
0:17
We have three lines that
are repeated all over the place.
0:22
Why don't we extract this into
a redirect you know functions file.
0:25
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up