Hawaiian War Games

Artificial intelligence. Sounds cool doesn’t it? I certainly thought so when I was trying to decide on classes to take last fall. I saw the AI class listed in the course catalog and said to myself: “Greg, you have to take that class! Girls love a guy that doesn’t have to make friends because he can program them”. And so I decided to take it. I was somewhat disappointed at first because upon first inspection of the syllabus, the class didn’t seem to have anything to do with programming new friends. I guess I will be alone forever :'(. That was a joke by the way… I don’t want anyone getting the wrong idea that I am some kind of sad sack. Anyways, back to AI. So I was looking at the syllabus and realized that most of the class was spent analyzing different algorithms that can win games like chess, checkers, go, etc. If you have ever looked into AI, then you probably know I am talking about algorithms like minimax, alpha beta pruning, and even machine learning stuff like neural networks.

It is all very fascinating to read about. Computers have consistently beaten world champions in checkers, chess, go, and a wealth of other simple card and board games. What is even more interesting is that almost all of the algorithms that have beaten human world champions are based on the same concept. We programmers usually avoid this concept and therefore have a pretty disgusting word for it. I’m talking about brute forcing. That’s right, the world champions in some of the most famous and widely played games in the world have all been conquered by what is essentially lazy programming. For you non-programmers out there, brute forcing is when you write an algorithm that tries every single combination in order to determine the best next move. This is pretty easy to visualize in tic tac toe because it is a relatively simple game. In tic tac toe, the first player has 9 different move options. The second player then has 8 different move options for each of the 9 moves that the first player could have made. That means there are 9*8 = 72 different board configurations that the first player can encounter when making his third move. The player making the third move can then make 7 different moves off of that bringing our board configurations up to 7 * 72 = 504. There can be up to 9 moves in a game of tic tac toe though so you can see the number of board configurations spiral out of control until the number is in the hundred thousands. The branching of these moves off of one another is kinda shaped like an upside down tree where the top of the tree is an empty board and the leaves of the tree are the winning board configurations.

Simplified game state tree for tic tac toe

Now, brute forcing would not be super difficult in the case of tic tac toe because hundreds of thousands is still a pretty small number of options for a computer to evaluate. It does, however, get difficult for a game like chess. The number of possible game states in chess is not even known. The most common estimate is called the Shannon Number. The Shannon number is about 10^120 and is not even an estimate as much as a lower bound. This means that the number of possible board configurations in chess is AT LEAST 10^120. For reference, this is more than the number of atoms in the universe. Therefore, it is impossible for a computer to compute every possible board state and evaluate which path is the best in order to choose the best move. One way to get around the limitations of computers is to write an algorithm that checks all moves up to a certain depth in the game tree, evaluates each of the game states at that certain depth for the utility (or how good each state is for the player whose turn it is), and then makes the move that has the most utility. The function that evaluates the game states is called the heuristic function. The accuracy of the heuristic function is pretty much what determines how good the algorithm is at playing the game. The best heuristic functions (you know, the ones that beat the grandmasters) take years to develop.

So why did I just spend the last minute rambling on about upside down trees, utility, and heuristics? Well as I was looking at the syllabus that first day of class, I noticed that in lieu of a final exam, we would be writing our own AI to compete in a class wide double elimination tournament. The name of the game was Konane, an ancient board game originating in Hawaii. Konane is played with two players and two different types of game pieces filling a board in a checkerboard pattern. In the first couple of moves, the two players remove pieces. The rest of the game is spent using your pieces to jump over the enemy pieces and ‘capture’ them. The first player who can’t make a move loses. Konane was an interesting choice because it can be played on any size board. The number of pieces and possible moves is proportional to the size of the board, my professor had us use an 18×18 game board to make sure we couldn’t brute force the entire game.

My team and I wrote our AI using the tree search and heuristic functions I described above. We also included alpha beta pruning (which I won’t describe because it is way too complex for this) to double our possible depth. We spread the processing out on all the cores of our system (something that is really easy to do in a recursive algorithm) to maximize our processing power. The final algorithm made our CPU fan scream, but it was totally worth it because in the end we clinched the victory. Looking back on it, I think we only won because I spent way too much time trying to figure out the best heuristic functions further proving how important these are. We really couldn’t agree on a heuristic function to use. I mean, there are so many that seem like they would be good. Number of possible moves is a good indicator of health because the less moves you can make, the closer you are to losing. Piece count is also a good one–the more pieces you have is roughly similar to the number of moves you can make. In the end, we found some good linear combinations of these heuristics and their inverses through seemingly endless trial and error. We ended up using one of those and it got us the victory.

So that’s the story of how my group became the kings of our AI class. We didn’t have to invent anything new or discover some sort of algorithm to win. We just used concepts that were discovered by some of the most brilliant minds of the computing era and have been tried and tested since their discovery. And that’s really the lesson I want you to take away from this. Oftentimes, when encountered with a problem. Someone has already had that problem, solved it, and put it on the internet for all to see (the Internet really is beautiful, isn’t it). Modern programmers absolutely do not have to be genius mathematicians, they just have to be good at interpreting other people’s work so they can implement it themselves. It may seem daunting at first to read a fancy published paper written by some genius PHD somewhere, but don’t let that keep you from reading it and trying it yourself if it interests you. Practice makes perfect! The reason papers are written is so other people can duplicate the work that was done in it and possibly expand on the findings. Who knows, maybe the next time you try to implement someone else’s research yourself, you will discover an expansion that is just as revolutionary.

Because I talked about some of my own work in this post, I have included the code below (It’s in python). There are several different modes you can set it to run in. Currently, it is set to pull up a GUI so you can play against the AI. It is very rough though as it was for a class so take it with a grain of salt.

Is College Really Necessary?

Now I know it has been a long time since I wrote one of these. I have no doubt that’s okay though due to the existence of my nonexistent readers. I don’t really care about growing this blog or anything, I just want to have it as a place to write down some thoughts so my old frail self can look back on it one day and wonder what I was thinking when I wrote some of this stuff. Anyways, on to the topic of the day: Is college necessary? I did a post on whether high school was necessary, so I guess this is the next logical step. If you have read any of my other posts (so probably no), you will know that I am in fact a college student. A senior, to be precise (for all of you who weren’t wondering). Hopefully my opinions won’t be so controversial that I never graduate from college. My answer to the question of whether or not high school is necessary was a resounding yes. The necessity of college needs to be evaluated on a bit more of a case by case basis. Obviously, my perspective is that of a programmer, so keep that in mind as I am going through my thoughts. Also, I will be focusing on the academics of college. Many of you may have guessed that I’m not exactly a partier, and so I won’t be discussing the social side of college. This is purely an academic discussion (more of a rant but whatever). Specifically for those looking to get a job after college.

Because I am an engineer, I like order and organization, so we are going to divide this one up into a pros and cons list (I assure you I don’t have a calculator down there). I’m feeling optimistic today, so let’s start off with the pros. The first and most obvious pro of a college education is the structured curriculum. At accredited universities, you never have to question if what you are learning is relevant. Contrast this to trying to learn something online where you never know who is saying what and if they are qualified to be saying that. At college, (accredited ones at least) there is a panel of people much smarter than you or I making the decision about what we learn. Some people also learn better with structure. They are much more comfortable navigating a mostly linear set of classes that were put in that order by the people who know what they are talking about. This is much less intimidating than trying to master a subject area without any map to navigate through it. That’s like telling someone to visit every island in an ocean. People in college get a map, and people who choose to go it alone don’t get the map (metaphors are fun!). Finally, say what you will about tests, quizzes, and other types of assessments, but they are proven to make you learn because no one wants to fail. But why don’t we want to fail in college? Like a lot of things in life, it comes down to money for most people. Which brings us to the second pro for going to college: it costs money. Now this might be a controversial opinion, and you better believe I am going to revisit the money thing in the cons section (stay tuned), but money is one of the best motivators there is. Because students shell out so much dough for a few classes every semester, they are motivated to succeed in those classes they don’t have to repeat them and pay more. I have even had professors mention this fact to us during class as if we (as in all college students) are not painfully aware of it. The last big reason I can think of for why college is necessary is the atmosphere a university provides. It is not just you doing the learning. There are tens, hundreds, even thousands of other students struggling on the same material as you at the same place. This has a couple of advantages. For the competitive among us (definitely me), it motivates us to do better than our classmates. It sounds petty, yes, but the more motivation the better. Another advantage is that it provides you with people other than the sources of knowledge (i.e. the professors and TAs) to ask questions. Everyone learns in a different way, and some people understand better than others. When students share their understanding of things with each other, it helps everyone involved: both the teaching student and the learning student. There have been studies that show that students learn better when they are made to collaborate (at least I think studies like that exist). What better way is there to make students collaborate is there then forcing them to live together. Amiright? So just to reiterate, the major pros behind a college education are the standardized (and hopefully certified) curriculum, the motivation it provides by costing money, and the network of other students it gives you access to. Now we get to do the fun part: the cons.

In order to make this as simple as possible for you, the cons are exactly the same as the pros: standardized curriculum, cost, and network of students. Allow me a minute to explain. Standardized curriculum is good for the reasons outlined before, but if you are trying to learn a single topic (like computer science), then it may not be ideal. Every school I have ever visited or heard about has general education requirements. These are meant to foster interdisciplinary learning or whatever. It’s a good thing I guess, but for the purpose of learning a single topic, it’s not ideal. It’s like trying to learn a new subject, but in order to learn that subject, you can only spend ⅘ of your time on that subject, the rest of your time has to be spent on something else. See what I mean? A similar concept can be applied to the situation where you come into college with prior experience. If this happens, then some of your time is spent “learning” about things you already know about. So take away another fifth for that (depending on your experience level before college, of course). You are left with only a fraction of your total time spent on actually learning new material and being productive. If you are not new here, then you know that I value productivity above almost everything else, so you can understand my “feelings” (aka frustrations) about this “fractional learning”. I can understand some interdisciplinary subjects being useful, but I still won’t believe every subject is useful until someone can explain to me how taking a social studies class will help the majority of computer science students do better at their jobs. I rest my case. Okay, moving on to the second con: money. Now I think this one is pretty obvious. I am from the United States where colleges cost obscene amounts of money. But I’m also a firm believer in the capitalist system (‘murica am I right? (naw just kidding lol, but I do believe in capitalism)). So I ran the numbers myself. The average cost for college in 2017 was about 26k per year. The median household income in the US was 58.5k. Now assuming the student was born in 1999, and the family has been saving the same percent of their income every year, they would only have to save about 9% of their income every year to pay for college. This assumes the cost of college doesn’t change, and their income increased linearly from what it was in 1999: 42k to what it is in 2017: 58.5k. 9% doesn’t seem so bad right? Wrong. Most people don’t save much for college at all, so they end up having to foot most of the bill when the student is in college. Also, these calculations use median household income numbers. The demand for college has been rising dramatically as well, meaning more and more students have to attend college in order to get jobs. Because of this, more and more people in the lower income brackets have to send their kids to college. Because they are on the lower side of the median income, they make less than the median and have to save much higher percentages for college. However, with all their other expenses, this isn’t practical for them. This, combined with the fact that most families don’t save at all forces me to have to label cost as a con for college. If you didn’t understand the math at all that’s okay. Hopefully you can understand college costs big money, and because people need money for other things too, this is bad (was that simple enough?). I am happy that I got to pull out a calculator for this post though (I am such a nerd). This brings us to our last con to talk about: network of students. Because there are so many students studying the same things at colleges, that means everyone is bound to work in a group at some point. Personally, I am a big proponent of group projects. They give you a unique perspective and simulate the real world really well. Unfortunately (just like in the real world) group projects are often impeded by morons. Just to clarify, I’m not talking about the students that don’t know what they are doing. With enough effort on their part, they can learn. I am talking about the morons who don’t contribute any effort. These people are the bane of my, and every other group project’s existence. They contribute nothing to the group unless they are forced into it. Even when they are forced, their work is probably sloppy and has to be redone. I could go on and on and on and on an– well anyways you get the idea. Let’s just leave it at that (This post is already too ranty). Now hopefully you understand that the pros behind college are also cons, which I guess explains why there is a debate on this topic at all.

So what’s the answer? Should you go to college or not? Maybe? I don’t know… why are you asking me? You know yourself better than anyone else. That means you know if you have what it takes to motivate yourself to learn everything that college teaches you. And that’s really what it comes down to. If you have the motivation to teach yourself everything you need to know, then it will probably take less time (because there are no gen eds or repetitive learning) and cost less money (ca-ching!). Of course, like always, I am speaking from the perspective of computer scientists. A lot of jobs require you to have a degree to even apply. In computer science, they don’t give two cents about if you went to college or not. They care if you have what it takes to be a programmer and make them money. Because, of course, it always comes back to money. 

Computer Advice for Dummies by a Dummy

This post goes out to all of you people who have ever struggled with your computer in even the slightest way. I have never met anyone who has used a computer and not struggled with it at some point so basically this post goes out to everyone. I want to write this because I have been pretty frustrated with so many people asking me for help with simple things on their computers, they could (and should) know how to do themselves. Hopefully I will be able to provide you with some advice to ease your interaction with your computers. And for all you that are saying to yourself: “I don’t have a computer because only old people use computers,” let me explain something real quick. Phones, macs, laptops, etc are all different types of computers. Even things like TVs, microwaves, refrigerators, smart speakers, and pretty much everything else that runs on electricity is a computer nowadays. Computers are NOT limited to big boxes hooked up to mice, screens, and keyboards. You may think I wouldn’t have to say all that, but trust me, you would be surprised. Now without further adieu, let’s get to the advice.

First thing I will say is don’t worry about breaking anything. In modern computers, there is almost no way that you can break anything beyond repair unless you really know what you are doing. When you have a task, and you aren’t exactly sure how to get it done, just start trying things until you get it. Millions of programmers have worked countless hours to ensure that every moron who uses their products doesn’t break anything beyond repair (no offense to the morons reading this, of course). So before you go and ask your nearest computer geek how to do something like find a file or check your email, try it yourself first. Whenever someone asks me for help with a computer, I always ask them what they did to try to figure it out themselves before they came to me. Usually, their first instinct is to come and find me rather than try it themselves for fear of breaking something. So I am telling you now, that YOU WILL NOT BREAK ANYTHING. At least, probably not anything that can’t be undone. Ever heard the saying: “Nothing is ever gained by those who don’t try?” Yes? Well great! Now try applying it to computers and maybe you won’t have to go asking for help every 10 minutes. Okay that was harsh… I apologize, I didn’t mean to come on so strong, I just feel, er, strongly about spreading this message.

Next piece of advice I can give is to always remember that whatever type of computer you are using, it was created by another human. Now you may not think of programmers as human… maybe you are thinking that we share more in common with robots.  Contrary to popular belief, we are human. Completely, 100% human. It always helps to remember that the programs/apps/software you use on a computer were created by someone who is probably trying to make it as easy as possible to operate. If you are struggling to figure out how to do something, it can help to consider where you would add a button to accomplish your task. Close your eyes, and think carefully about how you would have wanted the programmer to implement the feature you desire. Imagine all the clicks you have to make in your head, then open your eyes and try it. Oftentimes, you and the programmer had similar ideas. More often than not, you will find what you are looking for. 

The last piece of advice I want to leave you with is something that can solve all your problems but should only be left as a last resort. It, like my other advice is simple: just google it. Now you are probably thinking that this is pretty obvious advice. While obvious to some, it is still worth mentioning because it is certainly not obvious to others (and by “others” I mean the older generations). Answers to all of your questions, especially those involving computers, can be found on the web. Google basically taught me to code, so I’m sure it can teach you how to check your email. This should, like I said, always remain your last resort. You will learn far more by trying to do it yourself rather than just defaulting to Google every time. 

So those are my three biggest secrets to success when it comes to using computers. Which is probably the only thing I am in any way qualified to be giving advice on. Take advantage of the advice in this post to eliminate your fear of digital creatures. They seem like magical black boxes, but trust me, they are not so scary. And who knows, if you are anything like me, then maybe getting good with computers will lead to a career. You will never know until you try.

Is High School Really Necessary?

It is pretty stereotypical of programmers in particular to have some sort of game-changing idea, drop out of college, and start a company. Well, college is only four years (most of the time) so statistically it is unlikely that this idea will come to you in college. Obviously, if you are a professional and have an idea like this, then you just quit your job and start your own company or something. But “quit your job” does not have the same ring to it as “drop out of college”. So this got me thinking about what you should do if you have an idea like this while in high school… should you, dare I say it, dropout of high school? Let me give you some time to finish gasping… are you done yet? Great, let’s move on. Honestly, if you were surprised that I just mentioned dropping out of high school, then you clearly didn’t read the title. To answer my own question: NO YOU IDIOT, DO NOT DROP OUT OF HIGH SCHOOL. Sorry for calling you an idiot and yelling at you like that. Sometimes I really lose myself. 

I hope most rational people would agree with me when I say it is a bad idea to drop out of high school. It is just common sense. Honestly, the title of this post is pretty far off because I actually want to talk about how I think students with an interest in programming should approach high school. But obviously that doesn’t have the same ring to it. So sorry for the clickbait (except that I’m not sorry).

Now I know it is becoming a lot more popular of a topic in high schools and more classes are being added, but when I graduated in 2017, there were only 3 programming classes for 2000 students.  If you are anything like me (which I really hope you aren’t for your own sake), you were/are super excited to get to high school and have access to the miniscule amount of CS classes available. This is a good feeling to have. It means you are excited about the possibilities of your desired field and will be motivated to learn. Despite this, (I really hate to burst your bubble here) you really won’t learn anything substantial from a high school CS class. Now obviously every high school is different and before you yell at me that you took a class on compilers or the linux kernel or something in high school I want to clarify that I am talking about averages. Even if your school does, MOST schools will not offer anything above introductory programming classes. When I was entering high school, I was highly motivated to learn programming, had quite a bit of programming experience already (for my age of course), and was pretty excited to just be able to talk about it with someone other than myself (I wish that last part was a lie). 

As I said previously, most high school programming classes are introductory ones. Students tend to learn the most from them when they have no background whatsoever and they are motivated. However, if you are coming into it with any sort of experience whatsoever, you are probably going to be bored when the teacher spends a week going over if statements. I WILL say it is nice to have a formalized learning plan and class. When I was learning programming on my own, I was mostly watching youtube videos and looking on documentation websites. I didn’t really know how much I knew because it wasn’t a formal education. Taking programming classes in high school gave me a formal self recognition of what I knew. Classrooms are also great (no matter your experience level) because they provide an opportunity for questions. Now obviously, you can ask questions online too, but if it is a stupid question, then the responses will probably make you want to cry. Teachers are there to help each student understand and (at least in my experience) are welcoming to all questions (even if they are stupid) unlike Stackoverflow. Even if you have programming experience and you ask the teacher a question that they don’t know, it will spur a give and take conversation where both of you will try to figure it out. Most of the time, this will result in you learning even more than you asked for (not even an intentional pun lmao, I caught that one when I was editing). Don’t get me wrong I love the opportunity for questions, but it is a double edged sword. Chances are only a small percentage of the students in the class will have some sort of prior experience with the material. As a result (like with any high school class) people will be asking a lot of stupid and repetitive questions that will bring the class to a grinding halt. This can limit the amount of material that the teacher can cover, not to mention being really boring for someone who already gets it. If you do find yourself in this situation, try to make the most of it! Offer yourself as another avenue for confused students to ask questions. It can be hard to do this without sounding like a know it all, so instead just show the class that you get it by asking “reach” questions and making your projects/presentations stand out. Now I want to clarify here, do not ask “reach” questions that you know the answer to, because trust me, that will also make you sound like a know it all even if you don’t think you do. Also try to keep the reach questions as on topic as possible. If you are unsure that you can formulate good “reach” questions that will not make you sound like a know it all, then DON’T TRY. Just stick to wowing everyone with your projects. You would be surprised how much you can end up learning by teaching. Going into my classes in high school, I was also looking forward to finding students who were as motivated as me to learn computer science. Unfortunately I was misguided and didn’t end up finding anyone, but your mileage may vary. You have to assume if you are interested in programming and are taking the class as a result, then there could be someone else that had the same idea!

Obviously there are a ton of pros and cons to high school computer science classes and really any class that you are interested in. I want to take the rest of my time here to go over some action items that I think every high school student (interested in CS or otherwise) should take seriously. Firstly, take all the computer science classes that you can. Don’t rely on them to get good at programming because like I said they are mostly introductory. Instead, focus on collaborating with others. You will probably work on a lot of projects in a group or individually. For individual projects, wow the rest of the class so they come to you with questions. For group projects, focus on collaboration. Nothing ever gets done in the real world with just one person. Gaining experience very early on working with a team will get you used to it and set you apart when you are applying for internships and jobs later on. Facebook for example employs thousands of engineers divided up into hundreds of teams. Do you think they would be more likely to hire someone who mostly has experience working in a team or individually? See what I mean?

Finally, don’t just care about the classes that you are interested in. If you like programming, then don’t avoid your english homework. This was a big problem I struggled with in high school (as you can probably tell by these posts, I didn’t pay much attention in English). I hated writing, english, languages, and pretty much any other non-stem related field. So I didn’t try as hard. And honestly, I think I have suffered because of it. Almost every subject will help you with whatever career you choose. Specifically for software engineering, here are some examples if you don’t believe me: English/writing/grammar will help you with writing reports, documentation, comments, and even variable names. Knowing more than one language will help you be flexible in where you can work. Math is the foundation of computer science so this is obviously helpful. I had a hard time coming up with something for science because the application is not as important. But the fundamental ideas of using formulas and systematic processes to solve problems are the foundations of all engineering fields. Finally, history. For the life of me I can’t think of anything useful in computer science from history so you have my permission to sleep through that class.

Basically, go to high school, don’t drop out, and do your best in every class while taking classes that you are interested in. it took me a long time to come to that conclusion which is pretty sad because it is pretty standard advice. I don’t want to parent anybody here (because I would be a terrible parent) but I hope you will take this advice to heart. I had my mom read this too and she agrees with all my points here. My mom is like one of the smartest people I know and is great at parenting (I mean, how else did I turn out so great?) so you know that my advice is sound.

My Struggles with Failure

Failure. You failed. F. All of these are things we are unconsciously conditioned to loathe from a very young age. I remember hearing “do your best”, “get that A”, and “make me proud” all the time from my parents. I don’t mean this is bad advice at all, that’s not what I am saying. Those little sentences can lead to the development of a fear of failure. This is so common in fact that there is a name for it: Atychiphobia. Failure is definitely something that we should avoid if we can–always do your best to succeed. But it is something we should not be afraid of. The mindset that is not afraid of failure (in moderation) is the best one for a programmer with x years of experience (x means “any” for you non math people). This is something I really struggled with when I first started programming and still struggle with to this day. Because it has caused me so much anguish over the years, I am going to do my best to help you all avoid it by helping you understand how and when to fail properly (lmao what a weird thing to say). So sit back, relax, and prepare yourself for a more serious (and longer) post than usual. 

First, like you will see that I often do, I want to start this off with story time… When I was a kid, there was a lot of pressure on me to be smart. Now, I am no geneticist or behavioral psychologist (I can’t even spell that word without spell check). But I like to think a person’s personality comes from a combination of genetics and nurture. Intelligence is one trait that I believe is impacted mostly by nurture. Like I alluded to earlier, I was “nurtured” into being smart. Both of my parents were intelligent and I was encouraged to be even smarter than they were. They would tell me “You are so smart”, “you are going to do great things with your brain”, and my personal favorite “he/she is just jealous because you are smarter than them” (in order to console me for someone not liking me or something). Don’t get me wrong, I love my parents and I don’t blame them for this at all… I never would have accomplished everything I have in my without them pushing me and I will probably say the same kinds of things to my children. They constantly encouraged me to be anything I wanted alongside the idea that, whatever I did, I would be good at it. By the time I got to school, I was already (subconsciously, might I add) self-identifying as one of the “smart kids” (or ‘nerd’ if you are not one). Being in school further solidified this persona in my head because other kids would reflect this self-identification back on me and I would feel like others saw me as one of the smart kids. Now at this point you may be thinking, “Wow, this guy is so full of himself. All he has done so far is boast about how people all around him thought he was a child prodigy or something”. Well hold on a second buckeroo. I am leading up to a point, I promise. To put it in perspective a little bit, I really wasn’t that smart. School came pretty easily to me because I started reading and solving math problems from a very young age. This background kept me afloat for a while without really trying, but when I got to junior high and high school, I went through a rude awakening. Because I inherently believed that I was very intelligent, I didn’t know the value of hard work, effort, and the effect that they have on success. I actually wouldn’t learn that I had to practice to get good at something until I was in college. For the first 18 years of my life, I just assumed that I would pick things up instantly because of the ‘inherent intelligence’ that I assumed I had. But this wasn’t even the worst part. The worst part was the constant fear of inadequacy that even now continuously plagues me to this day. Now I know that sounded pretty dark, but it’s the truth. I was petrified of the possibility of not meeting expectations. This caused me to never ask questions in school because I didn’t want to sound dumb. The only time I ever talked in class was to answer a question that I definitely knew that I was right on (yes, I am so sorry, I was THAT kid). When I would get something wrong, it would ruin my entire day. I would question how I could have been so stupid to get whatever it was wrong. Basically, I was deathly afraid of failure. So afraid, in fact that I would have rather ceased all efforts and quit rather than fail. Now there is a bit of a happy ending to this story. After all, I am writing this to you right now, so obviously I realized it and took care of it, right? Well… sort of. This fear of failure isn’t just a switch that you can turn on and off in your head. It is a condition that is embedded in your view of yourself. I still struggle with the idea of failure. For example, my last internship was at a very fast paced company in the Bay Area. I went into it feeling like I had a lot to prove and, because of this, ended up asking less questions than I should have in the beginning. Not having a super solid foundation almost cost me a job offer at the end of the summer and it was all because of my stupid, dumb, irrational fear of failure. 

Well I just read it back (yes, I do proofread… surprising right?), and honestly. I just spent like five minutes rambling on to you about how my life is so hard now because I am scared of failure because people told me I was smart my whole life blah blah blah. Sounds terrible right? Yeah, not really. I’m not looking for any sympathy, though. That’s not the reason I’m writing this (can you imagine how messed up it would be if I WAS just doing this for sympathy?). I do ask you to consider your own situation. Are you afraid of failure? Do you have questions but think twice before asking because you are scared of them making you look unintelligent? Do you ever have trouble starting a project or business just because you don’t want to mess up? Well if so, then hopefully I can give you some tips for overcoming your fear. What kind of blog would this be if I only complained about my mistakes without offering ways to avoid them?

Believe it or not, the best thing you can do for yourself to get over your fear of failure is to fail (seems easy right?). Take more risks, ask more questions, and most importantly: seek out criticism. Over time, you won’t overthink the failure part in advance, and as a result, won’t be paralyzed to the point of not starting. I would gladly argue with anyone that failing is the best way to increase learning potential (I’m serious about that: if you don’t believe me, just ask me). As programmers, we are constantly learning. New technologies are being developed nonstop, and if we ever stop learning, then we fall behind and our performance can suffer as a result. So yes, in order to achieve a high level of success as a programmer, you have to fail… a lot. Luckily for you, I have outlined a few specific examples of ways that we can open ourselves up to the possibility of failure in our jobs. You’re welcome.

I have mentioned it a lot already as examples for various points, but asking questions is, in my opinion, the best (and easiest) way to open yourself to the opportunity of failure. It is a win win. Either you ask a question that is relevant, on topic, and increases the perspective of not only you, but everyone else listening. Or, your question makes no sense, everyone around you knows that you don’t understand, and you feel embarrassed. While one of those outcomes feels more attractive than the other, they are actually both productive (assuming you have believed everything I have said so far). The second outcome is a form of failure that can be very helpful to you. If something like this happens, then whoever you are asking the question to will know you don’t understand and provide a more in depth explanation of whatever it is you are discussing with them. Chances are you will also be hyper focused for this second explanation because you don’t want to look like an idiot again the next time you have a question. As a result, you will get a better explanation, be more confident in your own understanding, and will be more likely to remember this particular topic because you won’t easily forget your own embarrassment. I know its a total clique and some of you think it doesn’t have to be said, but the only bad questions are the ones left unspoken.

Seeking out criticism is another form of failure that I believe is crucial for programmers to be familiar with (and before you say that this isn’t really failure, criticism means you did something wrong in someone else’s eyes and wrong=fail. I know it’s a stretch but bare with me). Code reviews are a common practice nowadays. I, like everyone else, have many opinions on the specifics behind them, but in a nutshell, I think they are essential in the process of writing high quality code. The result of a code review is a (sometimes endless) stream of comments and suggestions that someone else believes are applicable to your code. It’s true, some reviewers are much more strict than others, but I am going to go out on a limb and tell you to TAKE ALL SUGGESTIONS SERIOUSLY. Wow, all caps. I must really mean that. And I do. Just having someone else’s perspective is invaluable. Now how does this relate to failure you ask? Well, you may have guessed (based on your own experiences) that even though most programmers will say to keep an open mind during code reviews, no one likes getting comments. Comments imply that something in your code is not perfect. If you spent hours working on an elegant algorithm, then the reviewer looks at it and says something like “would it be better like this…”, it will be hard to make the change even if you know they are right. Suggestions of any kind, not just during code reviews, register as a failure in our brain. As a basic social principle, we, as humans, try to please as many people as we can. A suggestion means someone wants us to do something differently because we have failed to please them (it sounds extreme, I know, but hear me out). This can be hard to deal with especially for young programmers (and young people in general) because they feel like they have a lot to prove (I know that’s how I felt). But I am telling you, this is the most crucial time to keep an open mind. Respect all suggestions and constructive criticism you may receive in your life. Like I said, someone else’s opinion is invaluable. If you are particularly bad at receiving criticism (like me!), then whenever someone gives you a suggestion, take a deep breath, try to see it from their perspective, and speak peacefully (i.e. not defensively). Pretty easy acronym to remember: breath, perspective, and speak peacefully; or bfs for short (I definitely did that on purpose for all you programmers out there). Going back to what I said in the beginning, you should eventually try to go beyond the bfs system for dealing with criticism and seek it out yourself. You will get even more used to it and become a better programmer because as a result.

At this point this post is very long so sorry about that. I am tired of hearing my own voice in my head while writing this and honestly I am not sure why you are still reading. I hope that I have been able to provide you all with some helpful advice because this is a problem that I have struggled with my entire life. I set out to write this post about why failure is good in a mostly professional context. But after writing this, I am realizing that I have failed far more in my social life (honestly I could probably write a book on it, lol). So I am saving my encounters with non-professional failure in my social life for a later post. For now, ta ta and happy failing!

why i hate tv

Television, movies, and the work that goes into them is something that I think is very underappreciated. Actors do make a lot of money, yes, but it is a lot harder than it looks–that’s kinda the idea. At my university, the fine arts students are some of the most hardworking people. Their devotion to their craft explains why the field is so competitive. But you are probably curious as to why this is titled the way it is. Well in case you thought you read it wrong, it does say WHY I HATE TELEVISION. Thought I would put it in all caps for the case that anyone reading this doesn’t know their lowercase letters yet (gotta account for those edge cases!). Hopefully this doesn’t get too ranty because I am going to discuss some ideas that I think people should at least consider… even if they are exceedingly unpopular. Before we start though, I want to clarify that by ‘television’, I mean shows, movies, youtube, and pretty much any other sort of streaming based passive entertainment. Now that all of your brows are creased and your veins are popping out of your neck, let the tv trashing commence.

Starting off from a science perspective, watching television is just not a healthy habit to get into. As programmers, we tend to stare at screens all day, so extending that time obviously does not help our vision. Not to mention the negative effect that repeated use can have on posture and cardiovascular health. Many people do not watch television sitting on the couch staring straight ahead with their backs in a neutral position. They are curled up in a ball, lying on their sides, with their necks craned to to get the best view of the screen that they can. Not a very healthy picture, now is it? But obviously it isn’t all about health. 

If you read the last post (which you probably didn’t) about how important I think time is, then you probably saw the next complaint coming. Watching television is a HUGE waste of time. “Woah woah woah”, you are probably saying to yourself, “did he just use a superlative AND all capital letters? How could he say that?”. Fine, fine, it is not always a waste of time–there are a few exceptions. To correct myself, watching television is almost always a HUGE waste of time (happy?). As programmers, we have the ability to work anywhere and any time. We all have laptops that we can lug around to the coffee shop, library (do those still exist?), and wherever else you want to show off in public that you are a programmer. There is literally no reason that you can’t be working all the time. Now before you yell at me in your head (or maybe aloud?), I am not saying that you should spend all day working. I am just saying that if you are going to be looking at a screen, then maybe it would be better to do something productive. Many of us are very ambitious. The CEOs of tech companies have shown us that nerds can rule supreme and many of us want that to a certain degree. I hate to break this to you, but if you want to be successful in life, then you have to put in the work. Consider your bubble burst. If Rome wasn’t built in a day, then Mark Zuckerberg did not create Facebook while being mesmerized by the television. 

Watching television is a passive activity. All you have to do is sit there and comprehend what is happening. It isn’t that hard. It isn’t hard at all actually. Having a thought process is barely a prerequisite, nevermind doing any sort of critical thinking. One of my philosophies in life is to learn as much as you can whenever you can, about whatever you can. As humans, we can only really concentrate on one thing at once. You can think you are the best multitasker in the world, but you are still only really tricking yourself into doing two things at once by rapidly switching between the two (like multiprocessing!). When we watch television, it saps up all of our attention making us unable to focus on anything else. Combine this with the fact that it is a passive activity, and you get what I like to call a mental deadzone (basically time that your brain isn’t learning or thinking). This is pretty much the worst way you can spend your time. Not only does it make us feel like our time is wasted (in addition to actually wasting time), when we stop watching after long periods, it feels like (at least for me) my brain is melting. Okay sorry about that. It did get a little ranty there for a second. Gonna take a deep breath………………………… Okay, I think I am ready to continue now. 

I just spent the entire last paragraph explaining the reasons why I think watching television is bad. But are there exceptions? Well you doofus, of course there are exceptions! I literally said in the last paragraph that there were. Let’s start with what I believe to be the most obvious one. My big problem with television is the mental deadzone that it creates in our timeline of thoughts. But what about educational television, something that will make you think and, dare I say it, learn? I think it is pretty obvious that this type of video consumption is warranted (according to me?). I should probably prefix television with ‘bad’ in the title, but it doesn’t really have the same ring. I define bad television as “a stream of images and sound that was not made with the objective of teaching”. This may seem like a weird definition, but it holds for several notable categories. Things like news channels, youtube tutorials, and howtos are completely acceptable. They help us to learn new things, were created with education as a primary intention, and therefore, make us think. On the other side of the spectrum, ‘binge worthy’ shows like Game of Thrones, Breaking Bad, or (<crying face>) The Office are obviously not educational. For the skeptics out there that are saying “But Greg <pushes glasses back in place>, I learned about chemistry from Breaking Bad”, that may be true (and if so I am sorry you never took a chemistry course). But it was not made with any objective of teaching. The learning that you may have done from these shows is only there because of plot coincidences that you only remember because you never paid attention in class. 

There are a couple of other exceptions to the rule of “never watching tv” besides that it depends on the content itself. Firstly, if you occupy your time while watching television with something other than television at the same time, then you don’t lose any time to a mental deadzone. Keep in mind, this is a slippery slope. Just because you have your notes on your lap and were “studying” while watching television doesn’t mean you actually didn’t waste any time. If you are going to use this excuse to justify watching anything, then make sure have strong enough willpower to stay focused on whatever you are working on in parallel. 

Television is often used as a social activity (especially among my generation and younger) which kinda falls under the umbrella category as “something in parallel” like I talked about above, but I think it deserves special mention. Now as programmers we get a bad reputation for being at the bottom of the social food chain. Oftentimes the stereotypes are true, but I don’t want to use pity to justify watching TV for social interaction. Spending time with others (humans, not computers) is necessary for us to keep our sanity (for lack of a better phrase). If watching television will afford you more time with other people, I am the biggest advocate for it. 

Just because I would feel dishonest for not saying this: I am a huge hypocrite. I used to watch television all the time. Pretty much all the shows I have mentioned in this post are shows that I have watched. I think I have seen The Office like six or seven times all the way through so I really don’t deserve to be talking. When this anti-television opinion was brought to my attention, I started to think about how much time I spent streaming media. Youtube tracks how much time you spend watching per week and you may be surprised to see how much time it is. After awareness, comes planning. Make a plan and set some goals for how you want to limit your streaming. I know it sounds stupid but WRITE THEM DOWN. Goals always have more of a chance at success if you write them down. A couple ideas to get you started: 1) Try to watch less than you did that last week, 2) every time you go to watch something on habit, turn on something educational, or 3) try experimenting with hobbies. Once you make the goals, the last step is the stick to them. Hold yourself accountable and effect change. You are the only one with the power to do so (duh, it’s your life). I have been sticking to all three of those goals for a while now and I have had a lot more time to make a positive impact on my life. So as wobbly as my advice usually is, if it worked for me, it can (probably) work for you. 

Now before you just dismiss this post as the rantings of a madman (like everything I write), take a look back to the last time you watched television. Now think about how much time you spent watching television in the last week. Now think about how often you got up off of the couch after watching and felt accomplished, rejuvenated, or motivated. If you were surprised by the answers to those questions, then maybe it’s time to make a change. I think you will be motivated to make the same changes as me.

Kinda my Schedule

Continuing the common theme of providing my readers with a background in my life, I am going to take this time to discuss a typical day. More specifically, a day in my life. Now if you have half a brain, then you have probably judged me thus far to be an interesting person. Well, my young friend, you are correct in your assump– lmao. I can’t even say that with a straight face. Honestly, my days are really boring. In the name of efficiency, I am a creature of habit. Every single day is almost identical in structure to how it did last week. Every day I wake up, I do stuff, then I go to sleep. But Greg, “when you recount your day, never say you woke up. That’s a waste of your time. That’s how every day has is begun since the dawn of man”. The astute of you will know what that is a quote from, but I won’t waste your time on that for now. I do, however, think it illustrates my philosophy for time management. So for the rest of your time reading this, you can learn about my week, why I organize it this way, and hopefully, gain a different perspective than your own.

Every morning starts with my alarm clock at 5:50am. I get ready for the next 5 minutes to be at the gym when it opens at 6:00. Working out gets me energized and focused for the day. I found that before I started working out early, I would waste time trying to shake off my morning funk. Going to the gym wakes me up, checks working out off my daily to-do list, and allows me to stay in my morning shower routine without showering more than once per day. Because everyone knows the best time to shower is in the morning (change my mind). This early routine also gets me at breakfast in time to skip the line at the omelet bar. I want to talk about nutrition and eating healthy at some point in a future post because I think it is all about habits and I want to make sure you all start good habits early. Software engineering is a dangerous lifestyle because we spend most of the day sitting down. Without the right diet, this can lead to negative health conditions later in life. After breakfast, I go back to my room to shower and get ready for the day. Like I said, I am a pretty boring person, so my outfits change between about seven different options (one for each day lol). I like to look my best, but I am not exactly good at matching clothes, so I am stuck with the seven outfits that (not gonna lie) my mom said: “work for me”.

Finally, at around 9:00am, I start work. Now because I am a college student, my schedule is a little unpredictable. I consider classes to fall under the category of ‘work’ just like homeWORK and work WORK. So I’m gonna call it all work. Now listen up because I am about to drop some premium college advice for you guys. The key to not missing anything in your calendar is actually having a calendar. BOOOOOOOM! That was the sound of your mind being blown. I know right? Who would have thought? But seriously, before you just straight up stop reading and never come back, let me explain a little bit. When you have a job where you work, say, 40 hours a week, your schedule is very consistent. You always know when you will have to be at work and when you will have free time. When you are in college, you may be walking to and from six different activities throughout the day. Whether they are classes, meals, meetings, appointments, or anything else in between, the average college student is almost never in the same building for even two events in a day. The only way to keep track of everything is with a calendar. This could be google calendar, apple calendar, or even (if you are old school) a physical calendar that you have to use a real pen for with like ink and stuff. If you are from the younger generation and aren’t sure what a pen is or how it works, you can probably find a tutorial on Youtube. Calendars are (unfortunately) the only way to turn chaos into order. If you want to get really into it (and I suggest you do!) you can color code the events, add locations, pictures, or special reminders that will help. In addition to all of those being helpful features, they will also help to motivate you to stick to your calendar because it will feel more like your own. I personally check my calendar about 100 times per day and sometimes only to stare in admiration at the beauty that I have created. To give you guys an idea of what I am talking about, here is what my calendar looked like a week from last semester:

One of the busier weeks from last semester

Somewhere between all my events, I have lunch (preferably between 12 and 1) with some of my friends (I swear I do have them). After I am done working for the day, I relax with a couple youtube videos or an episode of The Office and then go to dinner. I try to take my time with dinner especially if my day was especially long. Not that I don’t get any homework done during the day, but for whatever reason, I am much more productive at night. Maybe it’s because I know I have to go to bed early and the time crunch motivates me. Maybe it’s just because the darkness makes me want to work… I honestly have no idea. Because after dinner, I am always hyper-focused. I usually complete all my assignments and then work on some personal projects as well between dinner and around 10:00 when I start to get ready for bed. This allows me to get into bed by  11:00 (it takes me an hour because my roommates usually distract me) and get enough sleep before my alarm goes off the next day at 5:50am. For a while, I had a really hard time falling asleep quickly at such an early time, but after doing some research, I adopted a technique that the navy uses to help the sailors fall asleep faster. Usually, I can fall asleep in 2-3 minutes if I want to, but oftentimes I stay up a bit thinking about the next day or something that had happened earlier that day. Pretty typical of me honestly to put off what I am doing to think a little (or a lot). 

So that’s my day for better or for worse. I kinda went off on a tangent halfway through there talking about my calendar. But like I said, it is hard to talk about my day because each one is very different. So that was my way of giving a general approach to how I do things. I hope you learned something (although most of that was common sense). But anyway, I hope you can feel a little bit better about how interesting your days are now that you know how boring my days are. Chow for now!

Why Blog though?

Even though I explained the main reason for writing this in the first post, I figured I would follow it up and explain the story behind how I came about starting this blog. Now you may be wondering: “Greg, if you love writing code so much, then why do you want to write plain old English for this blog?” Well that is a very astute question of you my young friend. I would have asked the same question. My explanation for it, unfortunately, is not very simple… so let me paint you a picture.

It was the end of the summer, 2019, and a young computer science student had just returned home from a summer internship in California. Being from a relatively low key town in Connecticut, the young student was very happy to be home and away from the constant bustle that everyone in Silicon Valley seemed to be infected with. The first couple of days he enjoyed relative freedom. He no longer had to deal with the constant stress of work and the endless tidal wave of notifications that plagued the summer. Countless hours were wasted playing video games, meeting up with friends, and streaming movies. But after a while, the student began to reflect on his summer. He began to think of the best parts of the summer. He reminisced about how he was constantly surrounded by people as passionate as him. Now that he was back in the “real” world, it seemed like no one really cared about making anything happen. Our hero spent many nights lying awake in bed, unable to sleep because of the hole in his life that he now realized existed. Feeling lost and alone, he turned to reading. Not books containing works of fiction, but books masterfully crafted by experts in their fields about how to be successful. Beacons of motivation and drive that our young programmer had so desperately been longing for. For a while, he was content. But eventually, the same feeling came back to him. He still longed for the thrill that only motivated human interaction could bring. Eventually, he came upon a solution. A solution that would allow him to connect with engineers as passionate about their craft as he himself. A solution that would not require any physical relocation. A solution that you are now reading.

For those of you who didn’t get it, I’m the ‘young programmer’. Maybe I overdramatized my actual story a bit to make it more interesting but hey, we both know you don’t want to read something that isn’t interesting. In a nutshell, that’s how it happened though. The reason I decided to start this at all was to appease my want to connect with programmers like myself. It sounds kinda sad, but the reason this exists at all is because I was lonely. Along the way, while I was trying to pinpoint a topic, I came up with the idea of writing for introductory programmers like what I talked about in my first post.

There are a couple of other reasons that I think starting a blog is a really good idea. Most obviously, it can help improve writing skills. As much as you and I don’t want to admit it, there is a fair amount of writing (in like plaintext English) that has to be done to do our jobs well. Whether it’s writing documentation, comments, or even variable names. The more descriptive we can be and the less grammar mistakes we have can really help us in our jobs. Think about it, would you rather work with someone who is the best programmer in the world but writes incomprehensible documentation, or with someone that gets the job done, coding wise, but can explain everything they do in the clearest way? Yeah exactly. I thought so.

Always strive to be the programmer that you want to work with.

The other reason I started this is, to put it bluntly, I really need a hobby. I’m a full time college student, doing research, taking honors classes, working on a capstone project, working on personal projects, and I still find that I have free time. Previously, I just occupied it by watching Netflix or something, but I really hate watching TV. Definitely gonna write about that in a later post because I have no doubt that opinion is an unpopular one.

But yeah that’s it. Those are my reasons for starting this. If you think I need more reason, then I don’t know what to tell you because all that was enough to push me to start writing. I really can’t take any credit for this idea though. I got the idea from the book I am currently reading: “Soft Skills: The Software Developer’s Life Manual”. John Sonmez does a great job outlining the benefits of writing. He also explains what you need to do to prepare in order maximize your chance of keeping it up. So maybe he can convince you of the benefits of starting a blog if I did not do a good enough job. I, personally, could not have read it at a better time in my life, because, like I illustrated before, I was pretty desperate to connect with other developers. It sounds sad, but everyone goes through it at some point. At least I hope I’m not the only one…

Who am I?

Well now that is most certainly an introspective question. Does anyone really know who they are until they are finished existing? We are always evolving causing our identity to change… until it doesn’t. Because we die. But can’t identity change after consciousness ceases to exist? Is identity introspective at all, or does it have to do with how people perceive us? Well this is going to cause my brain to hurt over the next couple of days, and it’s all because I decided to start this blog with the question “Who am I” (even though it is a total cliche).

You are still reading at this point so I am going to go ahead and assume that I have your attention. I promise that initial paragraph will be most of the only existentialism I will discuss on this website. I just wanted to give you a glimpse into how I operate. That erratic chain of questions which is probably your first ever impression of me was supposed to show you how crazy my mind is. Oftentimes, I jump between topics that I am talking about and thinking about which can make me pretty difficult to follow. It is definitely something I will work on, I promise :). But consider this to be a disclaimer as to how I think, how hard it may be to follow me sometimes, and (because I may as well throw it in there) how informal this blog is going to be. I mean, there was literally a smiley face from 2006 two sentences ago. This isn’t exactly the NY Times people.

Just to get the basics out of the way, I am starting this blog as a senior computer science engineering major at the University of Connecticut. As for my name, I am of course Greg, first of my name, king of the Andals and the fir– sorry about that. I DID warn you of my scatterbrainedness. For everyone that is now wondering, I was very disappointed by the ending of Game of Thrones. Just like everyone else that has a brain.

This blog is going to be about my life. There. I said it. Now you know. I apologize for how boring that sentence was, but trust me it is necessary so that we are all on the same page. I want to use this space to write about my experiences, opinions, and important things I have learned in the beginning of my career as a software developer. Back in high school, my mind would have been put at ease if I knew more of what to expect from programming, college, and my future career. I worry about pretty much everything, so obviously starting college was not stressful at all (that was sarcasm for those of you who didn’t get it). But seriously I would have felt a lot better and been able to make more informed decisions if I had known then what I know now. So here’s to all of you aspiring programmers that are in college, high school, junior high, elementary, preschool, or (for the overachievers) the womb. I swear, you all get younger and younger every year…

Now for all of you who have any more experience than I do, you are probably scoffing to yourself thinking “what does this kid know?” Well put your pinky finger back on your mug’s handle and stop preparing that can of verbal whoop-ass you were about to lay down on me. Because I will be the first to admit that I know very little. Like close to nothing. Actually, I really can’t stress enough how under-qualified I am to be giving anyone advice. The reason I offer my advice and experiences is to put my opinion on display for those that need it to have some sort of guidance. Oftentimes it will be a ‘what not to do’ because I have made a lot of mistakes along the way. Like I said before, beginning to learn to write code as an entry level programmer can be really daunting. It feels like everyone is smarter than you, more experienced than you, and (worst of all) constantly judging you. To most of us entry level programmers, being wrong is scary, but other people knowing that we are wrong is exponentially worse. I want to make sure all those programmers that don’t really think of themselves as programmers yet understand that they are not the only ones. They are not the only kid writing little computer games to procrastinate doing their homework.

In a nutshell, that’s why I decided to write this. Pretty simple right? So to answer the initial question: “who am I?”… I am just a guy who loves writing code and wants to share that with as many people as possible. I think the software development world is really intimidating the first couple of years, so I am going to try to make it seem less so.

Okay so I was going to end it right there, but after reading it back to myself, I thought it sounded too sappy. I am a bit of a sap at heart but I can’t justify ending the first post on a sentimental note. So instead, I think I will end it on a cliff ha…