Creative

If I had to write C code...

/ Technical / Comments / C++ >>

I am a C++ programmer and it's fair to say that my experience with C is actually limited. However, I have been working with C code lately, even if I think that code is quite pretty, I found some disturbing approaches.

So if I had to write C code, I would try to avoid
  • Using integers for enums.
  • Using macros when constants and functions could be used.
  • Using large and flat structures instead of a hierarchy of small structures.
  • Writing functions with 1000 of lines, 100 lines is already quite long.
  • Writing files with 10000 of lines, 1000 lines is already quite long.

Nothing spetacular but in practice, it is something that happen too often. Anyway, C is ok but not as fun as C++ can be!

Boost 1.42.0 released: UUID
Boost 1.41.0 released: Property Tree
Copyright © G-Truc Creation 2002-2010 all rights reserved