Zen and the Art of Programming


As a teacher of programming, I come across a lot of new developers that are just like I was earlier in my career. They see software projects as finite things. Something to be built and finished. There are deadlines. There are so many more projects. This mindset leads to a lot of stress and an overwhelmed feeling. How can I get all of the functionality built? It is going to take forever, and I just spent 3 hours on a simple bug that should have taken 5 minutes.

Relax. Software programs are not a finite thing you build and finish. They are more like a living organism that grows and changes over time. They are never done growing, and unlike a real living being, they rarely die. I have software I wrote over 20 years ago still in production. Think of Microsoft Word. A word processing program that has been around since the 80’s. The first version came out in 1983. It is still growing and evolving. Microsoft still releases new versions.

When you view a software system as a living being that grows and evolves it changes your whole mindset. It is not about completing the project. It is about finishing this phase. What doesn’t make phase 1 can come in phase 2. On a side note, you see this evolution in the Software development lifecycle models. The industry used to use the classic Waterfall method. You gather all of the requirements, build every possible feature and then release the product. Done. Finish. Well this didn’t work so well so the industry moved to Agile, where you are never finished. You just release new features every couple weeks. To now, Devops. Where you continuously build, test, and deploy. It is the industry progression of viewing software as a finite object that is built to a living organism that is fed and maintained on a daily basis.

As a developer the sooner you get to this mindset the better. I find it much more relaxing and sustainable. No longer do you need to stress about getting all of the features built and finished. You just focus on today and what feature you want to add today. Each day you make the system better. One day at a time. Progress not perfection. Everyday when you go home you know you software system is better than the day before. Next thing you know, you look back a few months later and it is amazing how many features and pieces of functionality have been added. It is also amazing, given the constant changes in technology and business, how many new features you need to add. All in due time. One day at a time.

I recently taught a beginner C# class. It was 4 weeks long on Tuesday and Thursday nights for 3 hours with one Saturday. I told the students the first night that we would build a full functioning card game application that could play Blackjack, Poker, and War by the end of the class and it would include multiple players and games and remember a players game history. They thought I was kidding. They thought it a noble effort but not something we could actually do. After all they were new to programming and C#. But each day we bit off a new piece of the pie and slower but surely we whittled away. I told them all along not to focus on the whole effort or all the things we needed to do. Each night just focus on the piece we were doing that night. I even told them that maybe we won’t finish it. Maybe it isn’t reasonable. Who cares if we finish. It’s the journey not the destination. Enjoy the ride. Have fun. Focus on just what we need to do today. If we don’t finish today we’ll finish the next class. No worries. But in the end we did finish at least the initial functionality of the games(Remember programs are never finished. We can always add more to it). And they did enjoy it. They weren’t overwhelmed and stressed by the effort. They enjoyed the journey knowing that if we didn’t finish tonight we would at least make it better tonight. They left the class with a working program but also many more changes they can build to continuously grow and evolve the system.

Since I started viewing software as a living system that grows and evolves everyday. I have learned to enjoy the art of programming much more. Everyday is spent teaching, growing, and learning as I evolve along with the system I am building. It is a journey we are traveling together.

Learning to enjoy programming – when you are stuck on a bug you think you will never solve.

As I teach new programming students, I inevitably see frustration in trying to figure out why their program will not build. What this syntax error really means. They get increasingly frustrated and dejected at the possibility of becoming a programmer. To anyone who is a programmer you know this feeling all too well. It is part of the job: the hours that can be spent on a single problem. The hopelessness of never being able to figure out what this error message really means.

But when you learn to love programming these moments become different. To quote a few passages from my spirituality studies, “it’s the journey not the destination”, “this too shall pass”. Programming is an art to be savored not completed. Not that completing a project is not important, but take these opportunities to learn an hone your craft. When you start to see them as learning opportunities instead of wasted time your outlook will change completely. It is not hours wasted on a program that should take 5 minutes. It is a chance to better your debugging skills, to learn more about your ide and how to troubleshoot with it, to learn shortcuts and more efficient techniques. Then the hours are not so frustrating as long as you keep in mind that “this too shall pass”. You will figure out what your bug is and along the way enhance your skills and become a better programming.

We all too often focus on the goal instead of the journey. Approach the problem with an open mind not a singular purpose of solving the problem in the shortest amount of time. Like everything in life it is all in your mindset and expectations that dictate your attitude. This is true in life and in programming.

Take a step back and enjoy the process. You will figure out the problem and learn a few things along the way that will make you a better programmer. And if nothing else, you will have a good war story to tell.

Software Development Fundamentals

I was putting together the outline for another book that I am working on called Software Development Fundamentals. It is intended to be an introduction to the world of software development. More than focusing on a specific language or methodology, it is intended to detail the different things someone would need to learn to become a skilled software developer. Let’s look at the 9 items I have come up with.

1. Programming language. Well, this is kind of obvious but you have to learn a programming language to be a programmer. This chapter will discuss the different languages and their pros and cons. Should you learn an object oriented based language, procedural language, or a scripting language? Should you learn a compiled or interpretive language? Should it be strongly typed or loosely typed? These all depend on the types of development and applications that you will be building. Are you going to be a game developer, enterprise application developer, or mobile app creator?

Every language has the same basics. It has data types(a type system), branching, looping, boolean expressions, arithmatic expressions, and reusable blocks of code you build(methods, functions, classes, etc).

2. IDE. Integrated Development Environment. This is the tool that you will program with. Do you need a full IDE with debugger and other tools, or will a text editor suffice. But either way you have to become a comfortable and proficient with an IDE to be a real programmer. The IDE is your best friend. This is what makes or breaks your productivity and frustration level.

3. Database. It is very hard these days to be a developer and not store or retrieve data. To be a real developer you will need to learn database basics. You don’t have to be a dba but you will need to know how to build a simple database and get and put data into it. The big question here is to learn a SQL or no SQL database. There are many good options of each. SQL database like SQL Server, Oracle, and MySQL are structured with tables, rows, and columns. No SQL databases like MongoDB and DocumentDb typically store data items as documents in JSON format. SQL has historically been the most used but No SQL databases are becoming very popular.

4. Framework. A framework is typically made up of 2 things. Reusable code(objects, libraries, packages, etc.) so you don’t have to build everything from scratch. And an environment that you code will run in. If you are a C# programmer, for instance, the .NET framework is what you will use. If you are a Java programmer you will use frameworks like Swing and the JVM(java virtual machine) to run your code. If you are a web developer you might use the Angular framework on the client and Node and NPM(Node package manager) on the server side.

5. Software design techniques. You will need to learn things like object oriented design, wireframing, use cases, flowcharting, and test driven design. These are all the techniques that you will have in your toolbox to allow you to take a set of requirements and turn them into a working application that solves a problem. This is how you take a concept and break it down into pieces of code that you can actually write.

6. Design patterns. These are common ways to solve problems with software. A common way to tackle a problem. For instances, many graphical user interface applications use the MVC(model-view-controller) design pattern. Others use the MVVM(model-view-viewmodel) design pattern. Another common design pattern is object oriented. You build a set of software objects that model real world objects. OO can also be described as a software design. Pipelining is a common design pattern for developing multithreaded and parallel applications. Design patterns will be you go to way of solving certain types of problems or building certain kinds of applications.

7. Software Development Lifecycles. SDLC’s are ways you manage the the life of a software project. This typically includes the following steps – gathering requirements, software design, coding, testing, deploying, and maintaining. Here will learn the classic waterfall method and newer methods like Agile and Scrum. But the SDLC is how you manage the whole project and life of a software system that you are building.

What do you think? Did I leave anything out? I believe if you focus on learning picking an item in each of these 7 categories you will be well on your way to being a successful developer. Like for instance, if you learn C#(1), Visual Studio(2), SQL(3), .NET(4), wireframing/flowcharting/oo design(5), MVC(6), and Agile(7) you will be able to call yourself a skilled C#/.NET application developer.

What are you waiting for.

So you want to be a programmer – part 2

So, you want to be a computer programmer. Previously, we talked about the need to program to be a programmer. But what kind of programming. Let’s assume for this discussion that you want to be an independent programmer/entrepreneur. First, you need to decide waht kind of freelancer you want to be. Do you want to develop websites, web applications, games, mobile apps, etc. This will dictate the language you should learn, the platform you should become familiar with, and the ide/tools you should become proficient with.

If you are going to be a website or web developer then javascript will be the language you want. You will also need to know html and css but these 2 are not “programming languages” per se. They are markup languages. They do not contain programming constructs like branching, looping, logic, and functions/methods. Javascript is the language of choice by far for web development.

If you want to be a game developer then there are several choices, but the tools are more important here probably than the language. I would suggest the Unity game engine. There are several good game engines, but Unity seems to be gaining the most attention. This will lead you to learn C#. This is the most popular scripting language for the Unity game engine. Secondarily, to this you will also need to develop knowledge in 3d graphics and need an eye for graphics. This is not my speciality and due to this I have stayed away for game development and website design in my career. I outsource the design elements of the projects I do.

If you want to develop apps the 2 most popular are Android apps and iOS apps. Android lives in the Java programming world. For this you will want to learn Java and then pick an IDE. Eclipse is a very popular open source IDE that is also easy on the budget(it’s free). There is plenty of online help with the Java/Eclipse world to assist you as well.

For iOS the language was ObjectiveC but is now moving to Swift. Apple’s Xcode is the IDE for this language and is really the only choice. There are 2 downsides to developing iOS apps using these tools. First, there is some cost. You need to buy Xcode, and Apple development box and an Apple mobile device. Secondly, this skill set will pigeonhole you into just Apple products. Another iOS approach now is to use C#/.NET/Visual Studio w/Xamarin. The downside to this is you are developing Apple based software using Microsoft tools. This platform is fairly new for Apple development and it’s use is not widespread yet. The upside to this is the knowledge you gain learning C#/.NET/Visual Studio can be used to develop for the Windows platform. Also you can use the Visual Studio IDE for Android and Web development as well. So, you are not as pigeonholed into Apple if you decide you want to branch out.

Another mobile platform to explore is Windows 10(don’t laugh). The reason I mention this is not due to the huge market of Windows mobile devices, but due to the huge market of Windows desktop, laptop, tablet, and XBOX devices. Windows 10 allows you to develop across all of these platforms plus HoleLens(up and coming) and IOT(internet of things). Also, the Windows platform with C#/.NET is one of the largest installed bases for business applications if you decide in the future to work for a company instead of yourself. This is also a benefit to Java as well. Java is another very popular language for business applications. Incidently, this is also a downside to Swift/Xcode. The Apple platform has a very small user base in business applications. Apple does not play in the backend server market like Windows and Linux.

MY recommendations overall are….If you want to develop games learn the Unity game engine. If you want to be a web developer learn JavaScript/HTML/CSS. Also, learn NodeJS for server side javascript programmer and the Angular framework for client side javascript programming. This will allow you to develop full stack web applications. For mobile applications(against most other recommendations) I would learn C#/.NET or Java and skip ObjectiveC/Swift(this is just too specialized a platform).

Overall, and this will sound very Microsoft centric, if you learn C#/.NET/Visual studio as well as HTML/CC/Javascript you will be able to develop pretty much any application for any platform. This is due to .NET Core now being offered for iOS, Android, and Linux. This will allow you to develop web applications, mobile applications for Apple, Aondroid, and Windows, and games with Unity. It will also set you up to develop business applications for companies.