Introduction to Some Programming Languages
There are of course many languages available for programming. The main question is: what language is best? This is of course open to debate. I will not claim to know all of the programming languages available, let alone how to code in them, but I will share my experience with the ones I commonly use.
Perl |
- This is known as an "interpreted" language. What this means is that the code itself is in "plain" text and is compiled and interpreted by the PERL interpreter. Most often this language is used for command line scripts, though this is not the only thing it can be used for.
- One of the major strengths of PERL is that the language is "Portable". In other words, there are PERL interpreters available for many platforms. Known to me are:
- SCO Unix
- Linux
- Sun Solaris
- Windows (with ActiveState Perl)
- Mac OSX
- PERL uses a system of "Modules" (in an pseudo OOP environment) that can store things like object definitions, functions, and even entire prebuilt API's. What this means is that there is a rich repository of prebuilt objects that can be used to aid in Rapid Application Development.
- PERL's native regular expression library PRCE is extremely flexible and makes working with strings extremely simple * A weakness of PERL is in the fact that it is an interpreted language. Your program cannot run without the existence of the PERL interpreter being installed.
- Another weakness is performance. PERL (without the use of external process control tools) can easily run out of control with poorly formed scripts and suck back all resources in a system very quickly. Because it is an interpreted language, you no longer get the direct compiled performance of a language like C as well.
- Intuitive graphical interfaces can't be done without the use of addon modules which quickly take away from the platform independence advantage of PERL.
- Web CGI scripts : ie: a quick email form could be handled quite easily by PERL
- Utility conversion scripts: ie: convert a file from one format to another
- The sky is the limit, if you bear in mind the limitations of performance and memory management - and with proper coding you could even bypass these limitations. For example, a well known ISP enterprise product known as Parallels™ Business Automation is written in object oriented PERL with embedded apache mod_perl processing.
C
You'll probably note that there are no links or images or anything for this language. This is because there are many version of C and C compilers available, although everyone would like to believe they can claim sole ownership of the language.
- C is a well established language that is called a "Compiled" language. What this means is that you write the code, and then compile it for the specific platform you wish it to run on.
- C is based on the concept of performance. Some of the most efficient programs available are written solely in C to maintain the speed edge.
- Because it is such an established language (read: old), there are compilers available for most platforms. This should not be confused with "cross platform". There are certain aspects of the C language that are cross platform, but when it comes to writing graphical applications, you can pretty much throw all of that out the window. Each platform has specific portions to the language that make it near to impossible to compile a program on another platform without some modifications (this process is known as "porting").
- There are as a result of the age of the language many prebuilt function libraries available (you may even find some on this web site). These tend to range from "exactly what I was looking for" to "completely cryptic and useless". The reason being is that C was never meant to be a "modular" style of language. You can link in to function libraries and hope that the code is going to work, but in the main it is intended to be a "procedural" or "step by step" method of coding.
C++
Broadly based off of C, C++ honours the same "function" methods as C, but introduces (one of the first) Object Oriented approaches to programming. The theory is that you can treat portions of programming as "Objects" and have them handle the actual functionality. What this means is once an object is built, it can be reused in other applications or as part of a framework. Much more efficient than copy and paste methodology.
- C++ Allows for a much broader range of classifying functions while maintaining (for the most part) the performance advantages of C.
- The fact that C++ is an object oriented language also adds overhead to the code itself. Here is a bad example:
C Code
#include <stdio.h> int main() { printf("Hello World\n"); return }
C++Code
#include <iostream> class HelloWord { public: HelloWorld() { cout << "Hello World" << endl; } }; int main() { HelloWorld h; return 0; }
As I mentioned - it is a bad example, but quickly highlights how both languages do the same thing, but C++ uses about 4 times the amount of code to accomplish it. Of course, C++, because it honours C style code, could easily be written the exact same way, but it is quite easy for beginning programmers to add bloat in C++ that might not exist in C. - Because of the many advances in ability from C to C++, it also adds a level of confusion and a much steeper learning curve to truly harness or make use of the feature of C++. Trust me - C++ is a commitment. Not to say that C isn't, but jumping from one to the other can take some time to wrap the mind around.
PHP |
Now.. for the darling of the web programming set. You may have heard of the term "LAMP" developer in certain circles. In the world of web programming, this is actually an acronym for "Linux Apache MySQL PHP".
So.. why is it such a popular language that it's merited an entry in it's own acronym? (By the way, PHP is in and of itself a self recursive acronym: PHP Hypertext Preprocessor.) The reason is that this language, which is very well supported in Apache incarnations, blends the power of OOP design such as is available in C++, along with the simplicity and 'scriptability' of PERL.
Like PERL, PHP is an interpreted language meaning that the source never needs to compile. This of course lends the same weakness as PERL, that the server itself has to compile the code at run time. This being said, PHP has a much lower footprint that PERL does in terms of memory and resources.
- # Again like PERL, there are many prebuilt modules that are available, making this a very extensible language
- There is strong database support available built into PHP - similar to the PERL DBI (DataBase Interface).
- Version 5 of PHP supports (nearly) full OOP design, including virtual class inheritance, public, protected, and private members and functions, and constructor/deconstructor mechanisms
- However.. PHP is a true beast to debug. Since it is primarily a web development language, the mechanisms available for reporting errors, and tracing application calls is truly onerous.
- Due to the plethora of developers that constantly add to the language, there is no consistency between versions, often leading to well known functions changing the number or order of parameters, a truly dangerous aspect.
Wrap Up
These are just a few of the many languages available. Other popular languages include Java, Visual Basic, C Sharp, Ruby on Rails, Python and many more. I will leave those languages to one well versed in them however as the Rabbit has not had time to learn every language available :)