Evaluating Large Language Models for Code Generation: A Comparative Study on Python, Java, and Swift

With the development of artificial intelligence (AI), particularly in natural language processing and machine learning, AI applications in code generation, error correction, and programming assistance have become more common. However, differences in code generation capabilities among models influence their practical applicability in programming tasks. To investigate this issue, this study evaluates the performance of five state-of-the-art large language models (LLMs)GPT-4o, OpenAI o1, OpenAI o1 Pro, Claude 3.5, and Gemini 2.0through a systematic comparative analysis across three programming languages: Python, Java, and Swift. The evaluation framework considers multiple aspects, including overall accuracy, code efficiency, time complexity, space complexity, and multi-solution generation capabilities.The experimental results reveal substantial variations among models: OpenAI o1 Pro and Gemini achieve the highest accuracy, GPT-4o generates the most concise code, and Claude 3.5 produces the greatest number of alternative solutions. However, all models exhibit lower performance in Swift compared to Python and Java, likely due to the limited availability of training data in Swift. An in-depth error analysis identifies differences in model adaptability across programming languages and highlights key limitations of AI-assisted programming. These findings provide insights for developers and users of AI-assisted programming tools, supporting more informed decision-making in selecting and applying these technologies in different programming contexts.

Authors

Institutions

Publication Details

Journal
Applied and Computational Engineering
Published
2025-04-21
DOI
https://doi.org/10.54254/2755-2721/2025.tj22242
Citations
4
Primary Topic
Computational Physics and Python Applications
Type
article
Field-Weighted Citation Impact
9.92
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Evaluating Large Language Models for Code Generation: A Comparative Study on Python, Java, and Swift

Bo Wan
4 citations
Applied and Computational Engineering
Computational Physics and Python Applications
9.92
article

Evaluating Large Language Models for Code Generation: A Comparative Study on Python, Java, and Swift

Bo Wan
article en
4 citations

Abstract

With the development of artificial intelligence (AI), particularly in natural language processing and machine learning, AI applications in code generation, error correction, and programming assistance have become more common. However, differences in code generation capabilities among models influence their practical applicability in programming tasks. To investigate this issue, this study evaluates the performance of five state-of-the-art large language models (LLMs)GPT-4o, OpenAI o1, OpenAI o1 Pro, Claude 3.5, and Gemini 2.0through a systematic comparative analysis across three programming languages: Python, Java, and Swift. The evaluation framework considers multiple aspects, including overall accuracy, code efficiency, time complexity, space complexity, and multi-solution generation capabilities.The experimental results reveal substantial variations among models: OpenAI o1 Pro and Gemini achieve the highest accuracy, GPT-4o generates the most concise code, and Claude 3.5 produces the greatest number of alternative solutions. However, all models exhibit lower performance in Swift compared to Python and Java, likely due to the limited availability of training data in Swift. An in-depth error analysis identifies differences in model adaptability across programming languages and highlights key limitations of AI-assisted programming. These findings provide insights for developers and users of AI-assisted programming tools, supporting more informed decision-making in selecting and applying these technologies in different programming contexts.

Applied and Computational EngineeringVol. 146(1)
The University of Melbourne (AU)
Openalex Percentile: Top 2%
Computational Physics and Python Applications
9.92
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Evaluating Large Language Models for Code Generation: A Comparative Study on Python, Java, and Swift — Bo Wan · Applied and Computational Engineering (2025) | TGRS Research Map | TGRS