<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/5-bad-c-habits-avoid-them-please--z1w5xuw5u" -->

---
title: 5 Bad C++ habits. Avoid them please! | daily.dev
description: A C++ developer with 10 years of game dev experience outlines 5 common bad habits: not initializing variables in constructors (use in-class member initializers...
canonical: https://daily.dev/posts/5-bad-c-habits-avoid-them-please--z1w5xuw5u
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: 5 Bad C++ habits. Avoid them please! | daily.dev
og:description: A C++ developer with 10 years of game dev experience outlines 5 common bad habits: not initializing variables in constructors (use in-class member initializers...
og:url: https://daily.dev/posts/5-bad-c-habits-avoid-them-please--z1w5xuw5u
og:image: https://api.daily.dev/og/posts/z1w5xUW5u.png
og:image:alt: 5 Bad C++ habits. Avoid them please!
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# 5 Bad C++ habits. Avoid them please!

**[Low Level Game Dev](https://daily.dev/sources/lowlevelgamedev)** · 9 min read · 0 upvotes · 0 comments

## Summary

A C++ developer with 10 years of game dev experience outlines 5 common bad habits: not initializing variables in constructors (use in-class member initializers instead), declaring all variables at the top of functions (a legacy C practice), unnecessarily allocating objects on the heap, writing code that makes misuse easy (e.g., accepting raw pointers instead of references), and neglecting to build large projects in favor of passive learning. Each habit is illustrated with concrete code examples, and the post ends with a plug for a C++ game development course.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.youtube.com/watch?v=bYuOvW6DRl0>

---

Tags: [#game-development](https://daily.dev/tags/game-development), [#c++](https://daily.dev/tags/c++)

[View this post on daily.dev](https://daily.dev/posts/5-bad-c-habits-avoid-them-please--z1w5xuw5u)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"5 Bad C++ habits. Avoid them please!","url":"https://daily.dev/posts/5-bad-c-habits-avoid-them-please--z1w5xuw5u","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/5-bad-c-habits-avoid-them-please--z1w5xuw5u"},"datePublished":"2026-03-22T16:23:31.168Z","dateModified":"2026-03-22T16:23:52.939Z","description":"A C++ developer with 10 years of game dev experience outlines 5 common bad habits: not initializing variables in constructors (use in-class member initializers...","image":"https://i.ytimg.com/vi/bYuOvW6DRl0/sddefault.jpg","thumbnailUrl":"https://i.ytimg.com/vi/bYuOvW6DRl0/sddefault.jpg","isAccessibleForFree":true,"articleSection":"Low Level Game Dev","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Low Level Game Dev","logo":"https://media.daily.dev/image/upload/s--Mggt4-BY--/f_auto/v1724390809/logos/lowlevelgamedev","url":"https://daily.dev/sources/lowlevelgamedev"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/5-bad-c-habits-avoid-them-please--z1w5xuw5u","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"game-development,c++","timeRequired":"PT9M","video":{"@type":"VideoObject","name":"5 Bad C++ habits. Avoid them please!","description":"A C++ developer with 10 years of game dev experience outlines 5 common bad habits: not initializing variables in constructors (use in-class member initializers...","thumbnailUrl":"https://i.ytimg.com/vi/bYuOvW6DRl0/sddefault.jpg","uploadDate":"2026-03-22T16:23:31.168Z","duration":"PT9M","url":"https://api.daily.dev/r/z1w5xUW5u","embedUrl":"https://www.youtube.com/embed/bYuOvW6DRl0"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Low Level Game Dev","item":"https://daily.dev/sources/lowlevelgamedev"},{"@type":"ListItem","position":3,"name":"5 Bad C++ habits. Avoid them please!"}]}
```

