<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/notes-on-header-files-jr19rwiql" -->

---
title: Notes on header files | daily.dev
description: A veteran C/C++ developer shares a personal convention for organizing header files: keep .h files strictly for function and class declarations with...
canonical: https://daily.dev/posts/notes-on-header-files-jr19rwiql
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Notes on header files | daily.dev
og:description: A veteran C/C++ developer shares a personal convention for organizing header files: keep .h files strictly for function and class declarations with...
og:url: https://daily.dev/posts/notes-on-header-files-jr19rwiql
og:image: https://api.daily.dev/og/posts/jr19rWIQL.png
og:image:alt: Notes on header files
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.

# Notes on header files

**[Overview — bgfx 1.146.9292 documentation](https://daily.dev/sources/bkaradzic)** · 2 min read · 0 upvotes · 0 comments

## Summary

A veteran C/C++ developer shares a personal convention for organizing header files: keep .h files strictly for function and class declarations with doxygen-style documentation comments, and move implementations into .inl files (using inline) or .cpp files. This lets functions be reordered or grouped for documentation purposes without worrying about call order, and makes it trivial to move code between inline and non-inline implementations by toggling the inline keyword. The tradeoff is that function signatures now exist in two places instead of one.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://bkaradzic.github.io/posts/notes-on-header-files>

## Questions this post answers

### How should I organize function declarations and implementations across C++ header files?

Keep .h files exclusively for function and class declarations with doxygen-style documentation comments, and put implementations in separate .inl files (using the inline keyword) or .cpp files (without inline). This allows functions to be declared in any logical order in the header, such as alphabetically or grouped by purpose, rather than being constrained by call order between functions.

_Developers refining their C++ codebase structure can find more organization patterns like this on daily.dev._

### What is the tradeoff of separating C++ function declarations from their implementations?

The main downside is that a function signature now exists in two places instead of one, since the .h file holds the declaration and the .inl or .cpp file holds the implementation, whereas a single inline function definition would only need one signature. The benefit is easier documentation and freer ordering of declarations.

_Weighing tradeoffs in C++ code structure is easier with practical writeups like this on daily.dev._

## Similar posts on daily.dev

- [test-part2](https://daily.dev/posts/test-part2-vn8busjnf) · C\+\+ · 0 upvotes · 0 comments
- [Compile-Time Conditions in Java](https://daily.dev/posts/compile-time-conditions-in-java-kjy5rh792) · Baeldung · 0 upvotes · 0 comments
- [On C extensions, portability, and alternative compilers](https://daily.dev/posts/on-c-extensions-portability-and-alternative-compilers-xh1x5m5qq) · Hacker News · 0 upvotes · 0 comments

---

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

[View this post on daily.dev](https://daily.dev/posts/notes-on-header-files-jr19rwiql)

```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":"Notes on header files","url":"https://daily.dev/posts/notes-on-header-files-jr19rwiql","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/notes-on-header-files-jr19rwiql"},"datePublished":"2026-08-23T12:17:04.095Z","dateModified":"2026-08-23T12:20:03.280Z","description":"A veteran C/C++ developer shares a personal convention for organizing header files: keep .h files strictly for function and class declarations with...","image":"https://media.daily.dev/image/upload/s--CxzD6vbw--/f_auto/v1722860399/public/Placeholder%2005","thumbnailUrl":"https://media.daily.dev/image/upload/s--CxzD6vbw--/f_auto/v1722860399/public/Placeholder%2005","isAccessibleForFree":true,"articleSection":"Overview — bgfx 1.146.9292 documentation","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":"Overview — bgfx 1.146.9292 documentation","logo":"https://media.daily.dev/image/upload/logos/placeholder.jpg","url":"https://daily.dev/sources/bkaradzic"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/notes-on-header-files-jr19rwiql","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"c,c++","timeRequired":"PT2M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Overview — bgfx 1.146.9292 documentation","item":"https://daily.dev/sources/bkaradzic"},{"@type":"ListItem","position":3,"name":"Notes on header files"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/notes-on-header-files-jr19rwiql#faq","mainEntity":[{"@type":"Question","name":"How should I organize function declarations and implementations across C++ header files?","acceptedAnswer":{"@type":"Answer","text":"Keep .h files exclusively for function and class declarations with doxygen-style documentation comments, and put implementations in separate .inl files (using the inline keyword) or .cpp files (without inline). This allows functions to be declared in any logical order in the header, such as alphabetically or grouped by purpose, rather than being constrained by call order between functions. Developers refining their C++ codebase structure can find more organization patterns like this on daily.dev."}},{"@type":"Question","name":"What is the tradeoff of separating C++ function declarations from their implementations?","acceptedAnswer":{"@type":"Answer","text":"The main downside is that a function signature now exists in two places instead of one, since the .h file holds the declaration and the .inl or .cpp file holds the implementation, whereas a single inline function definition would only need one signature. The benefit is easier documentation and freer ordering of declarations. Weighing tradeoffs in C++ code structure is easier with practical writeups like this on daily.dev."}}]}
```

