Browsing Tag



10 Lessons Needed To Learn Programming In Any Language*

October 19, 2015

Without farther delay, here is my top 10 lessons to learn programming in the order they should be taught:

  1. Environment Setup, Input/Output
  2. Integers and basic arithmetic (+,-,*,/,%) + order of operations ()
  3. Float Arithmetic
  4. Variables
  5. Booleans
  6. Conditional Statements & Control Structures
  7. Functions
  8. Strings & Arrays
  9. Classes
  10. Exceptions

Ok, I lied. A lot of these have to be broken down and cross referenced. However, I think that should be the order in which people are introduced to programming. Too often people try to learn everything all at once. You can’t learn how to swim by jumping into the deep end. Well, some of us can. Learning a new skill isn’t always as easy to other people as it was to the teacher. Whenever I get a chance to be a bookstore, I like to look at beginner programming books. They all promise to teach a lot in a very short time. The honest truth is there is no shortcut. It takes a couple of years of programming in order to become a half dissent programmer. It is not because it is hard, it is just because there are too many variables. There are so many different things that you need to learn, that it can’t occupy just one book. It can’t even occupy the whole Internet. New things come up everyday that change what you knew before. Becoming a programmer is just one of these thing that require time.

So what is with this list? I got asked too many times at this point how I started programming and where/how to start. I have decided to write my own intro to programming. Over the next weeks I will publish small lessons that will build up to an ebook on programming. I will use Python-ish style code and most of the content will be generalized for almost any language. By the end of the book, you will be able to learn the syntax to a new language and program in any language you want. Best of all, the ebook and lessons will all be posted on this site and will be FREE. No strings attached. I believe anyone can learn programming at any age and that education should be available to all.

I have taught a few students before and there are several reasons why my list is different from other learn programming classes. The main objective is to start with something familiar that everyone in the 5th grade should know. Basic arithmetic and numbers. Than slowly build up while introducing new ideas and concepts. The secondary objective is to fully learn a topic before moving forward. That means when we will talk about a new concept we will go back and see how it reflects on other topics we have learned before. We are going to aim to turn fragile knowledge into concrete building blocks that will help us move forward and ultimately complete our objectives.

It should be mentioned what this course will not achieve. Beyond all else, you will not become a certified programmer or a hacker. Like I said before, that will take time. There is no class in the universe that can teach time. After you have completed the lessons, you will have to continuously learn new skills and develop yourself as a programmer. Think about learning programming more like going to the gym. You will not get a six pack and lose 50 lbs. in one setting, it takes time. Same thing with programming. You need to invest time to become a programmer. Just like going to the gym everyday, it will pay off in the long run and you future self will look back and thank you.

There are a bunch of reasons of why you should learn programming, I don’t feel like repeating most of them. I will just mention one. Programming is everywhere and it is here to stay. Programming has become a tool that used in virtually every field, even philosophy and history. Programming is almost equivalent to using excel. It is a skill more and more employers are looking for and will make you more valuable and your job easier. There are endless examples of how programming can shorten your job and sometimes turn an impossible human task into a simple short snippet of code. I believe that if you are reading up until this point, you already have a goal to learn programming. Or maybe you have already been through a class, but feel like you have missed the points and you want to know more. In programming there is always more to learn. Remember that.

First lesson will be published within a week. Make sure to follow me on Twitter @CptDeadBones to get notified.

* Ok. So technical, the class will teach you how to program in almost any language.


What is Programming?

August 30, 2013

I just got back from a month trip to Europe. As much as I wanted to stay away from computers and discussing work, I quickly found it is hard to stay away. While I was visiting family, one of the usual questions was what do I do. My normal response is that I am a computer scientist, to which almost everyone in my family responded "what?" with a wired look on their face. I quickly found that if I answer "I program computers" they understand and leave me alone. If you have taken any Computer Science class the first thing you should have been told is that "Computer Science is no more about computers than astronomy is about telescopes". That is true for the most part. Programming is an art, it is a process to create something. Computer Science is all about exploring the options, it is about algorithms, it is about problems and possible solutions. There is nothing in Computer Science that actually requires you to even know programming. One of the key faculty members at my undergraduate university did not have anything o do with programming, he did not have a degree in Computer Science, he did not even have a computer in his office. Yet, he was a Computer Science professor who teaches algorithms. It might be hard to comprehend at first, but the more you learn Computer Science, the more you discover that programming is just a tool. It is nothing but a tool.


Everyone like tools. Tools had been used by humans for a long, long time. We even found animals that use tools to hunt a gather. So what king of tool is programming? It is a computation tool. Much like a very powerful pocket calculator. One can utilize programming to accomplish repetitive or complicated tasks that would have taken a human a long time to complete. For example I could calculate by hand the 100th prime number, or I could use python the find the nth prime number. Both will produce the same number, one will take a split second, the other might take a while longer. This example has much to do with math. There are known formulas and "shortcuts" one could use to find the solution faster, but it is still not a Computer Science problem. It is a very good beginner programming problem.

Now that we have established what a programming problem looks like, let us look at what a Computer Science problem might be. Stable Matching, or Stable Marriage is a problem many algorithm books begin with. You could look at the basic definition of the problem below:

Problem description
Given an equal number of men and women to be paired for marriage, each man ranks all the women in order of his preference and each women ranks all the men in order of her preference.

A stable set of engagements for marriage is one where no man prefers a women over the one he is engaged to, where that other woman also prefers that man over the one she is engaged to. I.e. with consulting marriages, there would be no reason for the engagements between the people to change. -- Rosetta Code

Now, how could we even begin to solve this with programming alone? Programming is nothing by giving the machine mathematical instructions. In the case of the 100th prime number, we can literally count each number and check if it is prime. How could the stable matching problem be solved with programming alone? It can't. In order to solve this problem we need an algorithm. A logical set of instructions that can provide a correct solution to this problem. A computer scientist will sit with this problem and come up with a variety of solutions, with paper and a pencil (or a whiteboard). Once a optimal solution(s) is discovered, it may or may not be actually programmed into a computer, but that is not a requirement. One a solution is found and proved to be both correct and efficient, as a computer scientist my job is done.

Now you may think that given all this Computer Science looks done on programming. I know it may sound like this, but the truth is that with programming there could not be any room for Computer Sceince. The truth is Computer Science fins ways for the future of programming. Computer Science introduces ideas that later are implemented. As a compute scientist, there is no greater joy that programming your solution and seeing the results printed out to you. It is much like Astronomers could do very little without telescopes. After all, there is a limit to what can do in the abstract world of theory, where memory never runs out and the processor is always running.

Computer Programming III

Computer Programming III

August 30, 2012

Please read my assumptions post prior to this post.

After learning the basics of programming and maybe even Object Oriented Programming (OOP) the natural continuation of is data structure and algorithms. Many universities have different names, but most of them teach data structures as the third semester computer science majors. I think that after about a year within the program you really need to learn to expend. In order to achieve this you will need the terminology. You need the understating of link lists and trees, stacks and queues and so on. You also need to understand how to read and implement algorithms. With time, you will find I have a very different thinking method, and a strong opinion on the state of education. Not only in the United States, but world wide as well.

Post that will be filled under this will be divided into sub categories. There are 3 major topics that needed be addressed before you can move on to any other aspect of programing, computer science, or related specialties.

Topic #0: Data Structures. I do believe algorithms ought to be thought from day one of programming. For the time being, the first few posts will be data structures to serve as a jumping board to the deep end of algorithms.

Topic #1: Algorithms. These will be where I dwell the most. Specifically how to use them to make your life a whole lot easier.

Topic #2: Languages. Although discouraged, I do believe that as a programmer you will need to gain the ability to learn new languages. Implementations related to the above topics will be posted for now, in 3 languages, python, c and java. I don't promise I will make examples in all the three, but I will do my best to share your exposure to code in all 3 languages.

We will start by looking at some simple data structures and than go back and fourth among all these topics. All of the posts might include links to other posts, categories or off site references. I will post a list of references as soon as I can and I will try to keep it most up to date.