Browsing Tag



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

Tentative Syllabus for Computer Programming III

August 30, 2012

I was never a man to stick to schedules. It's not that I like to be late, or don't want to be on time. I just never am. Something always comes up in my life. That's why the following list is tentative and subject to change at any moment without prior notice. If it has been longer than a week and you want to move ahead please remind me to make a new post or share links that cover the topics.

Topics to be covered:

  • Generics
  • Stacks & Queues
  • Link Lists
  • Binary Trees
  • Multiway Trees
  • Hash
  • Sorting
  • Search Algorithms
  • Randomize Algorithms
  • Computing Complexity
  • Graphs
  • Intro to machine instructions
  • Intro to Multi Thread

Other topics, sub-topics and dates are soon to come.

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.