How Schools Make You a Worse C++ Programmer: Bad Habits, Wrong Priorities
The author argues that schools teach harmful C++ habits like omitting braces, declaring variables at function tops, and skipping initialization, while overemphasizing rarely-used algorithms over real projects, delaying hands-on coding for years, and prioritizing theoretical coursework over skill-building projects like game clones that develop practical expertise.
Schools Teach Counterproductive C++ Habits
The author observes that schools increasingly produce worse programmers. In the author's country, courses teach vector indexing from 1 and string indexing from 0, while placing measurable algorithm and data-structure training before real projects. Global programming uses zero-based indexing; a more effective path invests limited time in actual coding and progressively harder large projects.
Five Test Questions Expose the Problems
The author uses five questions to test whether common school-taught habits leave lasting issues.
1. if Statements Should Keep Braces
Many teachers claim braces are unnecessary for single-statement if blocks to save screen space. The author counters that code evolves: adding a second statement later carries a significant bug risk. This if single-statement modification risk is why companies like Google mandate braces even for single statements.
2. University Code Review Reveals Three Variable Problems
A university code review of a student-implemented class concentrated issues in three variable categories.
Use Descriptive Variable Names
Variables should have understandable names. Single-letter names ( i, j) are acceptable only in tiny scopes; in large projects they become untraceable. Descriptive names speed comprehension and reduce modification errors.
Declare Variables at Point of Use
Around 1990 compilers required declarations at function start. Modern compilers do not, yet many teachers still insist on top-of-function declarations. One teacher asserted, "This is how real programmers write." In reality, variables should be declared where used, in the narrowest scope, to avoid functions cluttered with 100 variables.
Initialize Every Variable at Declaration
This is the most critical point. Variables must have valid initial values from declaration. Deferred initialization seems harmless but creates numerous bugs as projects or structs grow. The author urges initializing all variables from now on. Many turn to Rust for its bug-catching, but the root issue is that schools never taught safe, clear C++ coding.
3. OOP, Design Patterns, and Getters Don't Replace Basic Code Quality
In another review, a teacher approved a class's structure but demanded more OOP, private members, and getters — while the code already suffered from poor naming, misplaced declarations, and missing initialization. Universities often teach vague guidelines like OOP and design patterns instead of concrete, bug-reducing coding practices. Knowing abstractions cannot substitute for clear, safe fundamentals.
4. A Multiplayer Minecraft Clone Uses Only BFS and unordered_map
Schools overemphasize algorithms and data structures partly because they are easy to test and measure in competitions. By contrast, a C++ multiplayer Minecraft clone's hardest algorithm is BFS and its most complex structure is unordered_map — both simple. This is typical: nearly all projects use similarly basic tools. The author cannot recall last using list or graph, and university time spent on heaps never translated to real use. Advanced algorithms matter at massive scale (e.g., Google), but for most developers, learning them preemptively is poor time allocation. The author once used an LRU cache in a game, then removed it; university never taught it, yet it was quickly self-learned when needed. Recommendation: master basics first, learn advanced topics only when a project demands them.
5. Algorithm Homework Leaves High Schoolers No Time for Projects
A passionate high-school programmer had no time for personal projects because teachers assigned extra informatics homework. While algorithm practice improves problem-solving, exclusive focus on small algorithmic problems never exposes students to code organization, modification, and integration challenges — the very experiences that turn learners into programmers. The author's answer to "what should this student do now?": drop the extra homework and start a project. Not everyone aims to be an algorithm specialist, and this student did not enjoy that path.
University C++ OpenGL Track Takes at Least Five Years
The author's interest was graphics programming. The university curriculum scattered topics for three years, then required two to three more years of specialization — five years minimum before a C++ OpenGL project. In practice, universities rarely teach actual OpenGL development; they only show pre-made examples. The author reviewed many curricula and found this widespread. Students wanting real OpenGL projects must self-learn extensively. The claim that "university requires self-learning" actually admits universities are bad at teaching programming; they provide surface knowledge students could find themselves. The author completed a graphics programming master's but admits a diploma does not guarantee graphics programming skill.
11th-Grade OpenGL Project, 12th-Grade Minecraft
The author built an OpenGL project in 11th grade and a Minecraft clone in 12th grade — six years ahead of the university timeline. To learn OpenGL, the author self-studied linear algebra before it was taught in school, driven by the project goal, not exams. This is not boasting: in the author's Discord server, 14-year-olds build OpenGL projects and one learns Vulkan. There is no need to spend three university years discovering interests; self-learners can find direction and reach high proficiency in the same time. Many still want degrees for security, but spending five years and still not programming well is more alarming.
Theoretical Informatics and Mathematics Crowd Out Project Time
A friend at a top university had almost no time for personal projects due to heavy theoretical informatics and theoretical mathematics homework. The argument that "everything learned will be useful someday" is flawed: a baker should bake, not study advanced chemistry for three years. Good bakers know some chemistry, but their core time is baking. Likewise, aspiring programmers should program and build projects. The author minimized uninterested coursework, swapped assignments with peers (e.g., doing C++ homework for a peer's webdev homework), and directed time toward genuinely helpful, interesting areas.
Skill-Scaling Project: Start with a C++ Terraria Clone
Learning programming requires developing one large project, but not any project. It must contain many systems that can be added incrementally, each with varying difficulty — a skill scaling project . As the learner's ability grows, the project's complexity grows. A world generator exemplifies this: beginners implement a simple version per tutorials, then progressively tackle more complex generation. The project's difficulty scales with the learner.
Diploma Security Does Not Guarantee Programming Ability
The security of a degree cannot ensure someone writes good programs. The real concern: after university and master's, a person may still lack the time and experience to build what they want. If you have found a direction, do not wait for school or parents to arrange the next step. When you want a concrete new start, begin with the practices described here.
Author: 场长 Reference: https://www.youtube.com/watch?v=eRqSAPpIPlY
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
21CTO
21CTO (21CTO.com) offers developers community, training, and services, making it your go‑to learning and service platform.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
