Monday, August 15, 2022

Book Review: Clean Code

At KLAS Research I had one of my employees recommend that we get a bunch of copies of the book Clean Code by Robert C. Martin and give them out to all of the software developers on the team. Having never read the book, I picked up a copy from Amazon and it arrived at my house that very evening. I didn't even have to go to the local bookstore, which actually is one of my favorite activities. I wanted to read it before I recommended that the company purchase the $50 book.

I immediately started reading it and felt it had some great ideas that every software developer should learn. I recommended it to one of my engineers and she checked it out from the library before I even made the decision if it is worth getting for everyone. She found value and wisdom within its pages.

Ultimately I decided not the purchase copies for everyone on the team because it had a number of ideas that I disagree with. The book uses Java for almost all of the coding examples. It then goes on to say that there are very few differences between computer programming language choices and the principles in the book can be applied to the vast majority of them. I completely disagree. I am not a fan of Java because I think it requires too many lines of code to do anything useful. You can do so much more with Python in significantly fewer lines. Furthermore, while some of the suggestions in the book will help with Java, they are not needed for Python.

Computer programming languages all have their pros and cons, which is why there are so many of them. When it comes to data science, which is what I am doing now at Sony, most people choose between Python or R. Even then R is better for statistical computations while Python is better for machine learning and general-purpose programs. Java has its place too, but I wouldn't use it for data science as it is too cumbersome.

Going back to the book, Clean Code. I found it to be very helpful and it outlined a lot of concepts that will help you become a better coder. It talks about tried-and-true things like self-documenting variables and that if you have to use extensive comments to describe what your code is doing, you may want to rethink what you wrote. I also like the concept of when you fix bugs, to take that time to make the code simpler and easier to read. If you are looking to improve your own coding skills or are just getting into coding, the book will help you a lot. I'm not sure I can justify the high price for the book though and recommend finding it at the library or looking for a great deal on a used copy.

Tuesday, August 9, 2022

Back at Sony

After leaving Sony Interactive Entertainment (PlayStation) back in November last year, I am back at Sony. I am working for a different part of Sony but will be working with a lot of my former coworkers back at PlayStation. It feels good to be returning.

Back in April I started working at KLAS Research and I didn't think I would be returning to my old employer. The people at KLAS are great and I have enjoyed working with them. While working at Sony I started a project that I felt very passionate about and when the opportunity to continue it appeared, I had to seriously consider returning to the consumer electronics giant. Hopefully it works out well.

Many will think that leaving a small research company that produces important data about healthcare software to go to one of the most recognized brands in the world would be an easy decision. Unfortunately it was not. In fact, I originally told Sony I wasn't interested. I enjoyed not having to travel every week to go to the office and being able to sleep in my own bed every night. After the honeymoon phase of the new job wore off, I realized that my quality of life was taking a huge hit at KLAS. I also didn't agree with how the research data was being collected and would never be given the chance to fix it. Fortunately Sony is not making me come to the office except when I agree that it is necessary, so I will spend most of my time working at home.

It is important that I let everyone know I am back at Sony so if you see me promoting their products, you know it is not an unbiased opinion. I will have to make sure I mention this every time I talk about something they make. Most of the time I will just refrain from writing about their stuff. Sometimes though that will be tough as they do make some really fun toys.

Tuesday, August 2, 2022

Windows vs. Mac for Reliability

Today I headed to work in my home office and tried to bring my Windows laptop out of sleep. I got a pretty little screen with a frozen cursor. I only had a few minutes until my next meeting and so I joined the meeting from my phone while I tried to figure out how to wake the laptop up. Ultimately I had to hold the power button for 10 seconds. The machine seemed to power cycle and then asked me if I wanted to troubleshoot the issue or just turn the laptop off. I chose the latter and then turned it back on. This is a weekly process and it has me somewhat frustrated.

I have 2 computers on my desk at home. The first is my personal Mac that I use to read personal e-mail, create YouTube videos, and manage my personal calendar. The second is my work laptop running Microsoft Windows 10. I use it for a lot of browser-based applications like Jira and Confluence. I also have Outlook installed for my work e-mail.

I have to reboot my Windows laptop about once a week, as I stated above. I checked how long my Mac has been running without being shut down and it has only been up for 4 days. That is because I had an operating system update over the weekend and that required a system reboot. The previous reboot for my Mac was the last software update about a month before.

When my laptop wouldn't wake up this morning and I had to join my meeting from my smartphone, I got really frustrated. My Mac never seems to need rebooting compared to my Windows laptop. Now I will admit that I am a bigger fan of the MacOS but I had hoped that Windows had become more reliable in the past half-decade. I would say that it has but is still nowhere near the MacOS is for reliability.

If you are someone that turns off your machine nightly, then Windows may work fine for you. If you are like me and just put your machine to sleep and keep it running non-stop, I would suggest running either Linux or MacOS.

Thursday, July 28, 2022

Paper vs. Electronic Books

Last weekend I flew to Ohio with my wife to visit our son and his family. Before leaving on the trip I started reading a paper copy of a large book. I didn't want to carry the book on the flight as I packed in a small backpack. I had access to an electronic copy and so I put it on my phone. Then my wife and I headed off to the airport.

Waiting in airports and spending time on planes provides one with a lot of time to read. I probably spent 2 to 3 hours reading just on the way out. My screen was plenty large to read and I just had to scroll constantly. Interestingly, the chapters felt shorter on my electronic device. I also had no warning as I got close to the end of the chapter, which I didn't like. I did like that I could turn off my screen, put my phone in my pocket, and change seats or walk on the plane. With a physical book I would have had to put in a bookmark and try to remember which paragraph I stopped at when I started reading again.

I didn't get the chance to read while in Ohio, which didn't bother me as that meant I spent all of my time playing and doing more important things. Then it came time to fly home Sunday evening. I just opened my reader on the phone and picked up on the next chapter from where I left off. I had lots of time to read as the first flight was delayed an hour. I had a 3-hour layover and so it didn't stress me out. I read some more when I got to the intermediate airport and then watched a movie the rest of the way home after boarding my next flight.

Once home, it came time to go back to my paper book and update the bookmark in my physical copy. Doing so allowed me to visually see how much I had read on my trip. I instantly thought of how much better a physical book is than an electronic one. Then I realized if they are really better then why didn't I bring mine on the trip?

Ultimately I prefer physical books if I have the luxury of being at home and don't have to worry about lugging around anything. When I am traveling, I prefer electronic ones. You can carry many of them and you won't throw your back out because of them.

Monday, July 18, 2022

New Laptop Battery

A week or so ago, my wife seemed rather distraught. We have a number of projects going on in the house and I worried that maybe we had a plumbing leak. For some reason, plumbing problems appear most in my adult nightmares. She said that wasn't the issue but that her laptop computer wasn't holding a charge. I breathed a huge sigh of relief. She changed out chargers as we have a number of different chargers for various Mac computers and that fixed the problem temporarily. Once she pulled her laptop off the charger, she only had about an hour before the battery drained completely. I immediately knew the problem: she needed a new laptop battery.

My wife has a MacBook Air that I picked up about 7 years ago. Knowing that she is reaching the end of life for her computer, I asked if she wants a new one but she doesn't see the point. Her current computer is working flawlessly for her and so I went to the website IFixIt and did a search for "MacBook Air Battery." I found the information for an Early 2015 with a 13-inch monitor and looked at ordering a new battery. I also reviewed the instructional video to see what tools I would need.

Replacing a MacBook Air battery is a simple task that anyone who has ever used a screwdriver can accomplish. You just have to have the right screwdrivers. My wife's required a Pentalobe 5, which looks like a 5-pointed star to remove the case and a Torx 5, which looks like a 6-pointed star to remove the battery. I made sure to order the screwdrivers from IFixIt as they were only $6 each. Interestingly I did not need to order the high-quality ones as I was sent the screwdriver bits with a universal handle because of my battery order. Now I have 2 of each.

I placed my order and it arrived the next day. I had a break in my work schedule and asked my wife to bring me her laptop. I grabbed some reading glasses and went to work. The first thing I noticed is how tiny those laptop screws really are. I carefully placed them nearby for when it came time to reassemble everything. The old battery came out quickly and the new one went in just as fast.

Any time you replace a laptop battery, you also want to calibrate the battery. Instructions came in the package and so we charged the battery to full and then kept it on the charger for a few hours. Then my wife started using the laptop running only on battery power until the computer turned itself off. After using it for about a week, today the MacBook Air finally shut down. I asked my wife how much time she actually got out of the battery and she estimates about 7 hours of real use. She is happy with that.

Apple makes a great computer that lasts for many years. My wife is gentle with her laptop and so I expect it to continue working for several more years before needing to be replaced. That makes replacing a battery much more cost effective than getting a new machine. It wouldn't surprise me if we get a total of 10 years out of it now.

Wednesday, July 13, 2022

Boy It Is Hot Outside

We are having very warm temperatures in Utah right now. When I go to the national weather service it has a message saying, "Excessive Heat Warning." Basically if you go outside, you run the risk of spontaneously bursting into flames. I don't mind too badly as my air conditioner is fairly new and does a great job of keeping the inside of my house comfortable.

One problem with air conditioning is that it can be expensive during really warm weather. I have done what I can to limit how much it runs including painting my house white and using white tiles on my roof. When I had to have my roof replaced, the salesperson said the color of the tiles shouldn't make much of a difference. Interestingly I chose the tiles with the Energy Star rating and my electrical bill is consistently 50% less than it was with my previous tiles. In other words, the salesperson was ignorant and white roof tiles make a huge difference.

To help keep my air conditioning costs down I also set my thermostat to 76 degrees Fahrenheit. That is a great daytime temperature as I can hang out in shorts and a t-shirt inside. My office likes to keep the temperature much colder and people run around in jackets and blankets. It is a good thing I don't have to go in every day.

One more thing you can do to keep electrical costs down in the summer is to leverage free air conditioning with the cool night air. The only downside is you can't rely on an outside source to know when it is okay to open your windows. I have an Amazon Show in my family room that always displays the outside temperature as reported by the national weather service. Unfortunately it is never the same as my actual outside temperature. How do I know? I have an electronic thermometer that displays its reading on my weather station inside. I keep the sensor in the shade on the north side of my house. I don't even think about opening a window until my weather station tells me the outside is at least a half degree cooler than the inside.

There are about 20 days in the summer where the outside temperature never gets low enough for me to open my windows. When I fell asleep last night, my bedroom was about 3 degrees cooler than the outside. It was still 2 degrees cooler this morning when I woke up. I expect a few more days of this but will still watch nightly as I enjoy seeing how cool I can get my house with free air conditioning.

That outdoor thermometer has more than paid for itself. Sometimes I will go outside and think the house is warmer inside. Often that just means there is a slight breeze which makes it feel cooler even though it isn't. Having a trusted temperature source helps me convince others that live with me to keep the windows closed for just a bit longer.

Finally it is important to know that unless you have many zones for your air conditioner, not all rooms in your house are at the same temperature. My house has 3 levels and the basement is always cooler than the other 2. The master bedroom is in the top level and always the warmest being about 3 degrees warmer than the level below it. When it is time to open windows, I start upstairs. I have thermometers on each level of the house and only when the outside temperature drops below the inside temperature for that level do I open those windows.

The system is not foolproof but it works fairly well for dry western states like Utah. I was talking with someone recently that said the difference between high and low humidity is that with low humidity, it does get cool in the shade. For me, that means when the sun goes down, it gets cool. Sometimes very quickly and I appreciate that.

Thursday, July 7, 2022

No Internet for an Evening

I got home from work yesterday and while eating dinner with my wife I received a text message from my Internet provider. They apologized that my service was down but were doing everything they could to restore it. They had an estimated time of the problem being resolved in an hour. I finished eating, did the dishes, and then wondered how best to use my time.

Lately I have been playing Horizon: Forbidden West on my PlayStation 5. I have the game downloaded to my console and so I thought I would try to see if I could play it. Nope because before the game will start, the PS5 checks the entitlement database to make sure I have permission. Without the Internet connection, that information couldn't be verified. If I had a physical disk for the game, I could have played it but I was given the electronic version for free. I will be sure to purchase physical copies of games in the future for this reason.

I thought about watching a movie as I have a huge DVD and Blu-ray library and it is impossible to stream a movie without an Internet connection. Ultimately that would have just been filling time and so I looked at other activities. I thought about practicing guitar, which is something I do every evening. Sometimes I use Rocksmith on my PS4 and I have a physical disk for that game. Instead I decided to go for a walk with my wife. That is something else I do every evening and last night I did it a bit earlier than usual. The only downside being the warmer temperature as I like to wait for the sun to go down a bit more during the summer months.

My wife and I returned from our walk and our Internet was working again. By then, I had no interest in the activities that required me being online. I practiced guitar and then watched broadcast news before turning in for the night.

This morning I woke up and didn't really think much of the lack of Internet last night. At the time though I felt myself scrambling for worthwhile activities. Truth be told, the walk I took was probably more worthwhile than anything else I could have done online.