LPC Assignment
LPC Assignment
Name: M Sarfaraz
Roll No: Bcsm-f18-408
Section: 6A
Topic:
Analyze any five programming
Languages
Abstract
There are many programming languages in the world today .Each language has
their advantage and disadvantage. In this assignment, I will discuss five
programming languages: C++, Python Java, JavaScript, and PHP. At the end, I will
give my conclusion that which languages are suitable and which are not for using
in some cases. I will also provide evidence and our analysis on why some language
are better than other or have advantages over the other on some criterion.
1 Java
Introduction to Java
Java is a general-purpose and object-oriented programming language. Java
Programming Language is a platform-independent language, which means there is
no limitation to any particular hardware or operating system. It provides users the
facility to ‘write once, run anywhere’. Many operating systems such as Sun Solaris,
Windows, etc., support Java.
History of Java
Java first appeared in the year 1995 as Oak. They also decided to call this language
the project Green, before it could find its popularity as Java by finding its roots in
coffee, which in turn is attributed to Java- an island in Indonesia.
1. Simple
Java is a simplified version of the C++ language, and therefore, it is familiar also.
Moreover, it eliminates all redundant and unreliable code. There is no support of
pointers, preprocessor header files, operator overloading, and multiple inheritances
in Java. This makes Java easier as compared to C++.
2. Object-oriented
Java is an object-oriented language and mainly focuses on objects rather than
processes. Java follows the Object-Oriented Programming (OOP) concept like:
Objects
Classes
Inheritance
Encapsulation / Data hiding
Abstraction
Polymorphism
3. Platform-independent
Java is a platform-independent language as the source code of Java can run on
multiple operating systems. Java programs can run on any machine or the operating
system that does not need any special software installed. Although the JVM needs to
be present in the machine.
4. Portable
Java is portable because Java code is executable on all the major platforms. Once we
compile Java source code to bytecode, we can use it in any Java-supported platform
without modification, unlike other languages that require compiling the code for
each platform. Java is portable because we can carry bytecode over to any other
platform it runs on.
5. Secure
Java is a secure language because of the following reasons:
Java does not support pointers that make Java robust and secure.
All Java programs run inside a virtual machine sandbox.
The Bytecode Verifier of Java inspects the parts of code for checking the illegal
code that can bypass access.
Applications of Java
Java is a widely-used language, and there are many uses of Java. The following are
some of the application areas that use Java:
GUI stands for Graphic User Interface, and Java enables GUI
development through resources like Abstract Windowing Toolkit
(AWT), JavaFX, and Swing. AWT features several pre-made
components such as button, list, menu, and several third-party
components.
desktop application
Java and the gaming industry are a match made in heaven. Java
supports the jMonkey engine, one of the most potent 3D engines
available today.
Advantages of Java
It is a platform-independent language because we can run Java code on any
machine without any special software.
It is an object-oriented language because of its classes and objects. Object-
oriented programming increases the ease of code development and increases
efficiency.
It is a secure language, and the reason behind being secure is pointers, Java
does not use pointers.
It supports multithreading; we can execute many programs simultaneously.
Java is a robust language as it has many features like automatic garbage
collection, no use of explicit pointers, exception handling, etc.
Java is a high-level programming language that makes it easy to learn and
understand.
It provides efficient memory management.
Disadvantages of Java
Java is a high-level language. Therefore Java must deal with the compilation
and abstraction levels of a virtual machine.
Java exhibits poor performance because of the garbage collector, wrong
caching configuration, and deadlocks, among processes.
Java has very few GUI(Graphical User Interface) builders like Swing, SWT, JSF,
and JavaFX.
We could end up writing long, complicated code if we try to carry out a simple
set of activities. This affects the readability of code.
2.C++
Introduction to C++
C++ is a general-purpose programming language that was developed as an
enhancement of the C language to include object-oriented paradigm. It is an
imperative and a compiled language.
C++ is a middle-level language rendering it the advantage of programming low-
level (drivers, kernels) and even higher-level applications (games, GUI, desktop
apps etc.). The basic syntax and code structure of both C and C++ are the same.
History of C++
Before the initial standardization in 1998, C++ was developed by Danish computer
scientist Bjarne Stroustrup at Bell Labs since 1979 as an extension of the C
language; he wanted an efficient and flexible language similar to C that also
provided high-level features for program organization.
Features of C++
you can dynamically allocate memory during runtime using new and delete
operator in C++ to have better memory management.
Object oriented
Portable
Most of C++ compilers supports ANSI standards that makes C++ portable
because the code you write on one operating system can be run on other
Operating system without making any change. We cannot say C++ a fully
platform independent language as certain things in C++ are not portable,
such as drawing graphics on a screen, since standard C++ has no graphics or
GUI API.
Exception handling:
Simple
Last but not least, just like C, it is easier to write a program in C++. Once
you get familiar with the syntax of C++ programming language, it becomes
a lot easier to code in C++.
Applications of C++:
C++ finds varied usage in applications such as:
Operating Systems
Be it Microsoft Windows or Mac OSX or Linux - all of them are programmed
in C++. C/C++ is the backbone of all the well-known operating systems
owing to the fact that it is a strongly typed and a fast programming
language which makes it an ideal choice for developing an operating
system.
Browsers
The rendering engines of various web browsers are programmed in C++
simply because if the speed that it offers.
Libraries
Many high-level libraries use C++ as the core programming language. For
instance, several Machine Learning libraries use C++ in the backend
because of its speed.
Graphics
All graphics applications require fast rendering and just like the case of web
browsers, here also C++ helps in reducing the latency.
Banking Applications
Banking applications process millions of transactions on a daily basis and
require high concurrency and low latency support. C++ automatically
becomes the preferred choice.
Cloud/Distributed Systems
Large organizations that develop cloud storage systems and other
distributed systems also use C++ because it connects very well with the
hardware and is compatible with a lot of machines. Cloud storage systems
use scalable file-systems that work close to the hardware.
Advantages of C++:
C++ is an object-oriented programming language.
C++ could also be a problem-oriented language that’s much easier to use
than the other low-level languages like binary coding.
C++ program has many advantages when it involves programming, All C++
program stand-alone files must use the foremost function to allow the
program to start out up and motivate its functions.
The global data and global functions are used within C++ that aren’t
utilized in many other high-level languages within the pc sciences and it is an
advantage to the programming languages.
.
Disadvantages of C++:
C++ program is complex during a very large high-level program, C++ is
employed for platform-specific application commonly, For the actual OS or
platform, the library set is typically chosen.
C++ programs are often heavy if it’s not careful, C++ program allows
classes and thus the functions with an equivalent name and overloaded
functions thus the symbol mangling system must be used, It can easily be
wrapped in C functions though.
C++ program has no notion of being fast and it’s not used for platform-
dependent apps any longer than C or anything is. Actually, given the
character of the toolchain, it’s probably less dependent than others. Complex
in a very large high-level program.
It is used for platform-specific applications commonly.
For a specific OS or platform, the library set is typically chosen that locks.
3 JavaScript
Introduction to JavaScript
JavaScript is a scripting language that is one of the three core languages used to
develop websites. Whereas HTML and CSS give a website structure and style,
JavaScript lets you add functionality and behaviors to your website, allowing your
website’s visitors to interact with content in many imaginative ways.
History of JavaScript
JavaScript was first introduced and deployed in the Netscape browser version
2.0B3 in December of 1995. When JavaScript was added to Internet Explorer, it
had to be officially called "JScript", because Netscape owns the name "JavaScript".
The choice of name proved to be a source of much confusion. As of 2006, the
latest version of the language is JavaScript 1.7
Features of JavaScript
Light Weight Scripting Language
JavaScript is a lightweight scripting language because it is made for data
handling at the browser only.
Dynamic Typing
JavaScript supports dynamic typing which means types of the variable are
defined based on the stored value. For example, if you declare a
variable x then you can store either a string or a Number type value or an
array or an object.
Platform Independent
This implies that JavaScript is platform-independent or we can say it is
portable; which simply means that you can simply write the script once and
run it anywhere and anytime. In general, you can write your JavaScript
applications and run them on any platform or any browser without
affecting the output of the Script.
Prototype-based Language
JavaScript is a prototype-based scripting Language. This means javascript
uses prototypes instead of classes or inheritance. In languages like Java, we
create a class and then we create objects for those classes. But in
JavaScript, we define object prototype and then more objects can be
created using this object prototype.
6 Client-side Validations
This is a feature which is available in JavaScript since forever and is still
widely used because every website has a form in which users enter values,
and to make sure that users enter the correct value, we must put proper
validations in place, both on the client-side and on the server-side.
JavaScript is used for implementing client-side validations.
Applications of JavaScript
JavaScript is mainly used in the following:
Websites
JavaScript lets you add behavior to the web page where the page responds
to actions without loading a new page to request processing.
Web Applications
As browsers and personal computers have continued to improve, JavaScript
gained the ability to create robust web applications. Consider applications
like Google Maps.
Server Applications
With the advent of Node.js a few years ago, JavaScript made its way from
the browser into the server.
Games
While the browser hasn’t been the traditional games platform in the past,
recently it has become robust for games.
Mobile Apps
One of the most powerful things you can do with JavaScript is to build an
application for non-web contexts.
That’s the other way of saying that you can make apps for things that are
aren’t on the internet.
Advantages of JavaScript
Speed. Client-side JavaScript is very fast because it can be run immediately
within the client-side browser. Unless outside resources are required,
JavaScript is unhindered by network calls to a backend server.
Simplicity. JavaScript is relatively simple to learn and implement.
Popularity. JavaScript is used everywhere on the web.
Interoperability. JavaScript plays nicely with other languages and can be
used in a huge variety of applications.
Server Load. Being client-side reduces the demand on the website server.
Gives the ability to create rich interfaces.
Disadvantages of JavaScript
Client-Side Security. Because the code executes on the users’ computer, in
some cases it can be exploited for malicious purposes. This is one reason
some people choose to disable JavaScript.
Browser Support. JavaScript is sometimes interpreted differently by
different browsers. This makes it somewhat difficult to write cross-browser
code.
4 Python
Introduction to Python
Python is an interpreted, high-level and general-purpose programming language.
Python is dynamically-typed and garbage-collected. It supports multiple
programming paradigms, including structured (particularly, procedural), object-
oriented and functional programming. Python is often described as a "batteries
included" language due to its comprehensive standard library.
History of Python
Python was created in the late 1980s, and first released in 1991, by Guido van
Rossum as a successor to the ABC programming language. Python 2.0, released in
2000, introduced new features, such as list comprehensions, and a garbage
collection system with reference counting, and was discontinued with version 2.7 in
2020.
Easy to Learn:
Cross platform:
Python is available and can run on various operating systems such as Mac,
Windows, Linux, Unix etc. This makes it a cross platform and portable
language.
Open Source:
Applications of Python
Web Development
That’s because Python offers numerous options for web development.
Game Development
As we mentioned earlier, Python comes loaded with many useful
extensions (libraries) that come in handy for the development of interactive
games.
Python Advantages
Less Coding
Almost all of the tasks done in Python requires less coding when the same task
is done in other languages.
Affordable
Python is free therefore individuals, small companies or big organizations can
leverage the free available resources to build applications.
Disadvantages of Python
Speed Limitations
We have seen that Python code is executed line by line. But since Python is
interpreted, it often results in slow execution.
Weak in Mobile Computing and Browsers
Besides that, it is rarely ever used to implement smartphone-based
applications. One such application is called .
The reason it is not so famous despite the existence of is that it isn’t that
secure.
Design Restrictions
As you know, Python is dynamically-typed. This means that you don’t need to
declare the type of variable while writing the code. It uses duck-typing. But
wait, what’s that? Well, it just means that if it looks like a duck, it must be a
duck.
Underdeveloped Database Access Layers
Compared to more widely used technologies like JDBC (Java Database
Connectivity) and ODBC (Open Database Connectivity), Python’s database
access layers are a bit underdeveloped. Consequently, it is less often applied
in huge enterprises.
5 PHP
Introduction to PHP
PHP is a general-purpose scripting language especially suited to web
development. PHP code is usually processed on a web server by a
PHP interpreter implemented as a module, a daemon or as a Common Gateway
Interface (CGI) executable. On a web server, the result of the interpreted and
executed PHP code – which may be any type of data, such as generated HTML or
binary image data – would form the whole or part of an HTTP response.
Various web template systems, web content management systems, and web
frameworks exist which can be employed to orchestrate or facilitate the
generation of that response. Additionally, PHP can be used for many
programming tasks outside of the web context, such as standalone graphical
History of Java
PHP was conceived sometime in the fall of 1994 by Ramus Leadoff. Early non-
released versions were used on his home page to keep track of who was looking
at his online resume. The first version used by others was available sometime in
early 1995 and was known as the Personal Home Page Tools
Features of PHP
It is most popular and frequently used world wide scripting language, the main
reason of popularity is; It is open source and very simple.
Simple
Faster
Open Source
Open source means you no need to pay for use php, you can free
download and use.
Platform Independent
PHP code will be run on every platform, Linux, Unix, Mac OS X, Windows.
Case Sensitive
PHP is case sensitive scripting language at time of variable declaration. In
PHP, all keywords (e.g. if, else, while, echo, etc.), classes, functions, and
user-defined functions are NOT case-sensitive.
Error Reporting
Applications
Any web page or web application developed in the current ecosystem needs
to offer a high degree of customization, provide highly interactive user
interface, be capable of performing online transactions and integrate with
database systems.
PHP has been used for creating popular web Content Management Systems
(CMS), including WordPress and its plugins, user-facing portion of Facebook,
Joomla, Drupal, Moodle, , Digg and others.
3. Ecommerce Applications:
4. GUI-Based Applications:
Apart from managing text content, PHP can also be used to manipulate
images. Integration of various image processing libraries, such as GD library,
Imagine and ImageMagick.
Advantages of PHP :
Most important advantage of PHP is that it’s open source and freed from
cost.
It is platform independent. PHP based applications can run on any OS like
UNIX, Linux and windows, etc.
It has less learning curve, because it is straightforward and straightforward
to use. If a private knows C programming can easily work on PHP.
It is more stable from a few years with assistance of providing continuous
support to various versions.
It helps in reusing an equivalent code and no got to write lengthy code
and sophisticated structure for event of web applications.
It helps in managing code easily.
It has powerful library support to use various function modules for data
representation.
PHP’s built-in database connection modules help in connecting database
easily reduce trouble and time for development of web applications and
content based sites.
Disadvantages of PHP :
It is not that secure due to its open-source, because the ASCII text file are
often easily available.
It is not suitable for giant content-based web applications.
It has a weak type, which can cause incorrect data and knowledge to user.
PHP frameworks got to learn to use PHP built-in functionalities to avoid
writing additional code.
Using more features of PHP framework and tools cause poor performance
of online applications.
It is widely believed by the developers that PHP features a poor quality of
handling errors. PHP lacks debugging tools, which are needed to look for
errors and warnings. PHP has less number of debugging tools in
comparison to other programming languages.
Conclusion