Written by Itay Bittan.
Most of our code project was written in C. Here are some of the pitfalls we suffered from:
-
While working with separated modules/sub-projects for each component of the system, we had to maintain some shared place for most of the struct's definitions - so moving data from one module to another could be achieved (for example, via TCP sockets). It turned out that it is not a simple task and lead to a lot of dependencies between sub-projects, redundants headers files includes and sometimes even struct duplications.
-
For persistency, some C structs were written into binary files (for example, query metadata). During the project lifecycle, these structs were changed (increased by more fields most of the time). Trying to read data from the old binaries files (which suitable to the old structs) cause malformed incorrect data and sometimes even caused to segmentation faults and system crash.