Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename chunks named in the form "XChunk" as just "X" #3244

Open
balacij opened this issue Jan 24, 2023 · 11 comments
Open

Rename chunks named in the form "XChunk" as just "X" #3244

balacij opened this issue Jan 24, 2023 · 11 comments
Assignees
Labels
newcomers Good first issue to work on!

Comments

@balacij
Copy link
Collaborator

balacij commented Jan 24, 2023

In #3017, we established that we will continue to use the name "Chunk" to refer to information Drasil works with. If we think of "chunks" as instances of our Haskell types (which is how we build them in Drasil), then we also have "chunk types" (or categories/classifications/etc). I believe we also have an assumption that all data types we build are chunks too. So, it feels redundant when we have chunks (such as those listed below) with "Chunk" in their type's name. Should we rename these chunks?

rg "data [a-zA-Z]+Chunk "

drasil-lang/lib/Language/Drasil/Chunk/NamedIdea.hs
40:data NamedChunk = NC {

drasil-lang/lib/Language/Drasil/Chunk/Unital.hs
30:data UnitalChunk = UC { _defq' :: DefinedQuantityDict

drasil-lang/lib/Language/Drasil/Chunk/UncertainQuantity.hs
33:data UncertainChunk  = UCh { _conc :: ConstrainedChunk , _unc' :: Uncertainty }

drasil-lang/lib/Language/Drasil/Chunk/Constrained.hs
36:data ConstrainedChunk = ConstrainedChunk { _qd     :: QuantityDict

drasil-lang/lib/Language/Drasil/Chunk/Unitary.hs
29:data UnitaryChunk = UC { _quant :: QuantityDict

drasil-lang/lib/Language/Drasil/Chunk/Concept/Core.hs
32:data ConceptChunk = ConDict { _idea :: IdeaDict -- ^ Contains the idea of the concept.

drasil-code-base/lib/Language/Drasil/Chunk/CodeBase.hs
43:data CodeChunk = CodeC { _qc  :: QuantityDict
67:data CodeVarChunk = CodeVC {_ccv :: CodeChunk,

drasil-code/lib/Language/Drasil/Chunk/Parameter.hs
15:data ParameterChunk = PC {_pcc :: CodeChunk

(Not assigning anyone, but pinging @smiths and @JacquesCarette in particular.)

@peter-michalski
Copy link
Collaborator

peter-michalski commented Jan 24, 2023

My initial concern is about readability. Especially pertaining to at least some of the chunks if the chunk descriptor is removed.

@balacij
Copy link
Collaborator Author

balacij commented Jan 24, 2023

Readability might be an issue for some of them, but they might just need to be renamed to something else that better describes them (“NamedChunk” in particular).

Keeping “Chunks” in the suffix seems odd, it feels akin to adding “Type” to the end of each type name in any typed language -- we should know it's a type/chunk by its definition.

@peter-michalski
Copy link
Collaborator

they might just need to be renamed to something else that better describes them

I agree with this.

@JacquesCarette
Copy link
Owner

Yes, it is redundant to have 'Chunk' in those names, and they should be renamed. Most of them should just have the Chunk part deleted. Some need renamed (Constrained stands out to me as one such - not because the word 'Constrained' is bad, but because it is an adjective while chunk descriptors should be nouns).

Roughly speaking, HasUID is a pretty good predicate for spotting when a structure is a chunk or not.

@balacij balacij self-assigned this Jan 26, 2023
@balacij balacij added newcomers Good first issue to work on! and removed question labels Feb 14, 2024
@balacij balacij changed the title Is it redundant to have "Chunk" in the suffix of a chunk type name? Rename chunks named in the form "XChunk" as just "X" Feb 14, 2024
@balacij balacij removed the newcomers Good first issue to work on! label Feb 14, 2024
@samm82
Copy link
Collaborator

samm82 commented Mar 2, 2024

What's the rationale for removing the newcomers label from this issue? I feel like a newcomer could take a look and at least propose some new names? Just happened upon it looking for something else and was curious lol

@balacij
Copy link
Collaborator Author

balacij commented Apr 1, 2024

Hmm, I think that might have been an accident. If no, then I don't remember what my rationale was. Thanks @samm82 !

@balacij balacij added the newcomers Good first issue to work on! label Apr 1, 2024
@NoahCardoso
Copy link
Collaborator

I have some ideas for better names.
Change ParameterChunk with Param since Parameter is already used.
Remove the Chunk off of CodeVarChunk and CodeChunk, I feel these are the most suitable names for both.
Jason mentioned that ExplainedIdea would be a good fit for ConceptChunk which makes sense as a concept in this case is the same as an explained idea.
I feel that ConstrainedValue is good for ConstrainedChunk more than ConstrainedQuanity as a string is a value not a quantity.
Change UnitalChunk with UnitDefinedQuantity as they are concepts with quantities that must have a unit definition.
Change UnitaryChunk with QuantifiedUnit as A Unitary is a quantity that must have a unit.

@samm82
Copy link
Collaborator

samm82 commented May 10, 2024

Knowing the relationship between these chunk types would help inform this discussion: for example, if ConstrainedChunk builds off of ConceptChunk, then perhaps ConstrainedIdea would be a more consistent/descriptive name.

Similar to this comment, I don't think UnitaryChunk should be described as a QuantifiedUnit. Slightly related: what is the difference between having a "unit" and having a "unit definition" (i.e., what is the difference between UnitalChunk and UnitaryChunk)?

@NoahCardoso
Copy link
Collaborator

@samm82 since all the Chunks are built from IdeaDict would it be more fitting to just replace Chunk with Idea? Except for ConceptChunk which I think would make sense to change with ExplainedIdea.
image

@samm82
Copy link
Collaborator

samm82 commented May 10, 2024

That's definitely an idea (pun unintended) 🤔 I personally think there is a distinction between a pure "idea" and a "quantity" (as I think you've alluded to before) that we could also investigate, but I personally would be hesitant to say that a given renaming is "right" without some more discussion about its design implications/how it changes how we think about these chunks and how they're built 😅

@smiths
Copy link
Collaborator

smiths commented May 10, 2024

I've added this issue to our agenda for Monday (#3730) under the topic of the redesign of chunks and attributes. @NoahCardoso for the meeting it would be great if you could have your best guess for the renaming. I'm optimistic that we'll be able to make some decisions as a group that are difficult to make over the issue tracker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
newcomers Good first issue to work on!
Projects
None yet
Development

No branches or pull requests

6 participants