Coding and naming conventions?


(David Lamhauge) #1

I searched for “convention” and found nothing, so I hope this is not a duplicate.
I want to contribute to the coding, and wonder if there is some written coding and naming cenventions for this project?
I am aware about the more general conventions. I have also noticed that you name variables with an “m” + the name.
Anything else I should be aware of before I plunge in?
David


(Matt) #2

Hi @davidlamhauge

Thanks for considering contributing to pencil2d.

It’s pretty much a minimal naming convention, like what you said, a “m” prefix for member variables, CapitolCamelCase for class names, camelCase for function names and variable names.

Getting things done is more important than following a strict coding style in pencil2d development.


(scribblemaniac) #3

This was discussed extensively here: https://github.com/pencil2d/pencil/issues/683
While we never reached full consensus on all points, this covers most of the convections for our project. The spreadsheet link near the beginning is a great summary of the consensus among main devs, but you will have to use the github issue to figure out what each of the letter options corresponds to.

In general just try to follow whatever is being used in the surrounding code, we aren’t extremely picky.


(David Lamhauge) #4

Thanks,
Except for the ‘m’ prefix, it look much like the coding style I use.
I’ll dive in and see where I land…