April 22, 2020

Why you should use GitHub

GitHub is one of many services where you can upload your code for version control. The basic idea behind version control is that code projects tend to become big and messy and version control makes the project less messy - especially if many people are working with the same project.
I think it was last year I really started to use GitHub for my code projects. I had several years earlier tried to start using GitHub but I stopped because I think I felt GitHub was confusing to use and I didn't really need it. But last year I found Sourcetree which is making GitHub less confusing to use (you don't have to memorize git commands). I also learned that GitHub has started to allow free private repositories - when I first started using GitHub all code had to be available free to everyone which is obviously not good if you are working on secret projects. So now I've put almost all my code on GitHub.

If you are working with a team then you almost always need to use GitHub or some similar service. But why should you, as an individual user, use GitHub?
  1. Backup. It's never fun when your computer crashes and your projects disappear into the darkness. To backup your projects you can copy-and-paste them into some backup software like Google Drive och Dropbox. This is working fine but can be a little annoying if you make many updates. With GitHub you can backup your projects with just a few clicks. You should still use another backup method because you can't trust GitHub - there's always a small probability that they will mess up and your code is gone forever, so it's always better to be safe than sorry. 
  2. Easier to experiment. Let's say you want to experiment with an idea you have and this idea involves deleting some code. Now deleting code for experimental purposes is never good because the experiment might fail and then you have to recreate the deleted code. With GitHub you can start different branches, which will split your code into branches and you can easily change between each branch to compare the experiment with the original code. If you are not happy with the experiment, just delete the branch.    
  3. You don't need to be tech support. What I've done lately is to publish some of my Unity tutorials on GitHub. I earlier had this pedagogical idea that people will learn more if they read the tutorial instead of copy-and-pasting from GitHub. But people will sometimes fail, so they will e-mail you and you have to spend time trying to solve their problems. It's also much easier to update code through GitHub than to update the code you earlier copy-and-pasted into html. So publishing your tutorial code on GitHub will save you time and energy.
  4. Free marketing. Something I realized after putting my code on GitHub is that people also found my code through GitHub's search function - they didn't come just from the original site. GitHub has a small, but still adequate, analytics page where you see from where people found your code. So if you want people to find you code you should put it on GitHub because it might be difficult to make people find your code by just making your original site rank higher in the search engines. And if you link your Twitter account from GitHub you will also get a few extra Twitter followers! 
  5. People will test the code for you. GitHub has this function where people can easily report issues with your code, which is really good because it might be difficult to test the code on your own.  

So how can you start learning GitHub with Unity if you have no idea where to begin? I think this tutorial is a good start: Using Git with Unity Tutorial [2019]. It will teach you how to use GitHub with Sourcetree. Atlassian, the creators of Sourcetree, has also created this online course: Version Control with Git, which you can go through in a few hours and it will teach you a little more than just the basics.

If you are interested in visiting my GitHub account you can find it here: github.com/Habrador

January 1, 2020

Books I read in 2019

Each year I write a list of books I read during the year. This is the 2019 list:
  1. Predator: The Secret Origins of the Drone Revolution. Tells the history of the most famous military drone: The Predator.
  2. Fighter Wing: A Guided Tour of an Air Force Combat Wing. A combat wing is a collection of different military aircraft organized to complete a specific mission. This book tells you about the different aircraft, the weapons, and the organization.
  3. Bomb Hunters: Life and Death Stories with Britain's Elite Bomb Disposal Unit in Afghanistan.  
  4. A Dawn Like Thunder: The True Story of Torpedo Squadron Eight. Tells the story of a carrier based squadron of torpedo bombers during the battle of Midway and Guadalcanal. 
  5. Designing Games: A Guide to Engineering Experiences. There are many books on how to make games, but this book is written by the game developer who made RimWorld. That game sold more than one million copies, so you better study the book. He wrote it before he made RimWorld. 
  6. Dust Off - Army Aeromedical Evacuation in Vietnam. Tells the story of medical helicopters in the Vietnam War. Is available for free!
  7. The Grid: Electrical Infrastructure for a New Era. One often forgotten achievement of humanity is that we have electricity in our homes. But this system is crumbling because the system is old and will also change to be more environmentally friendly, so if you want to learn about the feature of how to deliver electricity, you should read this book. 
  8. Logistic Support. Much has been said about the battles of the Vietnam War - but not what happened behind the scenes. To fight a battle you need ammunition, food, etc. How can you transport it from US to Vietnam in the best way? This book will give you an overview of the logistics behind the Vietnam War. Is available for free!
  9. Wind, Sand and Stars. Is a memoir written by a french pilot who in the 1930s was flying mail across the french empire. 
  10. Topgun: An American Story. Is written by one of the founders of Topgun (and yes it is "Topgun" and not "Top gun" as in the movie). Despite the name, the book is not only about Topgun - it's a biography of the authors career in the US Navy.  It starts with the Vietnam war, some Topgun in the middle, and ends when he commands an aircraft carrier. His basic idea is that the pilot is more important than the aircraft, so it includes some criticism of the latest aircraft in the US Navy: the F-35, arguing that a cheaper aircraft with a more skilled pilot would have been a better solution.
  11. Why Did the Chicken Cross the World? Tells the history of the chicken. 
  12. Last Stand at Khe Sanh: The U.S. Marines' Finest Hour in Vietnam. Khe Sanh was a military airfield in Vietnam and this book tells the story of when it was under siege for more than two months.  
  13. The Colosseum. Tells the history of the famous Roman amphitheater. The most interesting part is how little we know of what actually happened in the Colosseum. Not many sources exists, so movies have taken a lot of creative freedom. 
  14. Babylon's Ark: The Incredible Wartime Rescue of the Baghdad Zoo. Tells the story of what happened to the Zoo in central Baghdad after the 2003 Iraq war. 
  15. When Thunder Rolled: An F-105 Pilot over North Vietnam
  16. Worm: The First Digital World War. Tells the story of the Conficker computer worm which was a virus people thought would cause the end of Internet.
  17. We Bought a Zoo: The Amazing True Story of a Young Family, a Broken Down Zoo, and the 200 Wild Animals That Change Their Lives Forever. With the longest sub-title ever there's no need for further descriptions.
  18. Circle the wagons - The history of US Army convoy security. Is available for free. 
  19. Nine Lives: My time as the MI6's top spy inside al-Qaeda
  20. Humble Pi: A Comedy of Maths Errors. Consists of several examples of where minor mathematical errors have resulted in big consequences. For example, ground crew confused the units of measurement when they put fuel in an aircraft, so the aircraft ran out of fuel and almost crashed (the fuel gauges were also broken). 
  21. Surely You're Joking, Mr. Feynman!: Adventures of a Curious Character. A book about the Nobel Prize winner Richard Feynman (spoiler: he didn't want the prize). 
  22. Permanent Record. Biography on Edward Snowden.
  23. Unity 2017 Game Optimization - Second Edition: Optimize all aspects of Unity performance

Books in Swedish
  1. Det bevingade verket. Tells the history of the Swedish Air Force. 
  2. Med invasionen i sikte. Tells the history of the Swedish Air Force 1958-1966, and how a war with the Soviet Union would have happened. 
  3. ÖB:s klubba - Flygvapnets attackeskader under kalla kriget. Tells the story of the ground attack part of the Swedish Air Force during the Cold War. 
  4. System 37 Viggen. Consists of shorter stories written by people who were involved with the Viggen project, which was a Swedish military aircraft. 
  5. Svenska hackare. Gives you an overview of who has been hacking what with a focus on Sweden.
  6. Poltava. Tells the story of a famous battle between Sweden and Russia in the 18th century. 
  7. På spaning efter det okända - Bilder från kalla krigets ubåtsjakt. Each chapter is written by someone who was involved in the 80's anti-submarine hunts in Sweden. 
  8. Ubåtsfrågan 1981-1994. The Swedish government set up a total of three groups with the task of analyzing the assumed underwater violations of Swedish waters that have been going on mainly in the 80's. This is the second group's report.