Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
In this course, I've gone over a number of ways to organize code, starting with classes, then inheritance, and abstraction. And, they all included best practices for naming. Is that all there is to know about organizing code? Of course not. Namespaces are a way of encapsulating classes, functions, and constants in such a way to solve two primary problems faced by authors who write reusable code elements: avoiding naming collisions between your code, internal PHP naming, and third-party code. This happens often with common verbs like save and load.
Namespaces also provide a way to alias, which shortens overly long names that sometimes get created in an attempt to avoid naming collisions. This also improves readability. If you've ever encountered these problems, I definitely recommend checking out namespaces on php.net.
Get unlimited access to all courses for just $25/month.Become a member
61 Video lessons · 105366 Viewers
56 Video lessons · 117088 Viewers
71 Video lessons · 86306 Viewers
131 Video lessons · 41247 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.