MRC-CSO-SPHSU / LoneParentsModel.jl

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

automatic code generation for unifying coding guidelines #26

Closed AtiyahElsheikh closed 2 years ago

AtiyahElsheikh commented 2 years ago

I feel the task of enhancing a package X with code like

[function] does_something() ... 

with an additional package Y that reads X and generates

module Y

   using X 

   doesSomething(*) = does_something(*)

end 

Is somehow manageable? what do you think?

related to issue #16

mhinsch commented 2 years ago

I don't think I understand what you mean. Do you want to automatise snake_case/camelCase?

AtiyahElsheikh commented 2 years ago

Yes to automatically generate separate code with consistent / desired coding conventions? without modifying the input code

mhinsch commented 2 years ago

I know that some Ruby projects do that, but that seems like an awful lot of effort for something that's really only cosmetics. Can't we just adopt the "official" Julia style (which is basically what you have in your design document and what Agents.jl does as well)? Or if you really, really want camelCase go with that everywhere?

AtiyahElsheikh commented 2 years ago

The source of mixture is because only recently I started to see that it makes sense to follow Agents.jl coding style. However, since both of us are comfortable with camelCase, then I would keep it this way, i.e doDeaths, removeDead! etc..

The proposed solution is that, whenever one sees underscore, e.g. kill_agents(*), one precieve it as a function coming from external package. I would then attempt to put the following comment into such code:

....
kill_agents(*)      #  from Agents.jl
.... 
mhinsch commented 2 years ago

My preference is: Julia/agents.jl style > camelCase everywhere > style dependent on external/internal

But that's not a hill I'm going to die on, so if you strongly prefer style dependent on external/internal then let's do that.

AtiyahElsheikh commented 2 years ago

I don't have control over Agents.jl If there are easy solutions, I am open for it.