I cancelled my PLUS subscription and im switching to Claude Sonnet 3.7 for C++ coding

GOODBYE OPENAI !

Why did you cancel your subscription ?

o3 and 4o are so awful c++ coding, its so bad keeps giving lazy half answers dropping bits all over the place with a bunch of extra hallucinating useless stuff

no github integration like claude either

ill keep chatgpt on free account as a toy on my phone, but not for professional c++ coding anymore.

at least 4o is honest…

Claude Sonnet vs OpenAI

user
why is claude sonnet 3.7 so much better at coding c++ than openai o3 and 4o models ?

ChatGPT
Claude Sonnet 3.5 and 3.7 have earned a reputation for excelling at structured, large-context reasoning and maintaining coherent object-oriented code across multi-file C++ projects. The perception that Claude 3.7 is better than GPT-4 (especially 4o and GPT-4-turbo in their current form) at C++ programming—particularly low-level, systems-oriented code—can be attributed to a few architectural and training hypotheses:


:magnifying_glass_tilted_left: Key Reasons Claude 3.7 May Feel Better at C++:

1. More Stable Memory of Long Contexts

Claude 3.7 handles long prompts more deterministically, particularly across structured code like header/source file pairs, templated code, or when maintaining state across iterations. GPT-4 sometimes collapses under pressure in these scenarios or introduces minor hallucinations.

In your own case, where you’re doing ReaxFF in LAMMPS with Kokkos, Claude may simply be better at preserving multi-file architecture logic with fewer omissions.

2. Cleaner Abstractions and Naming Discipline

Claude tends to generate well-factored, self-documenting code, especially in C++ where naming, access control, and method signatures matter. GPT-4, especially the o3 and 4o variants, sometimes prioritizes verbosity or “getting an answer fast” over clean engineering.

Claude more often chooses idiomatic patterns: RAII, smart pointers, const-correctness, and templates when appropriate.

3. Better at Interleaving Code and Reasoning

Claude can interweave explanations and code more effectively in technical domains. GPT-4 sometimes detaches them too much (first dumps code, then explains), while Claude may walk you through why it’s using Kokkos::TeamPolicy here vs RangePolicy there in-line with the code.

4. Training Bias Toward Engineering Docs

Claude appears to have been trained or fine-tuned heavily on engineering documentation (open-source C++, technical RFCs, templated math code, etc.). GPT-4 is very strong too, but Claude seems to preserve semantic granularity better when, say, porting SparseMatrix<T> across compute backends.


:chart_decreasing: Weaknesses of Claude vs GPT-4

It’s not all upside for Claude:

  • GPT-4 is better at debugging existing code (particularly when printing internal state or reasoning about subtle numeric bugs).
  • GPT-4 models (especially GPT-4-turbo) generate output faster and may feel snappier in rapid iteration.
  • GPT-4 knows more edge-case facts, especially chemistry-specific constants, physical models, or obscure electrostatics details.

:brain: What Might Be Happening Internally?

Model Strength
Claude 3.7 Possibly optimized with a strong focus on engineering-oriented instruction tuning, careful token utilization, and consistent symbol tracking across long-form prompts.
GPT-4o / 4-turbo Likely optimized for speed, cost, and broad applicability, at the cost of occasional fidelity loss in structured C++ or system-level code. Its multi-modal fusion may also eat some effective C++ token capacity.

So you didn’t try o3?
You should. It’s crazy good.