Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 22

Assignment 01

Logical paradigm of computing

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.

Java is a concurrent, class-based, and object-oriented language. It is freely accessible,


and we can run it on all the platforms or the operating systems. Java is simple and
easy to learn.

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.

 The first version 1.0 of Java came in 1996 .


 Java 2 (J2SE 1.2) was introduced in December 1998-1999. J2EE(Java Enterprise
Editions) was for enterprise applications.
 Java SE 14 came in March 2020, which is the latest version of Java.
Features of Java
Following are some of the Java features that make it so popular in the programming
world:

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:

 Java Mobile Applications

Let’s begin by pointing out that the Android OS is closely based on


Java and that Android phones consistently garner a market share of
over 85%.

 Java Desktop GUI Applications

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

Even though mobile computing dominates the market today, there is


still demand out there for desktop applications, and with these tools,
programmers can develop any desktop application.

 Java Enterprise Applications


Java Enterprise Edition (Java EE) is a popular platform that
offers API and runtime environments for scripting tasks, including
web services and network applications, to name a couple.

 Java Gaming Applications

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.

 Java Distributed Applications

Distributed applications are programs that run on multiple


computers linked to the same network. For example, Internet
Explorer is a distributed application.

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++

 Better memory management 

you can dynamically allocate memory during runtime using new and delete
operator in C++ to have better memory management.
 Object oriented 

C++ supports object oriented programming features, which means we can


use the popular OOPs concepts such as Abstraction, Inheritance,
Encapsulation and Inheritance in C++ programs, these features make
writing code in C++ a lot easier. We will cover them in detail in this tutorial
series.

  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.

  Structured programming language 

We have functions in C++, which makes easier to break a problem into


small blocks of code and structure the program in such a way so that it
improves readability and reusability.

 Exception handling:

Just like Java we can do exception handling in C++ which makes it easier to


identify and handle the exceptions.

  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.

JavaScript is primarily a client-side language, meaning it runs on your computer


within your browser. However, more recently the introduction of Node.js has
allowed JavaScript to also execute code on servers.

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.

 Object-Oriented Programming Support


Starting from ES6, the concept of class and OOPs has been more refined.
Also, in JavaScript, two important principles with OOP in JavaScript are
Object Creation patterns (Encapsulation) and Code Reuse patterns
(Inheritance). Although JavaScript developers rarely use this feature but its
there for everyone to explore.

 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.

Features of Python programming language


 Readable: 

Python is a very readable language.

  Easy to Learn: 

Learning python is easy as this is a expressive and high level programming


language, which means it is easy to understand the language and thus 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: 

Python is a open source programming language.

 5. Large standard library: 


 Python comes with a large standard library that has some handy codes and
functions which we can use while writing code in Python. 
 Advanced features: 

Supports generators and list comprehensions. We will cover these features


later.

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.

Scientific and Numeric Applications


 Thanks to its massive library base, Python has become a crucial tool in
scientific and numeric computing.
Some of the most useful Python packages for scientific and numeric
computation include:
Numeric Python (fundamental numeric package)
Natural Language Toolkit (Mathematical And text analysis)

Artificial Intelligence and Machine Learning 


AI and ML models and projects are inherently different from traditional
software models. When we talk about AI/ML projects, the tools and
technologies used and the skillset required is totally different from those
used in the development of conventional software projects. Software
Development
Enterprise-level/Business Applications
Enterprise-level software or business applications are strikingly different
from standard applications, as in the former demands features like
readability, extensibility, and scalability.
Education programs and training courses
If there’s any beginner-friendly programming language, it is Python. We’ve
said it many times before, and we’re repeating it – Python has an extremely
straightforward syntax that’s similar to the English language.
Language Development
Over the years, Python’s design and module architecture has been the
inspiration behind the development of many new programming languages
such as Boo, Swift.
Operating Systems
Yes, Python is the secret ingredient behind many operating systems as well,
most popularly of Linux distributions.

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.

 Python is for Everyone


Python code can run on any machine whether it is Linux, Mac or Windows.

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

It is very simple and easy to use, compare to other scripting language it is


very simple and easy, this is widely used all over the world.

 Faster

It is faster than other scripting language e.g. asp and jsp.

 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

PHP have some predefined error reporting constants to generate a


warning or error notice.

Applications

1. Web Pages and Web-Based 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.

2. Web Content Management 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:

From small businesses to large enterprises, selling to online shoppers is now


an indispensable requirement. Through use of frameworks like and, PHP
allows creation of e-commerce applications in a swift and simple manner.

4. GUI-Based Applications:

While PHP is largely used as a scripting language for web-based applications, it


is also possible to employ it for creating desktop graphical user interface.
6. Image Processing and Graphic Design:

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

Since there are hundreds of programming languages existing nowadays, it is


impossible and inefficient to put effort on analyzing each languages. But we can
classify the some representative categories of languages and make deep analyses
on them according to some certain criteria. Thus our analyses problem is aiming
to compare and contrast 5 languages according to 10 specified criteria with the
purpose of determining the suitability and applicability of the languages for each
criterion, distinguish them their pros and cons, evaluate and explore the related
features on those languages, illustrate the points either with code examples or
related work. In our project, we will evaluate our languages based on following
criteria:
Default more secure programming practices
All languages provide an exception handling mechanism for detecting errors and
prevent applications from crashing. C# and Java have the best exception handling
implementation by providing a set of customized exception classes.
Web applications development
We have found that all mentioned above languages support web applications
development. However, we have found that C#, PHP, Java, JavaScript are
particularly suited for easy web design. It is difficult to say which one is better
than others. These three technologies provide powerful feature and have been
adopted in large web applications development project.
Web services design and composition
PHP, Java, C# enable developers to write web services. It is seems that Java is
better than others languages. Java is cross platform and can be coupled with
AspectJ to implement a secure, stable composed web services. C# is an easiest
language to learn. Visual Studio is a powerful IDE which provides helpful features
for building and debugging web services applications.
OO-based abstraction
According to our above study, Java, C#, are pure object-oriented programming
languages. C++, PHP 5.0 also support OO development but they are not pure OOP
and don’t provide all OO features found in Java and C#. C# and Java are
particularly more suited for OO development. It is difficult to say which one is
better than others. But C# has introduced more OO features such as Properties,
Indexers, delegates, etc. Java and C# have a similar syntax and they are easy to
learn, and both are strongly typed. Other partially support OOP, but in some of
them OOP has been introduced lately or as extension libraries.
Batch scripting
According to our studies, batch scripting is possible in all languages except
JavaScript .PHP, C#, and Java are the best. A program written in one of them can
be automated (scheduled using Scheduled tasks in Windows and Crontab in a
Unix-based system). PHP and C# are used to automate report generation such as
sales report, job alerts, etc. PHP is more suited one since is not compiled, so if
some changes has occurred on the source code, there is no need to recompile an
already deployed script.
UI prototype design
After comparing many features, we have found that is possible to create UI in any
one of these 10 languages. C#, Java are particularly suited for GUI design. Java, is
based on Java AWT/Swing libraries.. We conclude that PHP and JavaScript are
more suitable for web pages UI design since they can easily mixed/embedded in
HTML code.
Conclusion
We have performed a thorough and detailed comparison of our selected
programming languages to study within the specified criteria. We have found
that, by their native design, each language is suited for a specific field. Some of
them can be fully applied to the compared criteria without extensions.
Java have demonstrated that they are the more suitable for both web and
desktop applications development. They are strongly typed which enable to write
more secure programs.
On the other hands, AspectJ as an extension of Java language is the best
mainstream aspect-oriented language. PHP and JavaScript are particularly
suitable for web development. Haskell and Scheme are better for functional
programming. C++ is more suitable for system development and desktop
applications. Scala and Groovy have extended Java.

You might also like