DEV Community

Cover image for High Level Programming Language 0-60
Greg Arnold
Greg Arnold

Posted on

High Level Programming Language 0-60

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

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

Performance:

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

Image description

Image description

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

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

Image description

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

Image description

Image description

Image description

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

Top comments (3)

Collapse
 
jonasbarka profile image
Jonas Barkå

Your description of C# is at least 5 years out of date, as that is how long it has had first party support for non-windows platforms.

I wonder if your benchmarks are equally out of date, as modern C# usually beats Java in benchmarks.

Edit:
Sure, your source is from 2016. Since then a lot has happened. What is the purpose of mostly copy-pasting from such an old source?

Collapse
 
jonasbarka profile image
Jonas Barkå

Your description of C# is at least 5 years out of date, as that is how long it has had first party support for non-windows platforms.

I wonder if your benchmarks are equally out of date, as modern C# usually beats Java in benchmarks.

Collapse
 
sandordargo profile image
Sandor Dargo

Compile time and execution time is summed up in the same chart?