Monday, October 1, 2012

The Role Mathematics Play in Computer Programming


Computer programming is the art of telling a computer in a language we can understand what to do in a language that can be compiled - or translated - into language the computer understands.
Originally, programming was line-oriented. When you wanted to insert a function you had to renumber line numbers so you could insert extra functions in the space you had made available. Let's say you used Comal80 or Basic. Line numbers were often divided into tens, so you began with line 10, then 20 etc. If you had to insert 8 lines of code you would need to renumber so line 10 was followed by 110, then 210 etc. Finally, when the program worked fine, you could renumber everything back so the program would appear as though you had written everything in a normal flow.
Later, object oriented languages were introduced which abandoned line numbers, but still logic plays a big part in programming object oriented languages. You need to keep a good overview of which procedures you call, and you also need to consider the size of your program. When people have many active programs, the computer's internal memory - the so-called RAM or Random Access Memory - is instrumental in allowing all programs to run flawlessly alongside one another.
Mathematics is all about logic. As you improve a small function in your program, a bit of memory is freed, and consequently both planning and implementation is needed to ensure high quality programs.
Remember, that comments are only inserted by programmers so source code can be maintained and updated. Once the program is compiled into computer language these comments are removed from the active.exe file that the user clicks upon in his menu or on the desktop. But running an office suite that is well-optimized can mean the difference between printing taking forever or simply just running at top speed.
A mathematical perspective allows for effective use of all aspects in your program, and is a vital key in creating effective computer programs. This is especially also the case when you create programs that rely upon a database. If your data is constantly restructured and sorted alphabetically, you can run hash-table searches where a request searching for the last name Hansen, then the principle is you search between A and M, which is true, then you search between A and G which would be untrue, then between H and M which would be true, and then you search between H and J etc. In very few steps you can run through a myriad of customers instead of having to run through each customer starting with Anderson, Bryan, Charleston, Dexter etc. Database searches can be performed in a variety of ways, and therefore a good understanding of data types, speeds and methodology is essential to create searches that will be fast for the user of your program.

No comments:

Post a Comment