timjs / elm-collage

Create interactive vector graphics and position them relative to each other
BSD 3-Clause "New" or "Revised" License
58 stars 19 forks source link

API/Naming Suggestions #4

Open Kwarrtz opened 6 years ago

Kwarrtz commented 6 years ago

Hi @timjs ,

Overall, I think you've done a great with the library. The Layout module seems especially useful, though your decision to use rectangular envelopes is slightly troubling. It seems counterintuitive, for instance, that if I try to anchor something to the right of a circle it will lie directly on the edge of said circle, but if I try to anchor something to the top-right of it it will lie a bit above of it. There are also a few things about the Layout API that are still unclear to me from the documentation. The first is about the operation of the anchors. In particular, if I anchor a circle to the top-right hand corner of the square, will it be the bottom-left hand corner or the center of the circle that gets anchored? The second is what happens to the envelope when you rotate a collage. Does the envelope keep the same dimensions but rotate with the collage? Or do the dimensions change?

That aside, after looking through the documentation I have a few questions and suggestions regarding the naming and API. All of these suggestions are matters of taste and preference, not function, so feel free to implement or ignore them at your discretion. Further, if there is a specific reason that you have done things the way you have that you think I'm missing, please feel free to say so. That said, here are a few of the things I would change about the API:

As I said before, if you have questions about any of these suggestions or I've missed something as to why you did things the way you did, please say so. Otherwise, I hope this feedback is useful the next time you look at making changes to your API.

timjs commented 6 years ago

Hi @Kwarrtz,

Thanks a lot for your ideas and suggestions! Below I hope to explain some of the decisions and start some discussion on how to improve things. Feel free to comment. Maybe we'll have to open separate issues for some of them, to not mix up different discussions. This post is already way to long, but here we go!

Kwarrtz commented 6 years ago

Thanks for the point by point breakdown. Most of my qualms you've either adequately explained or opened an issue for. The only point I still find unsatisfactory is traced, rendered and styled. I understand your desire to use names which reflect the idea that the forms are being "finalized" as collages, so the names I suggested may not be preferable. And on balance, traced seems reasonably named, especially considering the precedent from Elm Graphics you mentioned. However, I would still strongly recommend reconsidering the names of rendered and styled. Both of these names are far more general than their usage implies, since lines can be styled and shapes can be rendered. This ambiguity could, I think, easily lead to a great deal of confusion for one first learning the library. I don't know what names you would want to use in their place, but I would at least try to think of alternatives for these two functions.

timjs commented 6 years ago

Yeah, you’re right about the generality of rendered and styled. How about printed for text and depicted for shapes? Drawn, painted and formed for shapes also seem to general to me and typesetted, which would be ideal for text, doesn’t seem to be correct English.

On 18 Oct 2017, 05:26 +0200, Dathan Ault-McCoy notifications@github.com, wrote:

Thanks for the point by point breakdown. Most of my qualms you've either adequately explained or opened an issue for. The only point I still find unsatisfactory is traced, rendered and styled. I understand your desire to use names which reflect the idea that the forms are being "finalized" as collages, so the names I suggested may not be preferable. And on balance, traced seems reasonably named, especially considering the precedent from Elm Graphics you mentioned. However, I would still strongly recommend reconsidering the names of rendered and styled. Both of these names are far more general than their usage implies, since lines can be styled and shapes can be rendered. This ambiguity could, I think, easily lead to a great deal of confusion for one first learning the library. I don't know what names you would want to use in their place, but I would at least try to think of alternatives for these two functions. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

Kwarrtz commented 6 years ago

I believe "typeset" would be the proper conjugation, but that leaves ambiguity about whether it's being used as an adjective or an imperative. Using that word here seems a bit oblique to me anyway. I prefer "printed". As for the shape function, "depicted" seems both too general and too tenuous, but I'm having trouble thinking of better options.