samjh
April 12th, 2007, 02:35 AM
Quite a lot of people ask about which programming languages should be used, what GUI toolkits, etc.
There have been many occasions where such discussions turn into flamewars.
Before asking such questions, please ensure you use the SEARCH function to look for related topics. You can also consult the excellent thread: How to start programming - guides and links for many languages (http://ubuntuforums.org/showthread.php?t=333867).
Understand that programming languages are like construction materials. Specific materials are used for specific buildings. You do not use wooden frames for a 100-storey sky scraper. You also do not use reinforced concrete for a garden shed. You CAN use those materials, but they are not the best choices.
Programming languages are divided into several "levels". Each level indicates how closely the language interacts with the computer hardware. The closer to the hardware a language is, the more difficult it is to use for a programmer. Languages that try to detach a programmer from the hardware are higher-level, and are easier to use.
Low-level languages allow the programmer to have specific control over the hardware. There is more micro-management needed for the programmer, and the programmer needs greater understanding of hardware operations than when using higher-level languages. Therefore, low-level languages are good for developing operating systems, device drivers, and other software that need direct access to hardware facilities. This type of programming is known as "Systems Programming".
Higher-level languages tend to take care of hardware-specific operations by themselves, and allow the programmer to concentrate on other matters. These languages are usually easier to use than low-level languages, and are most often used for computer application software, like word processors, web browsers, etc. This type of programming is known as "Application Programming".
There also exist languages that are very far detached from hardware, or even a particular operation system. These kinds of languages sometimes focus on interacting with the Internet, or otherwise act as "scripts" for performing tasks similar to application programs. These are collectively known as scripting languages. The most common uses of these languages are "Shell Scripting", "Macros", and "Web Programming".
You may ask about speed of these languages. Remember that most programs don't need to run fast. But as a general rule of thumb, low-level languages are faster than high-level languages. Keep in mind that many high-level languages allow low-level programming languages to be integrated into its programs, to compensate for their lack of speed.
Some languages are multi-purpose, and may serve in Systems Programming as well as Application Programming, or Application Programming and Web Programming.
(There are other, more specialised categories. These include Artificial Intelligence, Database Management, etc. These will not be discussed here.)
The key is to identify what you want to program, and which tool is best for you.
Here are some languages for each of the above categories. It is not an exhaustive list, but only lists historically and industrially important languages, and languages that can be used on Linux/Unix. Some languages appear in more than one category. I have only listed languages in the most often used categories, even if some languages are capable of other rare uses.
Systems Programming:
Ada, Assembly, C, C++, Machine Language, Objective-C, Object-Pascal, Pascal, PL/1
Application Programming:
Ada, BASIC, C, COBOL, Common Lisp, C#, C++, Fortran, Java, Lisp, Lua, Objective-C, Object-Pascal, Pascal, Python, SmallTalk, Visual Basic .NET
Web Programming:
ASP (and ASP.NET), ECMA Script (eg. JavaScript), Flash ActionScript, Java (and JSP), JScript, Perl, PHP, Python, Ruby
Shell or Application Scripting:
Bourne Shell, C Shell, Common Lisp, Lua, Python
Aside from the hierarchy of "levels", languages are also divided along their features. While searching for an appropriate programming language for your task, you will come across several features that are commonly used to describe languages. A brief outline of the most common buzzwords are listed here.
Dynamic-typing:
Allows the use of data without the need for a programmer to specify what type of data it is (eg. integers, floating point numbers, characters, etc.). Usually a feature of very high-level languages like Python and Ruby. It makes the languages easy to use, but requires careful testing because errors can occur when incompatible data are operated together (such as adding an integer to a character).
Static-typing:
Requires that the programmer specify what type of data is used. For example, a variable x may be an integer, so the programming needs to declare that. Usually reduces productivity slightly, but with the benefit of producing self-explanatory code. Still requires careful testing because errors may be produced when incompatible types are operated together.
Type enforcement:
The programming language checks for compliance to a declared type. For example, a compiler or interpreter will realise that if x is an integer, then assigning a letter as its value is illegal, and will warn the programmer. Some language have "strong" type enforcement, which catches many such mistakes (eg. Java). Other languages have "weak" type enforcement, and may allow such mistakes to slip by (eg. C) until the program is run.
Garbage collection:
Most low-level programming languages, and some high-level ones, require the programmer to specify when to set aside and taken back memory reserved for particular pieces of data. This is called manual or explicit memory management, and is normally required when using complex or large data. Many high-level languages now use automatic memory management, also known as "garbage collection", which uses an automated process to keep track of memory used by a program's data and frees memory that is no longer needed automatically, without having the programmer specify when and how to do it. Up until several years ago, garbage collection was process-intensive - ie. it caused slower program execution than manual memory management. But technology has caught up so that some of the better implementations of garbage collection have very little speed penalties. Still, in general, garbage collectors do impose some speed penalty. Most automatic memory management is found in interpreted programming languages, or languages which operate in a "run-time environment" (ie. software that acts like a computer within a computer, for running programs written using a particular programming language).
Obviously, manual memory management makes for more difficult programming, with usual benefit of increased performance. Garbage collection makes for easier programming, but usually with slight loss in performance.
Object-oriented programming:
A language feature which allows data, functions, and procedures, to be incorporated into self-contained modules. These modules are called "objects". All objects belong to "classes", which dictate what data, functions and procedures the object contains. For example, a "Draw" object may include data about colours and texture, and functions and procedures for drawing shapes or changing colours. Object-oriented programming makes designing some kinds of programs easier than using other models.
Structured programming:
A programming philosophy which emphasises systematic design and implementation of code using a modular approach to design, and the usage of set processes. Structured programming languages all support the use of "sequence", "selection", and "repetition" to control how the program behaves. Structured programming also encourages designing programs according to top-down or bottom-up approaches. Top-down means designing the program first as a whole entity, and then breaking up the entity into small modules for more detailed design. Bottom-up means designing small modules first, that will eventually join together to form the total program.
For more information, Wikipedia provides an excellent resource for finding out about various programming languages and their features:
http://en.wikipedia.org/wiki/Category:Programming_language_topics
Wikibooks also has various tutorials for many programming languages:
http://en.wikibooks.org/wiki/Wikibooks:Programming_languages_bookshelf
Before you start any thread about "which language should I choose", be sure to clearly state WHY you want to start programming, and what kinds of programs you are interested in creating.
If you want to write device drivers or work on the Linux kernel, then choose a Systems Programming languages (C is the language used for the Linux kernel and its drivers). If you want to write web applications, then choose a Web Programming languages. If you want to write nifty applications to do cool things on your desktop, choose an Application Programming language or Application Scripting language. The choices go on...
There have been many occasions where such discussions turn into flamewars.
Before asking such questions, please ensure you use the SEARCH function to look for related topics. You can also consult the excellent thread: How to start programming - guides and links for many languages (http://ubuntuforums.org/showthread.php?t=333867).
Understand that programming languages are like construction materials. Specific materials are used for specific buildings. You do not use wooden frames for a 100-storey sky scraper. You also do not use reinforced concrete for a garden shed. You CAN use those materials, but they are not the best choices.
Programming languages are divided into several "levels". Each level indicates how closely the language interacts with the computer hardware. The closer to the hardware a language is, the more difficult it is to use for a programmer. Languages that try to detach a programmer from the hardware are higher-level, and are easier to use.
Low-level languages allow the programmer to have specific control over the hardware. There is more micro-management needed for the programmer, and the programmer needs greater understanding of hardware operations than when using higher-level languages. Therefore, low-level languages are good for developing operating systems, device drivers, and other software that need direct access to hardware facilities. This type of programming is known as "Systems Programming".
Higher-level languages tend to take care of hardware-specific operations by themselves, and allow the programmer to concentrate on other matters. These languages are usually easier to use than low-level languages, and are most often used for computer application software, like word processors, web browsers, etc. This type of programming is known as "Application Programming".
There also exist languages that are very far detached from hardware, or even a particular operation system. These kinds of languages sometimes focus on interacting with the Internet, or otherwise act as "scripts" for performing tasks similar to application programs. These are collectively known as scripting languages. The most common uses of these languages are "Shell Scripting", "Macros", and "Web Programming".
You may ask about speed of these languages. Remember that most programs don't need to run fast. But as a general rule of thumb, low-level languages are faster than high-level languages. Keep in mind that many high-level languages allow low-level programming languages to be integrated into its programs, to compensate for their lack of speed.
Some languages are multi-purpose, and may serve in Systems Programming as well as Application Programming, or Application Programming and Web Programming.
(There are other, more specialised categories. These include Artificial Intelligence, Database Management, etc. These will not be discussed here.)
The key is to identify what you want to program, and which tool is best for you.
Here are some languages for each of the above categories. It is not an exhaustive list, but only lists historically and industrially important languages, and languages that can be used on Linux/Unix. Some languages appear in more than one category. I have only listed languages in the most often used categories, even if some languages are capable of other rare uses.
Systems Programming:
Ada, Assembly, C, C++, Machine Language, Objective-C, Object-Pascal, Pascal, PL/1
Application Programming:
Ada, BASIC, C, COBOL, Common Lisp, C#, C++, Fortran, Java, Lisp, Lua, Objective-C, Object-Pascal, Pascal, Python, SmallTalk, Visual Basic .NET
Web Programming:
ASP (and ASP.NET), ECMA Script (eg. JavaScript), Flash ActionScript, Java (and JSP), JScript, Perl, PHP, Python, Ruby
Shell or Application Scripting:
Bourne Shell, C Shell, Common Lisp, Lua, Python
Aside from the hierarchy of "levels", languages are also divided along their features. While searching for an appropriate programming language for your task, you will come across several features that are commonly used to describe languages. A brief outline of the most common buzzwords are listed here.
Dynamic-typing:
Allows the use of data without the need for a programmer to specify what type of data it is (eg. integers, floating point numbers, characters, etc.). Usually a feature of very high-level languages like Python and Ruby. It makes the languages easy to use, but requires careful testing because errors can occur when incompatible data are operated together (such as adding an integer to a character).
Static-typing:
Requires that the programmer specify what type of data is used. For example, a variable x may be an integer, so the programming needs to declare that. Usually reduces productivity slightly, but with the benefit of producing self-explanatory code. Still requires careful testing because errors may be produced when incompatible types are operated together.
Type enforcement:
The programming language checks for compliance to a declared type. For example, a compiler or interpreter will realise that if x is an integer, then assigning a letter as its value is illegal, and will warn the programmer. Some language have "strong" type enforcement, which catches many such mistakes (eg. Java). Other languages have "weak" type enforcement, and may allow such mistakes to slip by (eg. C) until the program is run.
Garbage collection:
Most low-level programming languages, and some high-level ones, require the programmer to specify when to set aside and taken back memory reserved for particular pieces of data. This is called manual or explicit memory management, and is normally required when using complex or large data. Many high-level languages now use automatic memory management, also known as "garbage collection", which uses an automated process to keep track of memory used by a program's data and frees memory that is no longer needed automatically, without having the programmer specify when and how to do it. Up until several years ago, garbage collection was process-intensive - ie. it caused slower program execution than manual memory management. But technology has caught up so that some of the better implementations of garbage collection have very little speed penalties. Still, in general, garbage collectors do impose some speed penalty. Most automatic memory management is found in interpreted programming languages, or languages which operate in a "run-time environment" (ie. software that acts like a computer within a computer, for running programs written using a particular programming language).
Obviously, manual memory management makes for more difficult programming, with usual benefit of increased performance. Garbage collection makes for easier programming, but usually with slight loss in performance.
Object-oriented programming:
A language feature which allows data, functions, and procedures, to be incorporated into self-contained modules. These modules are called "objects". All objects belong to "classes", which dictate what data, functions and procedures the object contains. For example, a "Draw" object may include data about colours and texture, and functions and procedures for drawing shapes or changing colours. Object-oriented programming makes designing some kinds of programs easier than using other models.
Structured programming:
A programming philosophy which emphasises systematic design and implementation of code using a modular approach to design, and the usage of set processes. Structured programming languages all support the use of "sequence", "selection", and "repetition" to control how the program behaves. Structured programming also encourages designing programs according to top-down or bottom-up approaches. Top-down means designing the program first as a whole entity, and then breaking up the entity into small modules for more detailed design. Bottom-up means designing small modules first, that will eventually join together to form the total program.
For more information, Wikipedia provides an excellent resource for finding out about various programming languages and their features:
http://en.wikipedia.org/wiki/Category:Programming_language_topics
Wikibooks also has various tutorials for many programming languages:
http://en.wikibooks.org/wiki/Wikibooks:Programming_languages_bookshelf
Before you start any thread about "which language should I choose", be sure to clearly state WHY you want to start programming, and what kinds of programs you are interested in creating.
If you want to write device drivers or work on the Linux kernel, then choose a Systems Programming languages (C is the language used for the Linux kernel and its drivers). If you want to write web applications, then choose a Web Programming languages. If you want to write nifty applications to do cool things on your desktop, choose an Application Programming language or Application Scripting language. The choices go on...