UnoffLandz / unoff-landz

open source server for the eternal lands/other life client
9 stars 4 forks source link

Overall coding style #60

Closed nemerle closed 9 years ago

nemerle commented 9 years ago

Warning bikeshedding ahead :smile:

  1. What is our target language for server / client ?
  2. What version of given language are we targeting ( i.e. when using c, using c99 standard will make some parts of the code base cleaner ) ?
  3. What is our 'target' code style ?

Since client is using cpp/c mix, my personal approach in this case would be to use minimal c++ subset:

Basically rename all .c files to .cpp files and fix whatever breaks.

@themuntdregger - from what I've seen You are not a big fan of c++, is it overall language you don't like, or is it only some specific parts of it ( template hell, ultra-deep class hierarchies etc. ? )

themuntdregger commented 9 years ago

1) Target language for server is C.

2) I like the idea that we should target c99 on the server. However, there may be difficulties in using it for a cross-platform client as the Mingw compiler doesn't support c99.

3) Wow, cool question - I guess whatever style we choose, the main thing is maintaining consistency. It may help with this for us to create a 'style guide' for the project.

I agree with your approach to building the client, ie C plus a minimal C++ subset. That seems a practical and sensible approach.

I guess my issues with C++ are partly historical. When the language first came out, there were big differences in compilers, which made it difficult to write portable code. My programming style also tends to be procedural, so object extensions are not something I naturally tend to use. I also admit to being intimidated by templates etc lol. However, mostly its just lack of familiarity on my part with the language and, probably not having a good appreciation of its potential benefits.