Showing posts with label programming. Show all posts
Showing posts with label programming. Show all posts

Thursday, November 3, 2011

A Quick Comparison of Python, C++, and Java

There are a plethora of programming languages out there. I'm only going to focus on three: Python (because it was the language I learned to program in, and I love its simplicity and strength), C++ (because it was the second language I learned and it's a big player in the software development world), and Java (because it is another key player for software development, especially for mobile apps).


Before I begin comparing each language's syntax I'd like to explain a little bit of what makes them inherently different. To do this, I'll introduce a few of the programming paradigms that are available.
A programming paradigm is a model or pattern used for problem-solving. There are two main types:
  1. Functional Programming relies on the application of functions. Purely functional languages, like Lisp, Scheme, and Racket are very action-oriented. Python and C++ both support functional programming.
  2. Object-Oriented Programming (OOP) relies on the use of objects, which consist of data (variables) and methods (functions). Most languages support OOP, including Python and C++, but Java is composed entirely of classes and objects and it is very noun-oriented.
However, there are many other paradigms, including: imperative, procedural, and generic.


In addition to its paradigm, a language is also classified based on its compiler support. There are two main types for this as well:
  1. Compiled Languages translate source code into machine code before they can be run. Any language that must be compiled before it can be run falls into this category. C++ and Java are both compiled languages.
  2. Interpreted Languages, on the other hand, can be executed directly from the source code without being compiled. Python is an interpreted language.