What’s is the point of PImpl pattern while we can use interface for the same purpose in C++?
I see a lot of source code that uses PImpl idiom in C++. I assume Its purpose is to hide the private data/type/implementation, so it can remove dependence, and then reduce compile time and header include issue.
Anti-pattern? Double header and exposed implementation detail
Consider that I’ve implemented SHA-256 hashing in C as incrementally updated IUF (init-update-finalize) working context and 3 subroutines. To efficiently use it in multi-threaded applications, users may want to avoid heap allocation using malloc
or calloc
, etc. and declare the working context on the stack using a structure type I’ve provided in the header.
what specific needs of a project should i be considering when creating an architecture model for my project?
i am at the very beginning stages of developing a hybrid project, and am at a bit of a loss when it comes to deciding what kind of structural method to use. all of the advice I’ve read on the subject basically states that there is no one size fits all, and what matters most is your app’s core functionality and team’s need.
Which is the most practical way to add functionality to this piece of code?
I’m writing an open source library which handles hexagonal grids. It mainly revolves around the HexagonalGrid
and the Hexagon
class. There is a HexagonalGridBuilder
class which builds the grid which contains Hexagon
objects. What I’m trying to achieve is to enable the user to add arbitrary data to each Hexagon
. The interface looks like this:
Which is the most practical way to add functionality to this piece of code?
I’m writing an open source library which handles hexagonal grids. It mainly revolves around the HexagonalGrid
and the Hexagon
class. There is a HexagonalGridBuilder
class which builds the grid which contains Hexagon
objects. What I’m trying to achieve is to enable the user to add arbitrary data to each Hexagon
. The interface looks like this:
Which is the most practical way to add functionality to this piece of code?
I’m writing an open source library which handles hexagonal grids. It mainly revolves around the HexagonalGrid
and the Hexagon
class. There is a HexagonalGridBuilder
class which builds the grid which contains Hexagon
objects. What I’m trying to achieve is to enable the user to add arbitrary data to each Hexagon
. The interface looks like this:
Which is the most practical way to add functionality to this piece of code?
I’m writing an open source library which handles hexagonal grids. It mainly revolves around the HexagonalGrid
and the Hexagon
class. There is a HexagonalGridBuilder
class which builds the grid which contains Hexagon
objects. What I’m trying to achieve is to enable the user to add arbitrary data to each Hexagon
. The interface looks like this:
How to represent a geometric line programmatically?
I have been trying to design a library to do some simple geometric computations in an Euclidean space regardless of its dimension. While it is easy to represent points, vectors, hyperspheres and hyperplanes in a generic fashion, I am still unable to find a generic way to represent a (infinite) line, even though lines share properties across dimensions.
How to represent a geometric line programmatically?
I have been trying to design a library to do some simple geometric computations in an Euclidean space regardless of its dimension. While it is easy to represent points, vectors, hyperspheres and hyperplanes in a generic fashion, I am still unable to find a generic way to represent a (infinite) line, even though lines share properties across dimensions.
How to represent a geometric line programmatically?
I have been trying to design a library to do some simple geometric computations in an Euclidean space regardless of its dimension. While it is easy to represent points, vectors, hyperspheres and hyperplanes in a generic fashion, I am still unable to find a generic way to represent a (infinite) line, even though lines share properties across dimensions.