A comparative study of the lexicographical complexity of Java, Python and C languages based on program characteristics
Keywords:
Software Complexity, Software Metrics, Halstead Software Science, C Programming, Java, PythonAbstract
In software engineering, software complexity measures how complicated it is to design, test, maintain, and comprehend a system or a program. Metrics have been appreciated over time as a measure of various attributes of software products. Some of the most well-known languages for scientific, object-oriented, and imperative programming are Python, Java, and C, respectively. However, it is not easy to distinguish the structural complexity of these programming languages and the existing studies have overlooked this issue. This study, therefore, uses a technique based on Halstead Software Science to conduct a comparative investigation to evaluate the lexicographical complexity of sequence, selection, and looping program structures in object-oriented, scientific, and imperative programming languages. Halstead Complexity Metrics were implemented utilizing sequence, selection, and loop control structures in Java, C, and Python to accomplish the study's goal. When subjected to the Halstead software science comprising of nine measurement criteria, the findings of the experiment demonstrated that in sequence and Loops program structures C language has the highest lexicographical complexity followed by Java, while in Selection program structures Java is more slightly complex than C. Python on the other hand, had the least lexicographical complexity across all three essential program structures—sequence, selection, and loops during the comparative study, therefore, it is the most appropriate programming language among the three that are being studied here in terms of program complexity. Using the results of this study, we intend to use effort prediction models in the future to estimate the programming effort. We also intend to do additional experiments with the same program structures using larger program samples in the future. A replication of the study using different programming languages is also suggested.