High Level Programming Language 0-60
Tags: java, cpp, csharp, performance
Published: 2021-12-22 18:04:46

## Introduction
Has the need for speed ever caught you off guard during a coding session? If so, buckle up hit the turbo button and get ready as we dive into a study of performance of a few popular high level programming languages.

This study was done by Zahida Parveen and Nazish Fatima, Department of Computer Science, University of Ha’il, Hail, Saudi Arabia and is published in the International Journal of Computing Academic Research (IJCAR). It focuses on Java, C# and C++ and the main criteria are: syntax, Lines of Code, MachineDependency, Compilation Time, and ExecutionTime, Speed or efficiency and flexibility. the ultimate goal of this study was to generate more understanding of the best characteristics and strong points in some high level programming languages.

## Properties of Selected Languages

### Java
Originally called OAK, it's main goal was to create a language to act as a bridge for communication between home entertainment appliances, and later expanded with global networking into the need of browsers. Simple syntax by omitting complex data types. Java's speed is slower than other languages, as it does not directly compile the program to machine code until run time, an attribute of being a portable language. Uses a special scheme to have its highest performance that is interpreter run at full speed without accounting for run-time environment. Java makes sure that memory is available on demand, achieved by running automatic garbage collector at a low priority background thread.
   

Basic syntax example:
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jgd7lfmfgdhsi742b8ht.PNG)
Mostly considered as independent of machine or platform. 

### C sharp
Originally called Cool (C-like Object Oriented Language), but was not finalized due to trademark reasons. Most of the main concepts C# borrows from Java yet it is modern, simple and general-purpose object oriented language. The programs written in C# need .NET Framework to be executed .As .NET framework is a Microsoft product and it only supports Windows platform. Recently a 3rd party framework, MONO has been introduced to run ASP.NET on Linux. All the .NET languages have slow speed when compared with other like Java and C++. The reason behind this is C# consuming high memory and the consumption cannot be controlled with ordinary methods. Another reason that cause the slow speed and deficiency in C# language is JIT low level optimization as the program optimization is done at runtime so cannot be take too much time. This factor can also affect the speed and efficiency to some extent. Performance is is not very high, yet is popular due to many of its characteristics.

Basic syntax example:
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8mq8xpbn3ozwhtl5h0gl.PNG)

### C++
An extension of C  by Bjarne Stroustrup to integrate Simula structures into C to improve distributed computing in 1979 with first commercial implementation released in 1985. Considered very fast and powerful, primarily due to already have been compiled to machine code. Built to run on a specific machine efficiently, and generally assumes a good programmer is behind the keyboard due to being a harder to use language. This is due to a mix of lot of low level control with high level control. C++ integrated both object-oriented programming and procedural programming in its design. Since it is so platform dependent, , the easiest solution is to use a specific library for that system (in this case Microsoft C++ .NET) or connect to existing system utilities to do
the work (as can easily be done on UNIX systems). The same program can be developed quickly in Java and still be cross platform compatible simply by using the included standard networking libraries.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3efg15l7hz30hqh2l4ka.PNG)

## Performance:
Each language was given a common program, "Printing Fibonacci Series".

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x1xe29f822reonp9pvib.PNG)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n287cpd9ph47yv9sjsd6.PNG)

Lines of code (LOC), is a software metric used to determine the size of a computer program. The size of program can be estimated by counting the number of lines of the code in its textual form, the size of program can help in estimating the programming productivity or maintainability. More lines of code means more efforts needed to maintain.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8h3x7tkzjhuaq64l7epr.PNG)

To calculate the lines of code used in these programs a common program “LocMetric” was used to count the number of lines in Fibonacci series program. LOC; C Sharp: 68, Java: 34, C++: 20.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3mxw71amkkwp3xgi1jux.PNG)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0a38kig7ivbsfy5q9ngo.PNG)

It can be concluded that C++ has the advantage of having the minimum lines of code.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ax572w485j3bokstubo0.PNG)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v1m2z1kplo1ciskx5jey.PNG)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l72ykrderg0sqy43yw4c.PNG)
 
## Summary
This research concluded that there is no ideal language to choose for all purpose, rather each language has its own strengths and weaknesses depending on the project requirements.


Source [http://www.meacse.org/ijcar/archives/109.pdf](http://www.meacse.org/ijcar/archives/109.pdf)