Thursday, October 11, 2012

A discussion against mathematically ignorant Code Monkeys

Hello everybody!

  You can consider the following my take on how people should consider programming, and its relation with Mathematics.  Now a huge pet peeve of mine is when I am relaxing while reading some papers and I see that advertisement come on the television which says "You can make games without programming or maths", or when you hear this from some codemonkey (a term I will commonly use for programmers who come out of technical colleges (say Red River College as an example here in Manitoba) with no formal background in computing who only care about programming and not understanding what they really are doing nor the science behind such).  Now when I elaborate this further, I need to emphasize the importance of mathematics in programming, since programming is merely an application of mathematics.

To understand this, we must understand what a program is, and what programming is.  Programs are often sequences of bits we call "machine code" (if we assume the machine is a binary-base system).  The way we set up the rules of a system is by defining a formal system under some architecture.  The architecture can in most fundamental or advanced systems (such as in parallel computing) make a huge difference in how programs are interpreted.  We write programs in programming languages which in themselves are axiomatic systems defined at times by primitives, classes, objects, and other mathematical constructions.  We use these programming languages to make programs which a compiler (these days) will translate into machine code for that particular type of machine.  One can notice there was a lot of detail there if you were to consider what a compiler does, or say how machine code is used.  A code monkey will often jump over these details and insist that they can just proceed since the compiler will do such for them.  Believe it or not, there is a lot of abstraction in the court to even allow programmers to have such nice systems at their disposal.  Consider fields where compilers unlike GCC (for C programming) don't exist, and the responsibility is on the programmer to understand the architecture.  Even understanding a basic notion of combinatorics and algorithms will help guide somebody to better understand the architecture, or the logical chain of steps at times needed to understand possible engineering tasks the hardware may be considering.  In parallel computing, such is the case, and much of the hottest GPU, or CPU cluster optimization for video, or scientific crunching must be done on such (which makes it quite difficult if you lack the notion of even a digital circuit which comes from logic).

I haven't even hit on any core aspect of programming (as a formal system and a tool) yet, and as you may tell if you are a programmer who takes the naive stance "I don't need mathematics", you may find yourself running out of ideas by the end of this.  Now, let's consider the notion of an algorithm.  If you are an individual I may be addressing, you may say "algorithm" (what?) or if you do know what one is, what it has to do with mathematics.  Algorithms are formal mathematical descriptions that are step-by-step.  Algorithms have input, output, and some purpose.  An algorithm can be thought of a procedure.  To analyze even the most basic sequential algorithm, it requires a basic understanding of combinatorics or calculus.  For instance, if you would like to consider worst case analysis, this is almost necessary if you want to write great programs that don't appeal to inefficient results.  You cannot rely on just the computer to tell you following an execution if it works or not.  Often times if you aren't even sure if the program will run, the algorithm you may be implementing should be checked for correctness.  Proofs are very powerful tools that go unappreciated due mostly to a lack of understanding of how computing works.  Even a basic university CS graduate will grasp proofs are important, but they may not see the relevance, so I hope you will not be these individuals either.  Mathematics is at the heart of computing, and computing is at the heart of mathematics.  In foundations, programs were once seen as automated proofs where if the 'program' were to reach the end, it would be proven.  This is highly related to much of the work that brought on great works like Turing, with the decision problem.  When we consider problems we often affiliate with daily life, these problems likely will appeal to some irregular problem say graph theoretic problems, or even scheduling are some examples.  Just naively implementing a solution using basic algorithms may work in some circumstances, but when instances grow huge, this may not be possible.  So understanding algorithms, and being literate of discrete mathematics are essential.

Another excuse I often find is "there's a library call for that, I don't need to really understand it, or know what it even is to solve the problem".  Though in a naive sense, you could attempt to use such, but really imagine if you didn't have these libraries.  A lot of the time, the hottest topics in problems today will have people producing very recent programs, that will not be found in some library call unless they beat you to the punch. If you don't understand what you are using even, or a basic sense of what is going on, or the strengths or efficiency of that algorithm you may use, why use it?  I believe heavily the boost in speeds of CPUs have caused programmers to become lazy.  I remember the days when people could program entire games in the space some would consider for just loading a lazily drawn sprite in a game.  Efficiency is no less important due to this.  Such things come rather important when we consider popular hardware like GPU, and CPU multi-cores.

I seriously could go on for pages upon pages giving countless examples.  You cannot understand computing without a serious look at Computer Science, and what is this?  A formal science and a metaphorical birth child of mathematics.  Even if you teach yourself, there is a lot one cannot do unless they educate themselves more mathematics.  Even solving problems mathematically can broaden ones ability to abstract and seek better answers, or use logical deduction or induction to consider solutions.  We have too many code monkeys that colleges or simpler paths of some university programs produce, we need more computer scientists, and scientific thinkers in this domain.

The last point I need to make is about making games.  As somebody who has taught himself a ton of mathematics through learning how to make computer games from a very young age, I will tell you that to make your own game is not piggy backing on some library.  You should understand every part of your code if you want to utilize the hardware, and provide an excellent experience for your players.  Basics, you cannot escape matrix operations in graphics if you want to even get near graphics, and you need a basic understanding of logic to even approach providing decision making for complicated games.

Now I say these things not to bash, but to enlighten.  I have only selected a very few set of examples here, I could get into almost every department where the IT or software development industry is littered with mathematically ignorant workers who will keep making software no better than a high school student.  I have literally seen solutions to problems I personally conduct scientific research in where somebody blindly created program which are only feasible for some instances and would crash the entire program in a rare chance (since they didn't even consider the mathematics of the problem, nor the concept of a decidability).  This is not entirely on the programmers though, I would admit the whole software industry is not the same as it used to be where now great thinkers are not admired.  In my personal opinion, only people who can spit out code with a very limited scope of knowledge to how to solve more advanced problems are valued more in industry (with exceptions of major companies since they compete with academia) since the higher up individuals want to keep their jobs by preying on ignorance.

In short:  Whenever Mathematics or even a problem comes your way, take it!

Everybody have a beautiful day!


D R Page


No comments:

Post a Comment