Cardinal Peak logo placeholder
Blog Post
Software Development

RAII in C

In my last post, I talked about resource management, and how RAII, Resource Acquisition is Initialization, is important in C++ because of the guarantees it provides. In this post, I’ll show how we can make the same guarantees in C. In C++, RAII provides a solution to resource management and the issues arising with exceptions.... View Article
Cardinal Peak
Blog Post
Software Development

RAII Introduction

Explore RAII: a powerful C++ programming idiom for resource management. Learn how it ensures exception safety, prevents leaks, and can be applied in C.
Howdy Pierce
Blog Post
Outsourced Engineering

My Threads Question

If we interview you here at Cardinal Peak, we're going to assume you're competent to use Google, and we'll give you the benefit of the doubt that you can look up answers to weird corner cases. What we really want to know is how deeply you understand how a computer works.
In my last post, I talked about resource management, and how RAII, Resource Acquisition is Initialization, is important in C++ because of the guarantees it provides. In this post, I’ll show how we can make the same guarantees in C. In C++, RAII provides a solution to resource management and the issues arising with exceptions.... View Article
Explore RAII: a powerful C++ programming idiom for resource management. Learn how it ensures exception safety, prevents leaks, and can be applied in C.
If we interview you here at Cardinal Peak, we're going to assume you're competent to use Google, and we'll give you the benefit of the doubt that you can look up answers to weird corner cases. What we really want to know is how deeply you understand how a computer works.
Howdy Pierce
Blog Post
Software Development

Computing Primes in Python and C++

Explore prime number computation: Python vs. C++. Discover speed insights between these languages using the Sieve of Eratosthenes algorithm. Download Python and C++ code here!
Cardinal Peak
Blog Post
Software Development

Writing Defensive Code to Automatically Find Memory Leaks

In an earlier post, I suggested making all your memory allocations go through a single routine, and deletions through another. When you centralize allocation and deallocation like this, you gain a couple of benefits. First of all, you make the memory allocation more explicit, which will tend to make programmers more careful. Second, you can... View Article
Cardinal Peak
Blog Post
Security

How To Find a Memory Leak

Finding memory leaks and other problems in your code can be challenging, but there are tools available to help simplify that process. Remember to add time to your schedule so that you can apply the available tools for finding memory leaks and other problems.
Explore prime number computation: Python vs. C++. Discover speed insights between these languages using the Sieve of Eratosthenes algorithm. Download Python and C++ code here!
In an earlier post, I suggested making all your memory allocations go through a single routine, and deletions through another. When you centralize allocation and deallocation like this, you gain a couple of benefits. First of all, you make the memory allocation more explicit, which will tend to make programmers more careful. Second, you can... View Article
Finding memory leaks and other problems in your code can be challenging, but there are tools available to help simplify that process. Remember to add time to your schedule so that you can apply the available tools for finding memory leaks and other problems.