Drasil icon indicating copy to clipboard operation
Drasil copied to clipboard

What is our “naming” code style?

Open balacij opened this issue 1 year ago • 5 comments

As the title suggests, what is our “naming” code style?

Right now we seem to have a mix of long/full and abbreviations used for name references. Should we prefer one way over the other? Can we make a hybrid with type aliases?

(the code style does touch upon this)

balacij avatar Apr 06 '23 03:04 balacij

Which code? Our own Haskell code, or our generated code?

JacquesCarette avatar May 01 '23 20:05 JacquesCarette

I think we should have a naming style for both our Haskell code and our generated code. For the generated code it would be great if we could change the naming conventions by selecting a different generator directive.

smiths avatar May 01 '23 21:05 smiths

This ticket was primarily about our Haskell code, but I like @smiths' idea of extending it to the generated code too!

Regarding the Haskell code, we have makeX, mkX, aThingsFullName, aThngsShrtNm, aThingsShrtNm', and similar, so it would be nice to have a codestyle guideline. The apostrophes carry very little information, but sometimes we annotate with AThngsShrtNmWoutRefs instead (better, in my opinion).

balacij avatar May 04 '23 02:05 balacij

I agree that the apostrophes are bad. And that using both makeX and mkX is bad.

I am a big fan of short names for heavily used things. Normal functions should have reasonably descriptive names. But I find names in some ecosystems (Java comes to mind) ridiculously long. Certainly the package/module where something comes from shouldn't be repeated in a name.

I kind of feel like we should tackle this a little bit piecemeal for now. At least we should fix the glaring inconsistencies!

JacquesCarette avatar May 04 '23 16:05 JacquesCarette

Sounds good, thank you. I'll break up this ticket this weekend into anything I can remember, but otherwise, we can just remember to clean things up as we go along, as I think you're suggesting.

balacij avatar May 26 '23 02:05 balacij