Add project documentation: code guideline
Add brief file like "c2c_native/docs/code_guideline.md" that explains indendations, var names std, func names std etc?
(Plus add a "please read the code guideline when contributing" to README?)
Edit: My wish for that stems from some inconsistencies that i have noticed in the indentation and variables names. Some indents use actual tabs, most don't. Some var names have snake_case others are strictly camelCase.
Examples from https://github.com/c2lang/c2c_native/blob/491a31c8e0d4c687c776bdce8cfcc11cd2d864d4/compiler/main.c2:
303:fn void plugins_start_target(void* arg, plugin_info.Info* info) {
^
snake_case function
331: console.setTiming(opts.print_timing);
^ ^
camelCase function |
snake_case variable
342: string_pool.Pool* auxPool = string_pool.create(32*1024, 64);
^
camelCase variable
I would like to propose the following markdown document as code guideline. It doesn't reflect my personal preferences (Linux style) but what i have noticed to be the most used in the already existing codebase, except for one thing: having multiple statements in one line be allowed. I think it's just too easy to obfuscate something with that. I also didn't sit down to count how often of a way to do something actually occurs, so this may be biased by the files i read at that time.