MRC-CSO-SPHSU / LoneParentsModel.jl

An initial implementation of an ABM for social and child care
0 stars 4 forks source link

coding guidelines II #27

Closed mhinsch closed 2 years ago

mhinsch commented 2 years ago

While I very much prefer tabs over spaces, I can live with the latter. They should be used consistently, though. Currently some source files use 2 and some 4 spaces. Can we agree on 4?

AtiyahElsheikh commented 2 years ago

Ok I will attempt that. I am using VSCode and therefore not suffering from any inconsistencies in this regard. I will see if there is a setting for that and if there is any automatic tool for making the code consistent

AtiyahElsheikh commented 2 years ago

I have played with the settings of VSCode to ensure that tabsize would be 4. Still I won't be able to visually differentiate between spaces and tabs. Practically, I guess it would be difficult to ensure this consistency 100%, see e.g. https://github.com/mhinsch/LoneParentsModel.jl/blob/agent_modules/src/agents/kinship.jl ;-) (Probably you have just done copy and paste)

How about using an automatic code formatter, e.g. https://github.com/domluna/JuliaFormatter.jl ? Should we use it manually on a regular basis? or shall we find a way to integrate it at the pull-request phase?

mhinsch commented 2 years ago

You can configure VSCode to show whitespace. Doesn't matter though, if we indeed agree on spaces I'll just change my config to do 4 spaces as well (I hadn't done that yet which is why I might still have added some tabs somewhere).

AtiyahElsheikh commented 2 years ago

I can see white spaces but I cannot see difference between a tab and 4 spaces. Thus, Inserting tab = inserting 4 spaces