It was recently brought back to my attention about a BBC mini-series called “Mastercrafts”. It followed three people in each episode that wanted to become an apprentice to a master of a trade. Something that stuck out about each episode to me is that they always spent time in the environment of their trade. They didn’t have classes, take tests, research things from books, or in any other way avoid beginning to practice the basics of the trade. There was time spent instructing the students, but it was also quite hands-on. That is something I’ve always found to be best for me. I like to get in and work directly with something, in my particular case programming. In a lot of ways, I was able to transfer ideas that the master was using to help train the students from their trade to mine. I have no mater to assist me, but I won’t let that stop me.
The first episode was woodworking, and they spent time in a small forest/woodland area. They had a lathe that they had to power using a pedal. They had to get the basics of being able to keep a steady rhythm with their foot, balance on their other foot, and keep their hands steady as they carefully shaped the piece of wood they were working on. Thankfully I don’t have quite the same level of physical fitness required for what I do, but it did make me think about how they don’t just shape the wood with a tool in their hand, they shape it with their whole body. If their rhythm is off, if the speed isn’t consistent and fast enough without being too fast, the wood could be ruined quickly and they will have to start again. They have to be in it with their entire body and mind. I want to approach programming that way.
I have realized my knowledge of the basics of PHP isn’t consistent, I know some things well, but others are lacking. I’ve spent a lot of time in frameworks because they do a lot of the heavy lifting to let me actually produce and ship things, but I don’t know how they handle things underneath the surface. I don’t think this is required knowledge to be able to do what I do, but I think I’m past the point where I should begin to understand the language itself to better be able to solve problems.
To do this I need a starting point. I have no one to look to, I have no path that is set before me. I could stumble around in the documentation trying to figure out in what order this knowledge needs to be processed in. But a mindful approach will save me time and energy. So I have been going through my projects and looking at what are the common things that I do? What are the top five problems I tend to encounter, and how am I solving them? What is painful about my solution, how can I improve it? Is it unwieldy, unreadable, feels too complex for the problem it solves? The most common thing I have found that I do is iterating over an array of other arrays or objects. That’s where I’m going to focus first. Learn PHP’s internals for handling arrays, objects, and what functions or classes it provides for doing so. I have found in the past that there is a myriad of array functions that can be useful. But what about the ArrayIterator class? Or other iterators? That is my first personal lesson. I plan to read through the documentation and then create a blog post that explains what I’ve found and how I’ve used them instead of doing for or foreach loops.