DefinePK hosts the largest index of Pakistani journals, research articles, news headlines, and videos. It also offers chapter-level book search.
Title: The Impact of Language Syntax on the Complexity of Programs: A Case Study of Java and Python
Authors: Kashif Munawar, Muhammad Shumail Naveed
Journal: International Journal of Innovations in Science & Technology
Publisher: 50SEA JOURNALS (SMC-PRIVATE) LIMITED
Country: Pakistan
Year: 2022
Volume: 4
Issue: 3
Language: English
Keywords: Cyclomatic ComplexityProgramming LanguagesSyntaxJavaPython.
Programming is the cornerstone of computer science, yet it is difficult to learn and program. The syntax of a programming language is particularly challenging to comprehend, which makes learning arduous and affects the program's testability. There is currently no literature that definitively gives quantitative evidence about the effect of programming language complex syntax. The main purpose of this article was to examine the effects of programming syntax on the complexity of their source programs. During the study, 298 algorithms were selected and their implementations in Java and Python were analyzed with the cyclomatic complexity matrix. The results of the study show that Python's syntax is less complex than Java's, and thus coding in Python is more comprehensive and less difficult than Java coding. The Mann-Whitney U test was performed on the results of a statistical analysis that showed a significant difference between Java and Python, indicating that the syntax of a programming language has a major impact on program complexity. The novelty of this article lies in the formulation of new knowledge and study patterns that can be used primarily to compare and analyze other programming languages.
To examine the effects of programming language syntax on the complexity of source programs, specifically comparing Java and Python.
The study selected 298 algorithms and implemented them in both Java and Python. The complexity of these implementations was analyzed using cyclomatic complexity, strict cyclomatic complexity, and essential cyclomatic complexity metrics. Statistical analysis was performed using SPSS and R, including the Mann-Whitney U test.
graph TD
A[Select 298 Algorithms] --> B[Implement in Java and Python];
B --> C[Analyze Complexity Metrics CC, SCC, ECC];
C --> D[Perform Statistical Analysis SPSS, R];
D --> E[Compare Java and Python];
E --> F[Draw Conclusions on Syntax Impact];
The research suggests that programming language syntax significantly impacts program complexity, affecting aspects like testability and maintainability. Python's simpler syntax and conciseness contribute to its lower complexity scores compared to Java's more verbose nature.
Python's syntax is less complex than Java's, leading to more comprehensive and less difficult coding. Python programs generally require fewer tokens and lines of code, and exhibit lower cyclomatic complexity metrics compared to Java.
Programming language syntax has a substantial impact on program complexity. Quantitative analysis of lexical structure, syntax, and semantics is crucial for selecting programming languages, which can reduce learning challenges and improve the performance of learners and novice programmers.
- 298 algorithms were selected for analysis after initial selection and expert consultation.
- The Mann-Whitney U test showed a significant difference between Java and Python for tokens, LOC, CC, and SCC, but not for ECC.
- Python's mean token score was 165.02, compared to Java's 250.19, a difference of 41.03%.
Loading PDF...
Loading Statistics...