Developer Tea

Setting Better Problem Solving Parameters

Episode Summary

What do grocery lists have in common with solving problems? As it turns out, quite a lot. In today's episode, we discuss solving problems by using parameters more effectively.

Episode Notes

What do grocery lists have in common with solving problems? As it turns out, quite a lot. In today's episode, we discuss solving problems by using parameters more effectively.

Today's Episode is Brought To You By: WooCommerce

WooCommerce is an open source eCommerce solution, built on WordPress. With WooCommerce you can sell physical products, digital downloads, subscriptions, memberships, services, and tickets - plus offer flexible ways to pay, including Apple Pay and Bitcoin powered by Stripe.

AND NOW, If you are a developer interested in building and selling extensions, a great way to earn extra income or even build out a whole business, they have some good news: the WooCommerce.com marketplace is open submissions! Learn more about how to submit your extension to Woo’s official marketplace at https://woocommerce.com/develop-woocommerce/

They're giving Developer Tea listeners 20% off purchases when you use promo code DEVELOPERTEA at WooCommerce.com/developertea (offer lasts until end March 2018)

Jon's Cup of Tea -
Don't forget to check out Mad Monk Tea! Remember the code "Developer Tea" will get you 15% off your order.

Episode Transcription

I want you to take a moment and think about the last time that you went grocery shopping. And I want you to think about how you wrote the list that you needed to pick up at the grocery store. This is an example of a fairly complex process that your brain is going through to solve a problem. In fact, multiple problems that you're solving when you write down a grocery list and how can we use the same kind of complex problem solving in our development efforts as developers. That's what we're talking about in today's episode. We're going to try to keep it short today. My name is Jonathan Cutrell. You're listening to Developer Tea. My goal on the show is to help you find your purpose as a developer. We've talked about why 100 times and hopefully you've heard it. And we're going to cut short a little bit today because the last episode was about 30 minutes long, which is longer than our average monologue style episode. So I do want to jump in straight into today's episode. But let's talk for a moment about this grocery problem. Think about all of the things that you take into account when you go to the grocery store. First of all, you have to go at the right time. So even planning the trip itself is a logistics problem that you are solving. You have to go at a time that you're going to be able to take things directly from the grocery store to a place where they can be properly stored, especially if you're getting an item that needs to be refrigerated. Beyond this, you have to decide what you're going to need, what groceries you're actually going to need. Now, how do you do this process? This is kind of a complex process, actually. You have to think into the future about various things that you are going to eat in two weeks from now, even. You have to think about what is it that I want to have for breakfast in two weeks from now. Generally speaking, this is not how we solve the grocery problem. Typically, people have a list of staple groceries that they go and buy, that they know that they can get by for the next couple of weeks, usually. But if they need specific ingredients, they can go and get those on demand. This is the common way of solving these needs that everyone has on a regular basis. But once again, it is complex because what you're essentially having to do is feed this algorithm for writing down a list of things that you need to buy at the grocery store with a lot of parameters, a lot of parameters. For example, in our household, my wife has celiac disease, so she can't have gluten-containing products, but not only gluten-containing products, but possible cross-contamination products as well. So, this makes another input into my evaluation system. If you have a special diet that you're following, that may add another input to your evaluation. If you have an event coming up, maybe you're hosting a party at your house, that would add another parameter to your evaluation. Depending on who is in your home, who you're buying the groceries for, all of these are parameters. On top of that, you're deciding how long do you want to stock up for? Very often, this happens in our home as well. If we're about to go out of town on a trip and I want to pick up groceries, my wife reminds me that we're leaving town soon, so we shouldn't buy things that are going to go bad. So we're having to interpolate all of this information and try to make good decisions with this information. Now, we may not recognize this as a complex process, and most of the reason for that is because we've done it so many times that we have a fairly good, heuristic set that goes along with our grocery picking. You may have that list of staples that I mentioned earlier. You may go to the grocery store when a particular item runs out that you absolutely have to go back for. For our family, that tends to be the dog food bag if we run out of dog food, then that's kind of a trigger to go to the grocery store. But why am I talking so much about groceries on a development podcast? Well, we're going to talk about that right after we talked about today's awesome sponsor, WooCommerce. If you've been listening to Developer Tea much this year, you know that WooCommerce powers essentially one in three online stores. It's about 30 percent of online stores are powered by WooCommerce. WooCommerce is built on top of WordPress, and it's totally hackable. It's totally extensible. You can go in and integrate WooCommerce with whatever existing system you have if it's home spun. If you have your own API as long as you understand how to write code, which if you're developing listening to this show, then you probably have enough knowledge to go in and write your own code to integrate WooCommerce into your existing systems. But it's very likely that you won't even need to do that because unless, again, it's truly like a homegrown system, unless that's the case. If you're using one of the most common tools in the eCommerce world, then it's very likely that there is already an integration available for you in the WooCommerce marketplace. Now, this is going to become even more likely in the very near future because of another exciting opportunity that WooCommerce is offering to developers. That is an open marketplace. That means that you as a developer, even if you aren't creating your own eCommerce websites, you can go in and create tools for people who are using WooCommerce. You can sell those tools in the WooCommerce marketplace. Go and check it out. Head over to WooCommerce.com slash Developer Tea. And if you use the code Developer Teauntil the end of March, which we're about halfway through March now, until the end of March, you can get 20% off head over to WooCommerce.com slash Developer Teato get started today. So, we're talking about groceries today. And more importantly, we're talking about complex problems and how our brains actually create these heuristics that solve these somewhat complex problems almost on automatic. What we can learn from this process, from the grocery planning process, we can learn about these different parameters that we're adding to the problem solving matrix. Here's what we often forget to do as developers. And we're trying to solve a problem with our code very often, we're only looking at a single parameter. And unfortunately, very often, that parameter is some kind of internalized value system. A stick with me for a second. An internalized value system of what that code quote should be. This is a very difficult thing to overcome as developers because in our minds, we have maybe an idealistic version of what our code should look like. We want it to be clean, we want it to follow all the best practices, we want it to use the latest tools, we want it to be easily edited by any developer who comes in and sees the code and fully documented all of these things that we've been told over and over and over are good practices. And that image pervades what we judge about our code. It creates for us the picture of what it means to succeed when we write our code. This is kind of like if you were to go into the grocery store and the only parameter that you paid attention to was maybe you're hunger. We know this, if we go to the grocery store, hungry, then we're probably going to make a lot of bad decisions. And unfortunately, we're also going to forget some of the things that we need to remember to make that trip successful. We often we make decisions based on our hunger rather than on more rational inputs to that decision making process. This isn't such a bad thing with development because at least with development, our ideas of best practices are typically guided by some kind of industry standard or a reason behind the best practice. For example, making your code readable is probably a good idea even if you don't know why. But if you're not taking into account multiple parameters, then you should start. And here's why. This kind of problem solving, if you use your idealistic version of code to decide whether or not your code is good enough, right? If you use this picture, this kind of value, internalized value set picture of what your code should, you know, quote, should look like, then you're very often going to end up in a position of optimizing for certain variables and under optimizing for other variables. Very often this is over optimizing your actual code performance, for example. So having having the perfect algorithm over optimizing your code itself for efficiency, very often you don't need that level of efficiency. Sometimes you can even over optimize for maintainability. Because the code that you're right is actually going to expire before it needs to be maintained. Now this is not an episode telling you to ignore best practices. In fact, it's the opposite. It's telling you to take the best practices and use them in the most effective way. And that in and of itself is kind of a meta best practice, if you will, of taking and composing all of the parts and pieces that you need to practice with your code into the best optimization of all of the parameters, not just the one. Thank you so much for listening to today's episode of Developer Tea. Thank you. We end to WooCommerce. For sponsoring today's episode, you can get 20% off by heading over to WooCommerce.com slash Developer Tea. Use the code Developer Tea checkout for 20% off until the end of this month, March 2018. Thank you so much for listening. And since we're on the topic of groceries, I do want to take a moment to highlight one of my picks for today that is Mad Monk T. If you haven't had loose leaf tea, then you are missing out. If you've only had the tea in the little bags where you had to lay it over the side of your cup, and it doesn't really have much taste. They all kind of taste the same. Sometimes they taste like paper. If you've only had this kind of tea, then you owe it to yourself to check out Mad Monk T. You head over to madmoncte.com. Mad Monk has been so generous as to provide a 15% discount to Developer Tea listeners. Use the code Developer Tea checkout for that 15% off your first order. Thank you so much for listening to today's episode once again. And I encourage you to subscribe in whatever podcasting app that you use if you don't want to miss out on future episodes just like this one. And if you're not subscribed, you almost certainly will miss out because we do three episodes per week. And this is pretty much unwavering. I'm actually out of town this week and we still, we pre-recorded for this week. So again, go ahead and subscribe in whatever podcasting app you use if you don't want to miss out. Thanks again for listening and until next time, enjoy your tea.