You are on page 1of 13

Overview of Other Programming Languages

Chapter 11
FST10014 Programming
Python, Java, C++

• The most popular among coders in terms of


competitive coding and programming
Python vs Java vs C++

• C++ is preferred for its efficiency, speed, and memory


• Java is platform-independent, which continues to add
considerable value to the world of software
development
• Python requires less typing, provides new libraries,
fast prototyping, and several other new features
An overview of Python

• Created by Guido van Rossum in 1991


• Python is an interpreted high-level general-purpose
programming language
• It was deigned with a philosophy of making code easier
to read than alternative languages, with a use of
significant indentation
• It is commonly used for data analytics and machine
learning, but has a wide range of uses
Python Sample Code
An overview of C++

• Developed by Bjarne Stroustrup starting in 1979 at Bell


Labs in Murray Hill, New Jersey, as an enhancement to
the C language and originally named C with Classes but
later it was renamed C++ in 1983
• A superset of C, and that virtually any legal C program
is a legal C++ program
• Statically typed, compiled, general-purpose, case-
sensitive, free-form programming language that
supports procedural, object-oriented, and generic
programming
C++ Program Structure

• The C++ language defines several headers, which contain information that is
either necessary or useful to your program. For this program, the
header <iostream> is needed.
• The line using namespace std; tells the compiler to use the std namespace.
Namespaces are a relatively recent addition to C++.
• The next line '// main() is where program execution begins.' is a single-line
comment available in C++. Single-line comments begin with // and stop at the
end of the line.
• The line int main() is the main function where program execution begins.
• The next line cout << "Hello World"; causes the message "Hello World" to be
displayed on the screen.
• The next line return 0; terminates main( )function and causes it to return the
value 0 to the calling process.
C++ Sample Code
An overview of Java

• Java was originally created by Oracle in 1995, and is a


high-level, class-based, object-oriented programming
language
• One of the main focuses when designing Java was to
have as few implementation dependencies as possible
• It’s a general purpose language, used frequently for
desktop computing, mobile computing, games, and
numerical computing
Java Sample Code
PYTHON C++ JAVA
Interpreted Programming Language Compiled Programming language Compiled Programming Language
Supports Operator overloading Supports Operator overloading Does not support Operator Overloading
Provide both single and multiple Provide both single and multiple Provide partial multiple inheritance
inheritance inheritance using interfaces
Platform Independent Platform dependent Platform Independent
Supports multithreading Does Not support threads Has in build multithreading support
Has a huge set of libraries that make it Has limited number of library support Has library support for many concepts
fit for AI, datascience, etc. like UI
Smaller code length, 3-4 times less than Code length is a bit lesser, 1.5 times less Java has quite huge code.
java. that java.
Functions and variables can be declared Functions and variables are used Every bit of code is inside a class.
and used outside the class also. outside the class
Due to the use of interpreter execution C++ program is a fast compiling Java Program compiler a bit slower than
is slower. programming language. C++
Use of ; is not compulsory. Strictly uses syntax norms Strictly uses syntax norms
like ; and {}. like punctuations , ; .

You might also like