Generating key points…
Answers are grounded in this paper and cite their sources.
This study presents a comprehensive evaluation of a total of eight widely used open-source Large Language Models (LLMs) in code generation across the two most popular programming languages: Python and C++. Utilizing the gold standard HumanEval benchmark, we assess model performance across four core categories: Algorithms, Data Structures, Mathematics and Logic, and String Processing. In addition to evaluating correctness based on test case pass rates, we also measure the time required to generate code for each prompt, providing a dual perspective on accuracy and efficiency. Our results show that Python consistently outperforms C++ in terms of generation success across all categories, with particularly strong performance in mathematical reasoning tasks. Among all evaluated models, Gemma3:27b achieved the highest overall accuracy in both Python and C++, highlighting its superior generalization capabilities. To identify performance boundaries, we isolate the ten easiest and ten most challenging tasks, revealing that LLMs perform best on well-scoped, syntactically simple problems and struggle with nested logic, grid-based reasoning, and recursive control flow. Through detailed heatmaps and task-level visualizations, we offer actionable insights into current LLM capabilities and limitations, with implications for future model training, prompt engineering, and deployment in educational and industrial settings. To our knowledge, this study provides the first systematic comparison of Python versus C++ code generation across eight open-source LLMs using a dual-metric and taxonomy-guided evaluation framework.
No takes yet. Share an insight, caveat, or question.
Kabakuş et al. (2026) studied this question.
Synapse has enriched 10 related papers. Consider them for comparative context: