<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Doomed Ventures</title><link>https://doomed.ventures/</link><description>Writing, projects, and other nonsense.</description><language>en-us</language><lastBuildDate>Tue, 18 Apr 2023 13:45:40 -0400</lastBuildDate><atom:link href="https://doomed.ventures/feeds/feed.rss.xml" rel="self" type="application/rss+xml"/><item><title>Nutrition, Performance, and Weight Loss: A Reflection</title><link>https://doomed.ventures/posts/nutrition-performance-weight-loss-reflection/</link><guid>https://doomed.ventures/posts/nutrition-performance-weight-loss-reflection/</guid><pubDate>Tue, 18 Apr 2023 13:45:40 -0400</pubDate><category>fitness</category><description>&lt;p&gt;I&amp;rsquo;ve been working with a nutrition and performance coach (the amazing &lt;a href="https://www.blackironnutrition.com/morgan-voz"&gt;Morgan Voz&lt;/a&gt;) since last summer, and at the start of 2023 we embarked on a weight cut - a deliberate effort to get leaner by lowering my body fat percentage. When we started on January 1st of this year I weighed in at 207 pounds, and when we stopped I was right at 189 pounds. Here are some reflections going through that process.&lt;/p&gt;&#10;&lt;p&gt;When we started in January, I was eating around 3300 calories a day and by the end my total daily caloric intake was around 2200. That sounds like a lot, but we did this by gradually decreasing 100-200 calories every couple of weeks rather than crash dieting. I think the primary result of this is that throughout the last four months I cannot really recall any instances where I was absolutely starving throughout the day.&lt;/p&gt;&#10;&lt;p&gt;My performance in the gym (in addition to the nutrition coaching, I&amp;rsquo;ve been doing powerlifting four days a week) actually &lt;em&gt;improved significantly&lt;/em&gt; during the cut. While I lost about 18 pounds in total, I still added to my one-rep maxes on all three main lifts on top of significantly improving my overall work capacity - I was comfortably repping my old one-rep max for 2-3 reps, and sometimes 5. This was one of the bigger surprises for me, because I think the popular wisdom is either you&amp;rsquo;re bulking and getting stronger or cutting and settling for becoming weaker. Perhaps this is true for folks with a higher training age, but I continued to gain strength while losing weight throughout the process.&lt;/p&gt;&#10;&lt;p&gt;There were effectively no hard restrictions on what I could actually eat during this process, which I think also contradicts the established lore that while cutting, the only thing you eat is chicken breast, steamed broccoli, and white rice. (To be fair, I did eat a lot of that.) Other than remaining within +/- 5 grams of my protein, carb, and fat macro targets, we focused on getting 2 servings each of fruit and vegetables per day and trying to mainly eat food I prepared myself (because while restaurants often do provide nutrition info, there&amp;rsquo;s no guarantee it&amp;rsquo;s actually prepared that way).&lt;/p&gt;&#10;&lt;p&gt;Those guidelines meant that my food choices tended to evolve towards fewer processed / fast food options and more single-ingredient choices. It was sort of like Tetris for me: knowing that I only had so much &amp;ldquo;space&amp;rdquo; to fit foods in, a fast food meal became a lot less appealing since it meant I could be using up half of my fat budget for that day (or more). Sugars were another item that I naturally evolved away from - I was getting most of my carbs from fruits and vegetables by the end of the cut, and it sort of re-adjusted my taste for sweetness (a McDonald&amp;rsquo;s Sprite would likely kill me instantly at this point).&lt;/p&gt;&#10;&lt;p&gt;Overall, the end result is something I&amp;rsquo;m really satisfied with - I definitely look different in terms of body composition (I turned 37 this year, and many folks have commented that I look way younger) which is a nice thing, but the thing that really excites me is how my ability to perform in and out of the gym has improved. I love the fact that I&amp;rsquo;m not just moving more weight than I was at the beginning of the year, but that I&amp;rsquo;m doing so almost 20 pounds lighter.&lt;/p&gt;&#10;&lt;p&gt;My personal power-to-weight ratio has improved a lot and made me a much more effective athlete, which carries into many more dimensions of my life than just looking leaner does: I don&amp;rsquo;t actually do any regular cardio work, but my blood pressure and resting heart rate are both a lot better than they were before. I went on a hike with some friends and they commented that next time, they&amp;rsquo;re going to make me wear a backpack full of weights in order to keep up with me. Possibly counter-intuitively to folks that have a particular image of &amp;ldquo;powerlifter&amp;rdquo; in their mind, my flexibility and overall mobility is better than it ever has been as well. Between having good mobility and an overall stronger body, I&amp;rsquo;m shrugging off and avoiding the kinds of nagging aches, pains, and injuries that start to plague folks around my age.&lt;/p&gt;&#10;&lt;p&gt;I think for me at least, having not just the expertise but the support of a fantastic coach was well worth it - there&amp;rsquo;s an overwhelming amount of info about nutrition and performance online, and I personally found it hard to figure out where to start. Working with someone who&amp;rsquo;s got deep expertise on how to keep an athlete fueled but can also explain the science behind it all and give you moral support when things feel tough absolutely made the difference for me, and I&amp;rsquo;d recommend it to anyone else.&lt;/p&gt;&#10;</description></item><item><title>Things that improved my life in 2022</title><link>https://doomed.ventures/posts/things-i-changed-in-2022/</link><guid>https://doomed.ventures/posts/things-i-changed-in-2022/</guid><pubDate>Sat, 31 Dec 2022 00:00:00 +0000</pubDate><category>fitness</category><description>&lt;p&gt;Some notes on changes I made in 2022 that materially improved my life as we go into 2023.&lt;/p&gt;&#10;&lt;h2 id="get-serious-about-strength-and-fitness"&gt;Get serious about strength and fitness&lt;a class="anchor" href="#get-serious-about-strength-and-fitness" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;There&amp;rsquo;s already a wealth of information on why strength training is one of the best things you can do for your health (physical and mental). As Mark Rippetoe (author of Starting Strength) says, &amp;ldquo;strong people are harder to kill and are more useful in general.&amp;rdquo;&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;The changes in my physique from proportionally higher muscle mass mean that it&amp;rsquo;s easier to find clothes that fit well and in general I feel more confident in my appearance. Probably obvious to most folks, but one thing that did surprise me - improvements to my posture mean that multiple people in my life have commented that I seem taller than before.&lt;/li&gt;&#10;&lt;li&gt;Strength training is extremely beneficial for your cardiovascular health (I do essentially no traditional cardio like running). Before training regularly, my blood pressure at the start of the pandemic was high enough to be &amp;ldquo;pre-hypertensive&amp;rdquo;, and since then it&amp;rsquo;s come down to the &amp;ldquo;athletes and children&amp;rdquo; range (100/65).&lt;/li&gt;&#10;&lt;li&gt;Training using RPEs and one-rep maxes builds tremendous mental toughness and grit. Being able to push yourself through discomfort and exhaustion is a requirement for truly hitting an RPE10 attempt with nothing left in the tank, and that grit has a lot of carry over into difficult situations outside of the gym.&lt;/li&gt;&#10;&lt;li&gt;Having stronger bones, muscles, and tendons makes me more confident in general in my day-to-day life, but it also means that I&amp;rsquo;m shrugging off the kinds of minor nagging injuries that are pretty common in your mid 30s and beyond. I stepped in a hole while cutting the grass and completely rolled my ankle, and it didn&amp;rsquo;t result in an injury at all. Physical strength is highly correlated with vitality and longevity in later life, too.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Resources that were crucial for me on this journey:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;A coach! I work with the phenomenal &lt;a href="https://www.blackironnutrition.com/morgan-voz"&gt;Morgan Voz&lt;/a&gt; on nutrition and performance coaching, and having experts guide me through what and how much I should be eating and when and how I should be training has made a huge difference for me. I started out trying to use books and online resources, and there&amp;rsquo;s simply too many resources out there in my opinion - having a pro cut the signal from the noise has been a huge win.&lt;/li&gt;&#10;&lt;li&gt;Meal prepping. Your kitchen activity is equally important as your gym activity in training, and I generally used to be someone who would eat out or order in multiple times a week. I now take a couple hours on Sunday to bulk prep meals (I use the recipes from &lt;a href="https://mealprepmanual.com/"&gt;The Meal Prep Manual&lt;/a&gt;, of which many are free but the paid membership is well worth it) and can ensure that throughout the week I have plenty of high protein, nutrient dense options for meals with lots of vegetables that just need to be microwaved. During a bulking phase I&amp;rsquo;m eating ~3400 calories a day, and it would simply be impossible for me to cook enough every day to hit those goals and still be eating healthy food (plus, I save a ton of money this way).&lt;/li&gt;&#10;&lt;li&gt;There are a ton of resources online for learning how to execute lifts correctly (I train as a powerlifter, so for me that&amp;rsquo;s the squat/bench/deadlift) and it&amp;rsquo;s kind of overwhelming. The guides that ultimately helped me with my technique the most were &lt;a href="https://www.youtube.com/watch?v=MBbyAqvTNkU"&gt;Alan Thrall&amp;rsquo;s deadlift tutorial&lt;/a&gt;, &lt;a href="https://www.youtube.com/watch?v=w0XBfuCC2WM"&gt;Calgary Barbell&amp;rsquo;s bench press tutorial&lt;/a&gt;, and &lt;a href="https://www.youtube.com/watch?v=J_ekvFybels"&gt;Calgary Barbell&amp;rsquo;s squat video&lt;/a&gt;.&lt;/li&gt;&#10;&lt;li&gt;A desk treadmill. I work at a computer all day, and getting 8,000 to 10,000 steps in per day despite that has been a huge bonus for my overall health (by increasing my total daily energy expenditure) but the constant movement has also greatly improved &lt;a href="https://www.instagram.com/p/Cl3yb8VLZxP/"&gt;my ability to recover&lt;/a&gt; from training, so that I&amp;rsquo;m generally not sore at all between lifting sessions. I have the &lt;a href="https://www.amazon.com/Sunny-Health-Fitness-Walkstation-SF-T7945/dp/B07ZQSWW43/"&gt;Sunny Walkstation&lt;/a&gt; which is pretty decent, but if you aren&amp;rsquo;t stuck in front of a computer for work it&amp;rsquo;s easy enough to just go on more walks.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h2 id="be-more-deliberate-about-where-i-spend-my-attention"&gt;Be more deliberate about where I spend my attention&lt;a class="anchor" href="#be-more-deliberate-about-where-i-spend-my-attention" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;In 2022 I spent a lot of time thinking about things I want to achieve and where I could get more time to achieve them. What I realized was how much time I was ultimately spending on activities that really weren&amp;rsquo;t benefitting me at all:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;I quit all forms of social media cold turkey in mid-2022 and it&amp;rsquo;s been a huge improvement for my life overall. An excellent argument for why you might want to do this yourself is made in Max Fisher&amp;rsquo;s book &amp;ldquo;The Chaos Machine&amp;rdquo; (you can hear him talk about it on the Rich Roll podcast &lt;a href="https://open.spotify.com/episode/0p3pInuGex2KhG2enHF3OX?si=4c2ded72a8014b07"&gt;here&lt;/a&gt;), but for me I realized that Twitter, Reddit, and so on are incentivized to show me things that piss me off or upset me in order to maximize engagement. Not being hooked up to a perpetual drip feed of outrage in the form of a social media feed has done wonders for my general feelings about the world.&lt;/li&gt;&#10;&lt;li&gt;In terms of other relationships (like group chats, casual Slack channels, etc) I also did a personal audit of those and realized that many of the slack channels I&amp;rsquo;m in are largely just open forums for venting and complaining and weren&amp;rsquo;t really giving me anything either. I made a conscious effort to focus more of my personal time on the more meaningful interactions in my life - I stopped reading through the less useful Slack forums and spent more time in chats with friends where more meaningful discussion happens.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;With the time I&amp;rsquo;m saving on less useful activities, I&amp;rsquo;m spending more time on:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Reading - I&amp;rsquo;ve read a ton of fantastic books in 2022 that have changed the way I think about things or greatly entertained me, and reading continues to be a fantastic use of my free time.&lt;/li&gt;&#10;&lt;li&gt;I&amp;rsquo;ve found a lot more time to work on side projects, keeping my skills up to date, and learning about entrepreneurship.&lt;/li&gt;&#10;&lt;li&gt;When it comes to more &amp;ldquo;passive&amp;rdquo; media, I&amp;rsquo;m trying to spend less time on sites like Youtube and more time listening to interesting ideas in podcasts.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h2 id="stop-drinking-alcohol"&gt;Stop drinking alcohol&lt;a class="anchor" href="#stop-drinking-alcohol" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;I don&amp;rsquo;t think I&amp;rsquo;ve ever been a particularly heavy drinker, but throughout the pandemic my drinking definitely increased a noticeable amount. Early in 2022 as I was getting more serious about training, I realized that not only was I gaining nothing from the recreational act of drinking, but that there&amp;rsquo;s more and more science supporting the idea that there is no &amp;ldquo;safe&amp;rdquo; amount of alcohol to consume - so I quit drinking cold turkey.&lt;/p&gt;&#10;&lt;p&gt;This has done a lot for my overall health (likely contributing to the drop in my blood pressure and better sleep) and I&amp;rsquo;ve found that I don&amp;rsquo;t really miss it at all. For the times that I do find myself wanting the taste of a beer, the non-alcoholic market has come a long way and there are plenty of NA brews available that are actually quite good.&lt;/p&gt;&#10;</description></item><item><title>Four things a new manager should practice</title><link>https://doomed.ventures/posts/four-things-new-managers-should-practice/</link><guid>https://doomed.ventures/posts/four-things-new-managers-should-practice/</guid><pubDate>Sun, 04 Dec 2022 00:00:00 +0000</pubDate><category>management</category><description>&lt;p&gt;One of the hard parts about management is that many folks end up there by accident. Very often, folks are told &amp;ldquo;you&amp;rsquo;re a high performing individual contributor, so you will clearly have an easy time becoming a manager of other individual contributors.&amp;rdquo; While it&amp;rsquo;s true that &lt;a href="https://www.inc.com/jeff-haden/37-years-ago-steve-jobs-said-best-managers-never-want-to-be-a-manager-science-says-he-was-right.html"&gt;many of the best managers&lt;/a&gt; are &lt;a href="https://hbr.org/2016/12/if-your-boss-could-do-your-job-youre-more-likely-to-be-happy-at-work"&gt;fantastic individual contributors&lt;/a&gt;, the process of becoming a great manager is often fraught with trial and error for many folks.&lt;/p&gt;&#10;&lt;p&gt;I&amp;rsquo;ve done the transition from IC to manager (in both directions) at nearly every software job I&amp;rsquo;ve had, and this guide is an attempt to lay out some of the things that I wish I knew when I was doing it for the first time. The craft of management (and management is a craft, just like programming) is vast and you could spend your whole life learning and improving at it, but I believe these four practices will be the best bang for the buck in terms of setting new managers up for success.&lt;/p&gt;&#10;&lt;p&gt;TLDR:&lt;/p&gt;&#10;&lt;ol&gt;&#10;&lt;li&gt;The most important thing is setting expectations.&lt;/li&gt;&#10;&lt;li&gt;Don&amp;rsquo;t wait until performance reviews to give feedback.&lt;/li&gt;&#10;&lt;li&gt;The truth is almost always better than what you think someone wants to hear.&lt;/li&gt;&#10;&lt;li&gt;Don&amp;rsquo;t make too many promises, keep the ones that you do.&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;h2 id="set-expectations-early-and-clearly"&gt;Set expectations early and clearly&lt;a class="anchor" href="#set-expectations-early-and-clearly" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;I think the most common thing that trips new managers up is a failure to correctly set expectations. I don&amp;rsquo;t mean this in a colloquial kind of &amp;ldquo;there&amp;rsquo;s a new sheriff in town&amp;rdquo; kind of way - literally, a critical factor in your directs&amp;rsquo; ability to succeed and feel good about their work will be how well they understand what is expected of them in their role. As the primary agent through which your directs interact with their employer, that means you&amp;rsquo;re responsible for ensuring this.&lt;/p&gt;&#10;&lt;p&gt;As you&amp;rsquo;re stepping into a new role, you should be thinking about the role of each of your direct reports and thinking about what your expectations are for them - the type of work they&amp;rsquo;re doing, how they&amp;rsquo;re doing it, etc. You might expect a more senior engineer to be an active participant in the planning process or to be working with the more junior folks on coaching and mentorship, and you might expect someone who&amp;rsquo;s newer in their role to be proactive in seeking feedback or guidance. Write all of this down and in an early 1:1 with your directs, talk it through with them.&lt;/p&gt;&#10;&lt;p&gt;Your company&amp;rsquo;s engineering ladder (if it exists) is a great resource to draw on, because you want to avoid situations when an employee&amp;rsquo;s manager expects things from them that are far removed from what the company as a whole expects from them. In the most basic terms, if your expectations are very different from what the organization requires for a promotion that&amp;rsquo;s likely to result in stress and confusion.&lt;/p&gt;&#10;&lt;p&gt;The manager/direct report relationship very frequently breaks down when there isn&amp;rsquo;t clarity on what&amp;rsquo;s expected of a person in their role. People can become discouraged or stressed when they aren&amp;rsquo;t sure how to tell if they&amp;rsquo;re meeting expectations or doing a good job and this can lead to fear, stress, and a lack of confidence. In contrast, when people have a clear understanding of what their manager&amp;rsquo;s expectations are and how well they&amp;rsquo;re doing at work they&amp;rsquo;ll find it much easier to demonstrate autonomy and ownership in their work.&lt;/p&gt;&#10;&lt;p&gt;This is, in my opinion, one of the most important things a manager can do and even experienced managers can sometimes neglect this practice. It sounds simple on paper, but I&amp;rsquo;d encourage you to think back to how many times you might have felt unsure of what your manager expects of you and how that made you feel.&lt;/p&gt;&#10;&lt;h2 id="dont-surprise-folks"&gt;Don&amp;rsquo;t surprise folks&lt;a class="anchor" href="#dont-surprise-folks" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;One of the most important things you can do as a new manager is to build a habit of providing feedback early and often to folks. As someone&amp;rsquo;s peer or teammate, it can often feel intimidating or overbearing to provide unsolicited feedback - but as a manager, it&amp;rsquo;s critical.&lt;/p&gt;&#10;&lt;p&gt;You should be meeting with your new direct reports on a weekly basis for at least 30 minutes, and it&amp;rsquo;s important to build a habit early on of providing some kind of feedback to your directs each week. You need to be close enough to the work that your team is doing to be able to provide real, tangible feedback. The trap that managers (even managers who&amp;rsquo;ve been doing it for years) fall into is to save the feedback until the performance reviews are written, whereupon people are reading through a bunch of comments that they&amp;rsquo;ve never heard before and have no idea how to respond.&lt;/p&gt;&#10;&lt;p&gt;Giving feedback in smaller, more frequent bites makes it easier for people to respond and react. These are your opportunities for helping to guide folks onto the right path before issues grow too large, but they&amp;rsquo;re also a critical tool for encouragement - &amp;ldquo;avoid doing this&amp;rdquo; and &amp;ldquo;it was really good when you did that&amp;rdquo; are both powerful tools for performance management. If you&amp;rsquo;re doing a good job of this, every quarterly or annual performance review you write should be basically a formality: you should strive for frequent enough feedback that there is nothing you could put into a performance review that would surprise the person who&amp;rsquo;s reading it.&lt;/p&gt;&#10;&lt;p&gt;If this isn&amp;rsquo;t a habit you already have from coaching your peers, you&amp;rsquo;ll want to learn how to give good feedback. The best source I&amp;rsquo;ve personally found for that is the great book &lt;a href="https://www.stoneandheen.com/thanks-feedback"&gt;Thanks for the Feedback&lt;/a&gt;. I highly recommend reading this one to learn how to give constructive feedback, and how to also make giving constructive criticism less of a scary proposition.&lt;/p&gt;&#10;&lt;h2 id="tell-the-truth"&gt;Tell the truth&lt;a class="anchor" href="#tell-the-truth" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;When you&amp;rsquo;re thrust into a new management role with folks looking to you for answers, there&amp;rsquo;s a temptation to try and hide how little you might actually know: the sad reality is that your manager is certainly privy to information you don&amp;rsquo;t have, but not all-knowing. You will be asked lots of questions that you do not have the answers to, and your job in those scenarios is to admit to it!&lt;/p&gt;&#10;&lt;p&gt;When one of your directs asks you a question that you don&amp;rsquo;t have the answer to, don&amp;rsquo;t make something up or speculate too much - this is especially important for performance questions. Trying to essentially guess the answer to the question &amp;ldquo;why didn&amp;rsquo;t I get promoted this cycle&amp;rdquo; can be harmful to your relationship with that person, and doubly so if you find yourself telling them what you think will make them feel better regardless of how true it is.&lt;/p&gt;&#10;&lt;p&gt;As a software engineer you likely get asked multiple times a week how to do something you don&amp;rsquo;t already know how to do, and your success in that role has probably been the result of a willingness to say &amp;ldquo;I don&amp;rsquo;t have the answer, but I can figure it out.&amp;rdquo; You should take this same approach with your directs - admit that you don&amp;rsquo;t have the answers or information, but make a commitment to find the answers. In the promotion example, it&amp;rsquo;s generally healthier to say that you don&amp;rsquo;t have the exact reasons why they might have been passed over for a promotion but that you can find out - and then actually go do that so you can let them know.&lt;/p&gt;&#10;&lt;p&gt;The flip side to this is that maybe you actually do know why they were passed over for promotion. Whenever you can do so (and as a manager, you will ultimately be privy to information that you can&amp;rsquo;t share with the team), being honest is the best policy. Put yourself in their shoes - as a high performer who&amp;rsquo;s really working hard toward a promotion, would you rather hear that a promotion &amp;ldquo;just wasn&amp;rsquo;t in the budget this year&amp;rdquo;, or would you prefer to know that there were specific skills that you ought to be working on?&lt;/p&gt;&#10;&lt;h2 id="keep-the-promises-that-you-make"&gt;Keep the promises that you make&lt;a class="anchor" href="#keep-the-promises-that-you-make" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The temptation to be a people-pleaser looms large for most folks in software engineering management roles, and a trap that many new managers fall into is either making too many promises they can&amp;rsquo;t possibly keep or not following through on the promises that they make.&lt;/p&gt;&#10;&lt;p&gt;Don&amp;rsquo;t make promises unless you&amp;rsquo;re positive that you can keep them. When it comes to promotions, raises, team reassignments, and similar things that are not 100% within your power to control you shouldn&amp;rsquo;t ever give the opposite impression.&lt;/p&gt;&#10;&lt;p&gt;You absolutely should be proactive on working with your directs on their promotion packets or making the case for a bump in their compensation. But in that 1:1 when your direct tells you how important it is to them to get that new job title, it can be all to easy to want to make them happy and give the impression that it&amp;rsquo;s a sure thing and will definitely happen (or worse, will definitely happen &lt;em&gt;if&lt;/em&gt; they do X, Y, and Z this quarter). Instead, it&amp;rsquo;s better to explain how the process works and how the two of you will work together to make that case so that the likelihood of it happening is high.&lt;/p&gt;&#10;&lt;p&gt;On the flip side, when you do make promises as a manager it&amp;rsquo;s incredibly important to your directs that you keep them. In general, I don&amp;rsquo;t even mean promising that someone is going to get a raise or a promotion - every time you tell your directs in a 1:1 that you&amp;rsquo;ll look into something or follow up with them about a thing you were talking about, that is a promise! These can seem like such small things that nobody will really care if you don&amp;rsquo;t follow through, but the effect compounds over time - if you make a habit of not following through on even the small things, you might be surprised months later to find out that your directs don&amp;rsquo;t trust you.&lt;/p&gt;&#10;&lt;h2 id="some-other-useful-tidbits-and-resources"&gt;Some other useful tidbits and resources&lt;a class="anchor" href="#some-other-useful-tidbits-and-resources" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The three points above (in my experience) will get you pretty dang far towards building a solid and effective managerial foundation. Here are a few other resources and small notes:&lt;/p&gt;&#10;&lt;h3 id="books"&gt;Books&lt;a class="anchor" href="#books" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;There are a ton of management books in general out there and for a while I was reading as many as I could get my hands on. Fortunately, the list of books I found to be actually valuable is pretty short (non-affiliate links below):&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="https://bookshop.org/p/books/extreme-ownership-how-u-s-navy-seals-lead-and-win-jocko-willink/8967655?ean=9781250183866"&gt;Extreme Ownership by Jocko Willink&lt;/a&gt;. I initially thought I would hate this book given all the rah-rah military machismo, but it turned out to be a succinct and useful introduction to what it means to be accountable as a leader without being a micromanager. I read it as part of my first management role and it influences how I think about leading to this day.&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://bookshop.org/p/books/first-break-all-the-rules-what-the-world-s-greatest-managers-do-differently-gallup/594575?ean=9781595621115"&gt;First Break All The Rules&lt;/a&gt;. This book is the result of Gallup research into &amp;ldquo;the world&amp;rsquo;s best managers.&amp;rdquo; A lot the findings here will likely surprise you if you&amp;rsquo;re new to management, but if all you take away from this is the importance of making sure your directs know what you expect of them it&amp;rsquo;ll be worth it.&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://bookshop.org/p/books/turn-the-ship-around-a-true-story-of-turning-followers-into-leaders-l-david-marquet/7678377?ean=9781591846406"&gt;Turn the Ship Around by L. David Marquet&lt;/a&gt;. In the long-term, a great leader is continutally cultivating new leaders out of their team - managers who fail to do this are the ones who end up overwhelmed with work and with teams that resent them. This is a great resource on how to achieve that &amp;ldquo;empowerment&amp;rdquo; that the MBAs are always talking about.&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://bookshop.org/p/books/nonviolent-communication-a-language-of-life-life-changing-tools-for-healthy-relationships-marshall-b-rosenberg/10180253?ean=9781892005281"&gt;Nonviolent Communication by Marshall Rosenberg&lt;/a&gt;. You are going to be having a lot of difficult conversations as a manager - this book will help you navigate those. Crucial Conversations is another book that lots of folks rightly recommend, but I personally found Nonviolent Communication to be the more useful resource. You probably can&amp;rsquo;t go wrong with either one.&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://bookshop.org/p/books/radical-candor-be-a-kick-ass-boss-without-losing-your-humanity-kim-scott/8486942?ean=9781250235374"&gt;Radical Candor&lt;/a&gt;. I&amp;rsquo;m going to suggest that you leave this one for last - the material in here is really important (and indeed, has probably influenced my everyday work life more than the other books) but way too many people will skim this book and use &amp;ldquo;being radically candid&amp;rdquo; as an excuse to be an asshole. Make sure that you either read the whole thing or skip it.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h3 id="other-tidbits"&gt;Other tidbits&lt;a class="anchor" href="#other-tidbits" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;&#10;&lt;li&gt;If you don&amp;rsquo;t have a personal organization system of some kind, you&amp;rsquo;re going to want to develop one. As a manager, your time is going to naturally start to become more fragmented and interrupt-driven and you&amp;rsquo;re going to need a way to keep track of the legions of little things that you need to pay attention to. I use &lt;a href="https://gettingthingsdone.com/"&gt;GTD&lt;/a&gt; - do not underestimate the power of keeping a to-do list up to date.&lt;/li&gt;&#10;&lt;li&gt;I typically schedule 1:1s for 30 minutes weekly at a minimum. Having a good 1:1 is a long topic, but some short rules: don&amp;rsquo;t use 1:1s for status updates, let your directs drive the agenda, and try to listen more than you talk (great tool for this: when someone asks you a question about how to proceed in some situation, ask them what they think before you answer).&lt;/li&gt;&#10;&lt;li&gt;Don&amp;rsquo;t ever cancel a 1:1 if you can help it. Your 1:1s with your directs will become an important part of the relationship they have with you and their work - treat them as important. It sends a bad message to your team if their 1:1s are frequently canceled or rescheduled because &amp;ldquo;you&amp;rsquo;re too busy&amp;rdquo;.&lt;/li&gt;&#10;&lt;li&gt;Build a network of other managers and talk to them a lot. Your peer managers will be who you&amp;rsquo;re working with a lot to get things done, but they&amp;rsquo;re also going to generally be one of the only places you can kind of vent and let off steam about all the ways in which being a manager is hard.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h2 id="closing-thoughts"&gt;Closing thoughts&lt;a class="anchor" href="#closing-thoughts" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Management is tough, and most industries need more people who actually want to be a manager. It&amp;rsquo;s an important thing to be able to admit to yourself that management isn&amp;rsquo;t for you, or that maybe this isn&amp;rsquo;t the right time for you to become a manager - I&amp;rsquo;ve done this myself many times. Becoming a manager is no longer the only way to continue advancing your career at most companies, and you will do better by yourself and your team not to force yourself to stick around in a role that you hate.&lt;/p&gt;&#10;&lt;p&gt;Whether you decide to stick around in management or not, I hope that these tips can make that experience fulfilling and less scary for you.&lt;/p&gt;&#10;&lt;p&gt;Good luck!&lt;/p&gt;&#10;</description></item><item><title>Use Slack. Not too much. Mostly like email.</title><link>https://doomed.ventures/posts/use-slack-not-too-much/</link><guid>https://doomed.ventures/posts/use-slack-not-too-much/</guid><pubDate>Sat, 29 Aug 2020 14:30:22 -0400</pubDate><category>software</category><category>remote work</category><description>&lt;p&gt;As many of us are making a swift transition to fully-remote work, I&amp;rsquo;ve been thinking lately about how we communicate in a distributed world. If you work in tech, &amp;ldquo;how we communicate&amp;rdquo; probably means &amp;ldquo;we just kind of pile into Slack and hope for the best.&amp;rdquo;&lt;/p&gt;&#10;&lt;p&gt;If your work requires any amount of uninterrupted focus, then you&amp;rsquo;re probably already familiar with the challenges that Slack can represent. When you and all your coworkers are in the office together, you&amp;rsquo;ve got to get up from your desk and walk over to the person you need to talk to and maybe do the awkward attention dance if they&amp;rsquo;re wearing headphones. I believe that without being deliberate in how you and your teammates use Slack, the best case is a virtual version of people showing up at your desk all day long - and the worst case is something that takes a severe toll on your ability to focus.&lt;/p&gt;&#10;&lt;p&gt;I&amp;rsquo;m going to detail some of the strategies I&amp;rsquo;ve been using lately to reduce interruptions, communicate more clearly, and make Slack a better tool. In a nutshell, I believe that treating Slack more like email makes it a much more manageable tool - here&amp;rsquo;s how I do that.&lt;/p&gt;&#10;&lt;p&gt;&lt;em&gt;I&amp;rsquo;m going to refer to Slack here as a stand-in for basically any instant messaging solution, not because Slack is somehow fundamentally worse than any other similar tool.&lt;/em&gt;&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#provide-as-much-up-front-context-as-you-can"&gt;Provide as much up-front context as you can.&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#make-it-clear-when-you-need-a-response"&gt;Make it clear when you need a response.&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#set-expectations-around-when-you-can-respond"&gt;Set expectations around when you&amp;rsquo;ll respond.&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#conclusion"&gt;Conclusion&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h2 id="provide-as-much-up-front-context-as-you-can"&gt;Provide as much up-front context as you can&lt;a class="anchor" href="#provide-as-much-up-front-context-as-you-can" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;You&amp;rsquo;ve probably been a part of many Slack conversations that go like this:&lt;/p&gt;&#10;&lt;blockquote&gt;&#10;&lt;p&gt;&lt;strong&gt;Statler&lt;/strong&gt;: 👋&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;Waldorf&lt;/strong&gt;: &lt;em&gt;[some minutes later]&lt;/em&gt; Hello.&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;Statler&lt;/strong&gt;: &lt;em&gt;[further minutes later]&lt;/em&gt; Wondering if you have time for a quick question?&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;Waldorf&lt;/strong&gt;: &lt;em&gt;[maybe the next day]&lt;/em&gt; Yeah, sure.&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;Statler&lt;/strong&gt;: &lt;em&gt;[hours having gone by]&lt;/em&gt; Cool! I&amp;rsquo;m looking at this JIRA ticket, and&amp;hellip;&lt;/p&gt;&#10;&lt;/blockquote&gt;&#10;&lt;p&gt;What&amp;rsquo;s wrong with this?&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;The recipient must stop what they&amp;rsquo;re doing and acknowledge you to push the discussion forward. Like the digital equivalent of having someone walk up to your desk or call your phone, you are forcing a synchronous conversation when an asynchronous one is desirable.&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;The recipient doesn&amp;rsquo;t have the luxury of choosing when to respond. Without any clue as to what Statler needs, Waldorf can&amp;rsquo;t figure out if this is urgent or not.&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;Because the recipient has no context from the initial messages, an awkward ping-pong of clarifying questions is likely to result. If the two participants happen to be on different schedules, this conversation might drag on for days while both parties try to get the information they need.&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Now imagine if this conversation took place via email. It would probably look more like this:&lt;/p&gt;&#10;&lt;blockquote&gt;&#10;&lt;p&gt;&lt;strong&gt;Statler&lt;/strong&gt;: 👋 I&amp;rsquo;ve been looking into this JIRA ticket, and reading through the linked commits, it seems like you and your team were working on this problem most recently. I noticed that you opted to put more of this data into the existing tables - do you have any concerns with instead moving it out to a different storage option?&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;Waldorf&lt;/strong&gt;: &lt;em&gt;[at a time when they can focus on responding]&lt;/em&gt; Hey! We opted to do that because it was the quickest option and didn&amp;rsquo;t seem like it would increase complexity by much. Our design doc on that is here, and you can see under the storage subheading&amp;hellip;&lt;/p&gt;&#10;&lt;/blockquote&gt;&#10;&lt;p&gt;This is an immediate improvement, in my opinion.&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;The recipient can scan the message and see that there isn&amp;rsquo;t a need to reply immediately. They can continue focusing on what they&amp;rsquo;re currently doing, and then shift their focus to a thoughtful reply to the message when they&amp;rsquo;re able.&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;Both messages contain enough up-front context that there isn&amp;rsquo;t much of a need for clarifying questions. The recipient gets a clear sense of the situation and what the ask is, and can compose their response without asking more questions that might take a while for the petitioner to see.&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Compared to Slack, email is a medium that does not train us to expect an immediate response. In general, you have no idea if the person you&amp;rsquo;re emailing is online, reading your message, or composing a reply. Slack will tell you all of these things in real-time, and this motivates us to begin expecting much quicker responses. How many times have you waited for someone&amp;rsquo;s status indicator in Slack to turn green before sending a message?&lt;/p&gt;&#10;&lt;p&gt;In a fully-remote world, this makes a real difference because it&amp;rsquo;s not nearly as reasonable to assume that your working schedule aligns with all of your coworkers&amp;rsquo;. The people you need to work with might be in another timezone or working adjusted hours to help with childcare, which means that it&amp;rsquo;s much more onerous to demand a synchronous conversation when it&amp;rsquo;s not otherwise necessary.&lt;/p&gt;&#10;&lt;p&gt;So, tip number one: &lt;strong&gt;compose your Slack messages with as much up-front context as possible, as if you were sending an email and won&amp;rsquo;t get an immediate response.&lt;/strong&gt;&lt;/p&gt;&#10;&lt;h2 id="make-it-clear-when-you-need-a-response"&gt;Make it clear when you need a response&lt;a class="anchor" href="#make-it-clear-when-you-need-a-response" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;As mentioned above, Slack trains us to expect immediate responses from our coworkers. In a fully-distributed company, this is an unrealistic expectation for most of the work we do.&lt;/p&gt;&#10;&lt;p&gt;However, the reality is that &lt;em&gt;some&lt;/em&gt; messages and conversations do need to happen in real-time. There are plenty of times where you&amp;rsquo;ll need to get someone&amp;rsquo;s attention and get some information from them sooner rather than later (for actual emergencies, you really should be using Pagerduty or Opsgenie, etc., but that&amp;rsquo;s beyond the scope of this article).&lt;/p&gt;&#10;&lt;p&gt;For many people, without clear expectations around urgency, the default behavior will be to assume that all messages are urgent and that everything taking place is Slack is noteworthy and needs immediate attention. The effect of this is an &amp;ldquo;attention treadmill&amp;rdquo;: you can&amp;rsquo;t ignore any notification that you receive because you might be missing something important!&lt;/p&gt;&#10;&lt;p&gt;How do we fix this? Make it clear to recipients when we&amp;rsquo;d like a response to the messages we&amp;rsquo;re sending. Let&amp;rsquo;s look at an example.&lt;/p&gt;&#10;&lt;blockquote&gt;&#10;&lt;p&gt;&lt;strong&gt;Statler&lt;/strong&gt;: Hey, I saw some exceptions in production and was hoping you knew about this.&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;Waldorf&lt;/strong&gt;: Is this urgent? I just finished up for the day, but I&amp;rsquo;m around.&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;Statler&lt;/strong&gt;: &lt;em&gt;[the next morning]&lt;/em&gt; Hey, no urgency - they&amp;rsquo;re all handled, but I was curious about&amp;hellip;&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;Waldorf&lt;/strong&gt;: &lt;em&gt;[screaming internally]&lt;/em&gt;&lt;/p&gt;&#10;&lt;/blockquote&gt;&#10;&lt;p&gt;This kind of conversation happens all the time - we start a conversation about something that might be alarming (errors in production!) without setting expectations about the urgency. Most well-meaning recipients of such a message will at least try and be responsive, even if it&amp;rsquo;s a severe imposition for them to do so.&lt;/p&gt;&#10;&lt;p&gt;To avoid this, all we have to do is be upfront about how urgently we need a response. If it&amp;rsquo;s not urgent:&lt;/p&gt;&#10;&lt;blockquote&gt;&#10;&lt;p&gt;&lt;strong&gt;Statler&lt;/strong&gt;: Hey - this isn&amp;rsquo;t urgent at all. I noticed these handled exceptions in prod, and I wondered if we need to be logging them at all.&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;Waldorf&lt;/strong&gt;: &lt;em&gt;[the next morning]&lt;/em&gt; Sure, that makes sense - I can work up a change to&amp;hellip;&lt;/p&gt;&#10;&lt;/blockquote&gt;&#10;&lt;p&gt;If it is urgent, then make that need clear!&lt;/p&gt;&#10;&lt;blockquote&gt;&#10;&lt;p&gt;&lt;strong&gt;Statler&lt;/strong&gt;: Hey, got a bit of an urgent issue here - we&amp;rsquo;ve got a customer in support chats who can&amp;rsquo;t&amp;hellip;&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;Waldorf&lt;/strong&gt;: Cool, I&amp;rsquo;m here - let me catch up on the situation.&lt;/p&gt;&#10;&lt;/blockquote&gt;&#10;&lt;p&gt;Many people are pretty good about indicating when their messages aren&amp;rsquo;t urgent. It&amp;rsquo;s also essential to clarify when you need an immediate answer to help prevent folks from assuming that all messages are critical.&lt;/p&gt;&#10;&lt;p&gt;Therefore, tip number two: &lt;strong&gt;don&amp;rsquo;t be afraid to set clear expectations around how urgently you&amp;rsquo;d like a response.&lt;/strong&gt;&lt;/p&gt;&#10;&lt;h2 id="set-expectations-around-when-you-can-respond"&gt;Set expectations around when you can respond&lt;a class="anchor" href="#set-expectations-around-when-you-can-respond" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;This last tip might be the most difficult for many folks, but it might be the most important. Slack conditions people to expect an immediate response to their messages, sure - but when you reply immediately to everything that you can, you&amp;rsquo;re doing the same thing. Many conscientious people who really ought to be focusing on other things make themselves too available on Slack and reply immediately to their various DMs. When 5 PM rolls around, they wonder why they didn&amp;rsquo;t get anything done.&lt;/p&gt;&#10;&lt;p&gt;You can coach folks gently into being deliberate about urgency by setting clear boundaries around when you will or won&amp;rsquo;t see and reply to messages. One example of how to do this is to make judicious use of the Pause Notifications feature (formerly known as Do Not Disturb). If you&amp;rsquo;ve never used it before, it&amp;rsquo;s under where you&amp;rsquo;d go to update your status.&lt;/p&gt;&#10;&lt;p&gt;When you pause your notifications, Slack will stop showing push notifications and badges for new messages that you receive, and your status indicator will show a &lt;code&gt;zzz&lt;/code&gt;. The most important part of this is that anyone who DMs you will receive a little prompt along the lines of &amp;ldquo;so and so has paused their notifications, but they&amp;rsquo;ll see it when they get back&amp;rdquo; and a button that allows them to send a notification anyway.&lt;/p&gt;&#10;&lt;p&gt;Pausing notifications is a deceptively powerful tool that folks ought to use more often. As mentioned earlier, it&amp;rsquo;s often hard to set yourself in a &amp;ldquo;Do not disturb&amp;rdquo; mode because nobody wants to come off as unapproachable. Pausing your notifications can gently coach people into thinking more carefully about what is or isn&amp;rsquo;t urgent when they DM you: if it&amp;rsquo;s not that important, they can send the message, and you&amp;rsquo;ll reply when you can focus on it.&lt;/p&gt;&#10;&lt;p&gt;If it is time-sensitive, then all they have to do is click the button to send you a notification anyway. You&amp;rsquo;ll also begin getting yourself off of the attention treadmill: you&amp;rsquo;ll only get notifications for the things your teammates think are actually urgent, and maybe realize how many of those new messages aren&amp;rsquo;t all that relevant after all.&lt;/p&gt;&#10;&lt;p&gt;In a similar vein, consider being active in updating your Slack status to reflect when you&amp;rsquo;re out of office, not working, at lunch, etc. Many of my coworkers use an app called Clockwise that integrates with your calendar and will update your status automatically. I&amp;rsquo;ve begun updating my status when I&amp;rsquo;m in DND mode with a link to a doc that reads, &amp;ldquo;Hey! I&amp;rsquo;m focusing on work right now and will reply to any messages when I can focus completely on composing a response, but please don&amp;rsquo;t hesitate to click the send notification button if you need my attention now!&amp;rdquo;.&lt;/p&gt;&#10;&lt;p&gt;With that, we have the final tip for this article: &lt;strong&gt;help your coworkers by setting clear boundaries on when you will or won&amp;rsquo;t reply to messages.&lt;/strong&gt;&lt;/p&gt;&#10;&lt;h2 id="conclusion"&gt;Conclusion&lt;a class="anchor" href="#conclusion" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;By treating Slack less like a real-time firehose of communication and more of an asynchronous medium like email, you can reduce the amount of time you spend getting interrupted and hopefully find more space to focus on the things that need your attention.&lt;/p&gt;&#10;&lt;p&gt;The solution is clearly not to stop communicating with each other altogether - the nature of almost everyone&amp;rsquo;s work requires a certain amount of coordination with our coworkers. But when we fail to be thoughtful and deliberate about &lt;strong&gt;how&lt;/strong&gt; we coordinate and communicate with each other, the systems that spring up are very rarely the optimal ones.&lt;/p&gt;&#10;&lt;p&gt;Going fully-remote is a new and scary thing for a lot of folks. Even if the world were a less chaotic place right now, it is easy to feel unproductive, distracted and disengaged when you&amp;rsquo;re always on edge and trying to pay attention to everything that happens in Slack. However, I think that&amp;rsquo;s like trying to pay attention to all of the chatter that might have been happening in a physical office - it&amp;rsquo;s impossible and silly. Hopefully, some of the tips here can make your experience with Slack at least a little bit better.&lt;/p&gt;&#10;</description></item><item><title>PHP Autoloading with PSR-4</title><link>https://doomed.ventures/posts/psr-autoloading-php/</link><guid>https://doomed.ventures/posts/psr-autoloading-php/</guid><pubDate>Mon, 13 Apr 2020 14:36:57 -0400</pubDate><category>software</category><description>&lt;p&gt;In medieval times, a PHP application was a collection of files that all require_once&amp;rsquo;d each other in order to import functionality. As applications grew and became more unwieldy, most developers would come up with an ad-hoc solution of something like an imports.php file that contained require_once statement references to all of the files in your application, so that you just needed to import that one file.&lt;/p&gt;&#10;&lt;p&gt;The PHP community eventually settled on a standard for this, called autoloading. It’s described in PSR-4 and most libraries understand it (including composer, the PHP package manager).&lt;/p&gt;&#10;&lt;p&gt;In order to set up a PHP application with PSR-4 autoloading, you’ll want composer installed obviously, and your project’s directory ought to look like this:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;my-project/&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; src/&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; tests/&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Your project has a top-level namespace. This will be the root of all of your namespaces and import paths (more on that in a second). For our example, we’ll use a top-level namespace of MyProject.&lt;/p&gt;&#10;&lt;p&gt;At this point you’ll want to &lt;code&gt;composer init&lt;/code&gt; in your working directory (for now, just mash enter and accept all of the defaults, and then choose no when it asks if you want to install anything interactively), which will create a composer.json and a vendor/ directory. The whole thing looks like this now:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;my-project/&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; src/&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; tests/&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; vendor/ &#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; composer.json&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Within composer.json, we’ll now tell it how to find all of our files relative to the top-level namespace. Add the following to your composer.json, if you don’t already have an autoload section:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;...&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;&amp;#34;autoload&amp;#34;&lt;/span&gt;: &lt;span class="o"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s2"&gt;&amp;#34;psr-4&amp;#34;&lt;/span&gt;: &lt;span class="o"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s2"&gt;&amp;#34;MyProject\\&amp;#34;&lt;/span&gt;: &lt;span class="s2"&gt;&amp;#34;src/&amp;#34;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;...&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This tells composer to generate an autoloader that will attempt to find any class in the MyProject namespace by starting in our src/ directory and going down. Nice!&lt;/p&gt;&#10;&lt;p&gt;Let’s see what that looks like in real PHP files. Let’s create two examples.&lt;/p&gt;&#10;&lt;p&gt;&lt;code&gt;src/Hello.php&lt;/code&gt;:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;lt;?&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="nx"&gt;MyProject&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Hello&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;message&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;string&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;Hello&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;code&gt;src/Hello/World.php&lt;/code&gt;:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;lt;?&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="nx"&gt;MyProject\Hello&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;World&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;message&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;string&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;Hello world&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Here we’ve got two files. One of them is nested just under the root MyProject namespace, so it lives just under src/. The other is in a subnamespace of MyProject called Hello. As a result, it lives in src/Hello. PSR-4 is relatively simple - subnamespaces like Hello should live in a directory of the same name (and should be in capital case like our examples).&lt;/p&gt;&#10;&lt;p&gt;Let’s see how we reference these files we’ve created via PSR-4 and namespaces. Let’s install PHPUnit:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ composer require phpunit/phpunit&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;At this point, composer generates an autoload file based on the specification in our composer.json. It looks like this:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ cat vendor/composer/autoload_psr4.php&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&amp;lt;?php&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;// autoload_psr4.php @generated by Composer&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$vendorDir&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; dirname&lt;span class="o"&gt;(&lt;/span&gt;dirname&lt;span class="o"&gt;(&lt;/span&gt;__FILE__&lt;span class="o"&gt;))&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$baseDir&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; dirname&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$vendorDir&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;return&lt;/span&gt; array&lt;span class="o"&gt;(&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s1"&gt;&amp;#39;phpDocumentor\\Reflection\\&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;&amp;gt; array&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$vendorDir&lt;/span&gt; . &lt;span class="s1"&gt;&amp;#39;/phpdocumentor/reflection-common/src&amp;#39;&lt;/span&gt;, &lt;span class="nv"&gt;$vendorDir&lt;/span&gt; . &lt;span class="s1"&gt;&amp;#39;/phpdocumentor/reflection-docblock/src&amp;#39;&lt;/span&gt;, &lt;span class="nv"&gt;$vendorDir&lt;/span&gt; . &lt;span class="s1"&gt;&amp;#39;/phpdocumentor/type-resolver/src&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;,&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s1"&gt;&amp;#39;Webmozart\\Assert\\&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;&amp;gt; array&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$vendorDir&lt;/span&gt; . &lt;span class="s1"&gt;&amp;#39;/webmozart/assert/src&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;,&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s1"&gt;&amp;#39;Symfony\\Polyfill\\Ctype\\&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;&amp;gt; array&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$vendorDir&lt;/span&gt; . &lt;span class="s1"&gt;&amp;#39;/symfony/polyfill-ctype&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;,&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s1"&gt;&amp;#39;Prophecy\\&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;&amp;gt; array&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$vendorDir&lt;/span&gt; . &lt;span class="s1"&gt;&amp;#39;/phpspec/prophecy/src/Prophecy&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;,&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s1"&gt;&amp;#39;MyProject\\&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;&amp;gt; array&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$baseDir&lt;/span&gt; . &lt;span class="s1"&gt;&amp;#39;/src&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;,&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s1"&gt;&amp;#39;Doctrine\\Instantiator\\&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;&amp;gt; array&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$vendorDir&lt;/span&gt; . &lt;span class="s1"&gt;&amp;#39;/doctrine/instantiator/src/Doctrine/Instantiator&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;,&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s1"&gt;&amp;#39;DeepCopy\\&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;&amp;gt; array&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$vendorDir&lt;/span&gt; . &lt;span class="s1"&gt;&amp;#39;/myclabs/deep-copy/src/DeepCopy&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;,&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You can see that all of the stuff PHPUnit depends on are listed here, along with our namespace MyProject.&lt;/p&gt;&#10;&lt;p&gt;We will create some simple test files:&lt;/p&gt;&#10;&lt;p&gt;&lt;code&gt;tests/HelloTest.php&lt;/code&gt;:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;lt;?&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;use&lt;/span&gt; &lt;span class="nx"&gt;PHPUnit\Framework\TestCase&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;use&lt;/span&gt; &lt;span class="nx"&gt;MyProject\Hello&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;final&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;HelloTest&lt;/span&gt; &lt;span class="k"&gt;extends&lt;/span&gt; &lt;span class="nx"&gt;TestCase&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;testHello&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;void&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$h&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;Hello&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;assertEquals&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;“Hello&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;, &lt;/span&gt;&lt;span class="si"&gt;$h-&amp;gt;message&lt;/span&gt;&lt;span class="s2"&gt;());&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; }&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;}&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;code&gt;tests/Hello/WorldTest.php&lt;/code&gt;:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;lt;?&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;use&lt;/span&gt; &lt;span class="nx"&gt;PHPUnit\Framework\TestCase&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;use&lt;/span&gt; &lt;span class="nx"&gt;MyProject\Hello\World&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;final&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;WorldTest&lt;/span&gt; &lt;span class="k"&gt;extends&lt;/span&gt; &lt;span class="nx"&gt;TestCase&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;testWorld&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;void&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$w&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;World&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;assertEquals&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;“Hello&lt;/span&gt; &lt;span class="nx"&gt;world&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;, &lt;/span&gt;&lt;span class="si"&gt;$w-&amp;gt;message&lt;/span&gt;&lt;span class="s2"&gt;());&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; }&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;}&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;These two test files demonstrate how to reference namespaced files - we know that for example our World.php lives in src/Hello, and thus the use statement will refer to it in its sub-namespace via MyProject\Hello\World;&lt;/p&gt;&#10;&lt;p&gt;Verify that everything works correctly:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ vendor/bin/phpunit tests/&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;PHPUnit 9.1.1 by Sebastian Bergmann and contributors.&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;.. &lt;span class="m"&gt;2&lt;/span&gt; / &lt;span class="m"&gt;2&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;100%&lt;span class="o"&gt;)&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Time: &lt;span class="m"&gt;22&lt;/span&gt; ms, Memory: 4.00 MB&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;OK &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt; tests, &lt;span class="m"&gt;2&lt;/span&gt; assertions&lt;span class="o"&gt;)&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Nice.&lt;/p&gt;&#10;&lt;p&gt;Some more quick examples:&lt;/p&gt;&#10;&lt;p&gt;You can skip the use statements if you don’t mind fully qualifying the class namespaces like so:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;lt;?&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;use&lt;/span&gt; &lt;span class="nx"&gt;PHPUnit\Framework\TestCase&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;final&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;WorldTest&lt;/span&gt; &lt;span class="k"&gt;extends&lt;/span&gt; &lt;span class="nx"&gt;TestCase&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;testHello&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;void&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$w&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;MyProject\Hello&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;assertEquals&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;Hello&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$w&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;message&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;testWorld&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;void&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$w&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;MyProject\Hello\World&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;assertEquals&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;Hello world&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$w&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;message&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Note here that we removed the use statement referring to MyProject and its subnamespaces, and instead when we instantiate the classes we want we simply include the entire path starting at the root namespace.&lt;/p&gt;&#10;&lt;p&gt;You can also import parts of a namespace and do the same thing. Here, we’ll just add a use statement for MyProject\Hello:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;lt;?&lt;/span&gt;&lt;span class="nx"&gt;php&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;use&lt;/span&gt; &lt;span class="nx"&gt;PHPUnit\Framework\TestCase&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;use&lt;/span&gt; &lt;span class="nx"&gt;MyProject\Hello&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;final&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;WorldTest&lt;/span&gt; &lt;span class="k"&gt;extends&lt;/span&gt; &lt;span class="nx"&gt;TestCase&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;testHello&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;void&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$w&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;Hello&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;assertEquals&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;Hello&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$w&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;message&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;testWorld&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;void&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$w&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;Hello\World&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;assertEquals&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;Hello world&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$w&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;message&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Here, this import gives us access to the Hello class without having to qualify further. However, we still need to provide PHP the rest of the path to get to the World class since it’s in a subnamespace.&lt;/p&gt;&#10;</description></item></channel></rss>