Skip to content
This repository has been archived by the owner on Mar 3, 2022. It is now read-only.

My way of programming

Cyrion edited this page May 5, 2018 · 8 revisions

My way of programming

I don't force you to follow it, but I write here my way to program, so you will be able to understand some things in my code. If you want to participate to the game, it's better for me that you follow theses rules, but I don't force you. It is just for me. Because I don't know the way of programming of other programmers, I could have written some generalities. I hope you won't hold it against me.

  • I use the "camelCase" convention. I never use underscores, except for defines or constants, or some other exceptions.
  • I practically never use boolean setters. If I need to modify a boolean, I put in in public, because, in my opinion, the booleans don't need to be verified. For all other types of variables, I use setters if I need to modify them.
  • Obviously, if a boolean is public, I will not create a getter for it.
  • Some of the variables are in french, or a mix of french and english. It's old variables that I forgot to translate. If there is a french variable, warn me (So I can fix the problem).
  • All the objects-related comments are in the headers, and all the code-related comments are in the sources.
  • when I want to create a string which is the string for an another variable, I often name it "varNameS".
  • I try to create macros for the repetitive creation of objects, like attacks or OpMons. It allows me to do it much more quickly. So I create A LOT of macros (Maybe too much). If you think it makes the code too difficult to understand or confused, warn me.
  • I comment constructors in the code only if it is really useful. I try to make the names explicit enough.
Clone this wiki locally