Saturday, September 18, 2010

Project 4 - Advantages and disadvantages of programming languages

This is about 4 major types of programming languages and their primary advantages and disadvantages. References will be posted after the section in which they have been used.

The first language type is Object-Oriented Programming. OOP languages are languages that revolve around the concept of an object in their code.

Adavantages include:
  1. OOP provides a clear modular structure for programs which makes it good for defining abstract data types where implementation details are hidden and the unit has a clearly defined interface.
  2. OOP makes it easy to maintain and modify existing code as new objects can be created with small differences to existing ones.
  3. OOP provides a good framework for code libraries where supplied software components can be easily adapted and modified by the programmer. This is particularly useful for developing graphical user interfaces.
Disadvantages include:
  1. The biggest drawback of OOP in terms of general simulation programming is probably that the real world refuses to divide up into neat classes and subclasses.
  2. The problem in IF programming is that sometimes several objects will interact in complex ways - maybe even ways we didn't necessarily anticipate when writing the program.
  3. Decreased system / software performance. With many OOPLs (such as Java) being interpreted, rather than compiled into native machine code, run-time speeds are impaired. Problems with dynamic memory allocation (the method used to create objects), means that either more memory is used-up on garbage, or that the system run-time speed is compromised by the need for garbage collection.
    http://www.bookrags.com/research/object-oriented-languages-csci-02/
    http://www2.tcl.tk/13398 http://www.tads.org/t3doc/doc/techman/t3oop.htm
    http://www.cs.bham.ac.uk/internal/courses/intro-se/unit-3-4-ood-conclusion.pdf

    The second language type is Procedural. Procedural languages revolve around keeping code as concise as possible, and focuses on a very specific end result.

    Advantages include:
    1. It is written in a step-by-step function, smaller programs written this way are very easy to follow.
    2. Easy to maintain, as each procedure/function can be debugged in isolation from the rest, allowing for easy isolation of problems, in contrast to OOP which can often take very long to find the problem code.
    3. Since it is written for a very specific purpose the code often gets you extremely efficient and high-performance applications.
    Disadvantages include:
    1. Procedural coding tends to get very difficult to maintain the larger the code gets. When the lines of code needed start ending up in the thousands it is very difficult for a team of people, or even one person to maintain.
    2. Unlike in OOP, portions of the code are so interdependent that the code in one application will not be useable in another, meaning despite being somewhat similar the code for one program will not able to be carried to a new one, which OOP can do.
    3. Procedural code is difficult to relate with real world objects.
    http://www.associatedcontent.com/article/84318/procedural_programming_pros_and_cons_pg2.html?cat=15
    http://www.wisegeek.com/what-is-procedural-programming.htm
    http://www.webdotdev.com/nvd/content/view/110/
    http://chipkidz.wordpress.com/2009/08/07/procedural-programming/

    The third language type is Functional. Functional programming is a programming paradigm that treats computation as the evaluation of mathematical functions and avoids state and mutable data.

    Advantages include:
    1. Easier to reason about subprograms. A subprogram's function is completely described by what goes in and what comes out. 
    2. Most functional languages provide a nice, protected environment.
    3. FP encourages quick prototyping.
    Disadvantages include:
    1. Generally more difficult to pick up for new coders.
    2. Functional idioms often do lots of inversion-of-control or laziness, which often has a negative impact on debugging
    3. It doesn't match the hardware as well as most imperative languages.
     http://www.c2.com/cgi/wiki?AdvantagesOfFunctionalProgramming
    http://stackoverflow.com/questions/1786969/pitfalls-disadvantages-of-functional-programming

    The fourth and last type of coding is Logical. Logical programming is the use of mathematical logic for computer programming.


    Advantages include:
    1. It is well suited for to expressing complex ideas because the drudgery of memory management, stack pointers, etc., is left to the computational engine.
    2. Allows for data to represent both an explicit fact and as a rule which implicitly describes the fact and representing many facts compactly.
    3. Logic programming languages are particularly suited for rapidly prototyping data structures and code to express complex ideas. Reduced drudgery and compact expression means the developer can concentrate on what should be represented and how.
    Disadvantages include:
    1. Methods of making large programs with logical programming are yet to be developed.
    2. It has proven to be highly inefficient.
    3. Only effective for a few relatively small areas of applications, certain kinda of database management systems and some areas of AI.
    http://www.biocheminfo.org/moirai/cs_magenta/prolog.html
    Book: Concepts of Programming Languages by Robert W. Sebesta, Seconds edition, copyright 1993


    So for the last part, taking the information from this site and with it predicting what the most popular programming language will come to be.


    So for starters, based on this first chart it would seem Objective-C has the highest growth rate, however it is well behind Java and C so even given current rates it would take some time for it to pass Java (about 4-5 years) and possibly a little longer for C since it currently is going up. Both Java and C have about an 8% lead on 3rd place so it will take some time for either of those two to be passed up (based on this table)


    In the next diagram shown (and this is a tad hard for me as I'm slightly colorblind and many of these colors are similar enough to throw me off) but it would seem most of the languages have somewhat leveled off for the time being, with only minor changes in the past year or so. though given the recent growth spurt of Objective-C it seems the only one likely to continue growing and becoming stronger.


    The third diagram, a table showing positions 21-50 doesn't give much detail, but it seems unlikely that any of these languages will take up more popularity in the coming years.


    The next diagram seems to simply support my earlier assertion that Objective-C is the only one going through growth spurts, the others seem to be growing only slowly, going in reverse or stagnant.


    The fifth chart shows something a little different, that in 2009 Go grew the most, though it would seem as of sep 2010 Go grew much less so it may be leveled off. 

    The last 3 diagrams show based on language type. Based off of the first one it would seem OO languages are up top and there to stay, procedural languages come next and are on the decline, though still with a huge lead over functional and logical languages, both small and growing only very slowly. The next diagram in this triplet compares Statically typed languages vs. Dynamically typed languages. The graph underneath shows them over time since 2002, until now, it would seem Statically typed languages started out much higher than Dynamically typed languages, but came down quite a bit (10% about) and Dynamically typed languages grew to match, though it would seem they have leveled off a bit in recent years and Statically typed languages are there to stay well in the lead by about 30%.


    Overall I would hazard a guess and say that Objective-C is likely to take over the top spot in coming years and that Java and C are going to stay near the top for some time to come.

    2 comments: