Monday, February 7, 2011

Common Programming Paradigms and the Language of the Future

Today there are many different Computer Programming Languages.  These languages are different, but use similar techniques called paradigms.  Deciding which language is best to use when writing your program is incredibly important.  To do this, find out what paradigms you would need to utilize to properly operate your program, and find a language that uses those paradigms.  Also using a commonly used language can be to your advantage.  Following, are four of the most common paradigms that programming languages use, and some advantages and disadvantages of each.

Object-Oriented Programming Languages are programming languages that use objects (independent entities which contain data and can respond to messages).  OOP is widely used, most commonly with the C++ and Java languages.  The advantages to using OOP include:  They are easier to learn, understand, manage, and maintain; objects can be derived from classes (a collection of objects of similar type) making similar objects easier to write; and OOP’s are easier to test and debug.  This is possible because if there is a problem with one or multiple objects, those objects can be independently re-written.  Otherwise a program would have to be re-written as a whole, taking much more time and effort.  OOP also does a good job of modeling the real world.  This is because ideas are organized like the real world with similar items (objects) grouped into categories (classes).

Although Object Oriented Languages are easier to manage and maintain, thus less expensive in the long run, there is a much higher upfront cost.  Thus it is used more for programs that are large and expected to be updated in the future.  OOP’s are best used for programming large applications.  For many small programs OOP gives no advantages over other languages and would require more time to write.  In addition OOP requires more memory to run, so if you are trying to write a small fast running program, OOP languages are the worst choice for your program.

Procedural Programming also known as imperative programming contains a series of steps for a computer to carry out.  Procedural Programming Languages utilize a small amount of memory, are simple in structure, and are easily implemented with compilers and interpreters.  The simplicity of Procedural Programming Languages makes it unusable when writing more complex programs.  It is considered to be less productive than other paradigms.  Procedural Programming carries out one process at a time, so when you are writing programs which require parallelization (two processes being completed at once) Procedural Programming languages are unable to carry this out.

Functional Programming Languages are computer languages that are treated by computers as mathematical functions.  It was derived from lambda calculus, by forming programs designed by the composition of functions.  Functional Programming avoids mutable data (objects that can be modified after it is created).  The earliest functional programming language was LISP, although it does contain non-functional elements.  LISP was pre-eminent in the development of Artificial Intelligence programs.  Advantages of Functional Programming are that programs can be easily understood, functions are reusable, and large programs containing thousands of functions are possible because the functions have no side effects.  Downsides to Functional Programming include efficiency (relating to it’s use of CPU and memory), difficulty doing input-output, and that some aspects of problem solving can’t be performed in a functional manner.

Logical Languages, including PROLOG (the most prominent Logical Programming Language), use predicates and rules of inference to determine an output.  Logical Languages are good at reasoning about programs, have well understand semantics, and can lead to concise solutions to problems.  Although Logical Programming can reason about programs they have trouble understanding and debugging large programs.  They also are slow in their execution and have a limited view of the world (only understands it’s predicates and rules of inference).

Of all the programming languages available today I think Objective C will be used frequently in the future.  It is used mainly for Mac’s OSX and iOS software.  There has been a surge in Objective C’s use in the past few years due to Apple’s iPhone and the high use of it’s apps.  This will only expand now that Verizon has the right to sell iPhones, ending AT&T’s exclusivity rights to the highly popular iPhone.  Python seems to be another language that is on the rise recently.  Many large corporations use Python including Google, Yahoo!, and YouTube.

Sources:

No comments:

Post a Comment