All Topics
All Topics
Technology
Technology
Design
Design
Programming
Programming
Science
Science
News
News
Gaming
Gaming
Entertainment
Entertainment
Business
Business
Finance
Finance
Sports
Sports
Health
Health
Food
Food
Travel
Travel
Art
Art
Music
Music
Books
Books
Education
Education
Politics
Politics
Personal
Personal
No algorithm. No AI slop. No ads. Just RSS. Pro-human. Indie writers. Real journalism. Open web. Chronological. Hand toasted.

Guidelines for Writing Fully Encapsulated C Programs: Pure vs Performance Approaches

By

p2detar

5mo ago· 14 min readen

Summary

This article presents a comprehensive set of rules and guidelines for writing fully encapsulated C programs, developed by the author over years of experience. It covers two main approaches: pure encapsulation (focusing on complete data hiding and abstraction) and performance encapsulation (balancing encapsulation with optimization needs). The article provides detailed programming rules, best practices, and philosophical insights about C programming, emphasizing the language's closeness to assembly and the freedom it offers developers.

Key quotes

· 5 pulled
C is my favorite language and I love the freedom and exploration it allows me. I also love that it is so close to Assembly and I love writing assembly for much of the same reasons!
I offer both a 'performance' and a 'pure encapsulation' approach to C here (first two headers). So feel free to interpret the rest of the rules based on the approach.
One of the great things about C is that it allows you to write code that is both high-level and low-level at the same time.
Perfect encapsulation means that the internal representation of data is completely hidden from the outside world.
The performance approach sacrifices some encapsulation purity for better runtime efficiency when needed.
Snippet from the RSS feed
A bunch of tips and rules I’ve created for myself for developing programs in the C programming language

You might also wanna read