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

Naming of classes line, circle, polygon, etc. #52

Open
tobydriscoll opened this issue Dec 23, 2014 · 5 comments
Open

Naming of classes line, circle, polygon, etc. #52

tobydriscoll opened this issue Dec 23, 2014 · 5 comments
Labels

Comments

@tobydriscoll
Copy link
Member

There is some reason for caution when it comes to the classes line, circle, disk, polygon, and ellipse, namely that these are very common and generic names that easily clash with user choices. The options I see are:

  1. Ignore the problem. Except that you really can't with line, because that's a built-in.
  2. Put closedcurve and region classes in the +cmt naming scheme.
  3. Prefix these class names with a "z" (as in complex).

My approach in the early version was to use number 3 with the line class only, and leave the others naked.

@ehkropf
Copy link
Collaborator

ehkropf commented Jan 3, 2015

I think we should use a combination of 1 and 3. Since line is a not-uncommonly used graphics built-in, sticking with zline make more sense.

On the other hand, given someone is using the toolkit, classes like disk, polygon, and ellipse make sense to have handy. Simpler names are better from a user perspective, and if someone is using this toolkit they either will not have these geometric primitives or if they do will probably have enough knowledge to be able to work around the names without bother.

I think we should leave the cmt namespace for things used mainly internally by the toolkit itself. Again, for user simplicity, common classes should be as exposed as possible. (At least for a matlab implementation. If we were doing this in another language, e.g. Python, my argument would be completely different.)

@tobydriscoll
Copy link
Member Author

I don't know...I'm getting less happy as I go. I'm up to zline, zgrid, zrectangle, and zbox so far. Ugly. I suppose there's option

3a. Prefix everything with 'cmt' or just 'cm'.

@ehkropf
Copy link
Collaborator

ehkropf commented Jan 8, 2015

Ugh, I see, matlab toolbox function name clashes.

I hesitate to use the 'cm' prefix, but I guess it's no worse than 'z'. Other than 'z' indicates a "complex number" version, or something special, but then why not do all of the basic boundary/region classes like this? Having said that, 'cm' also denotes something special, but then its between cmline and zline. How do we feel about the following on the command line:

cmrectangle
cmgrid
cmbox

I could live with these. But then do we also prefix map class names? If not, why would they be special?

But the alternative, putting disk, polygon, ellipse and friends in the cmt namespace seems worse. Because then why don't we put map names in the same namespace? (I have no good solution here yet, just thinking out loud.)

@tobydriscoll
Copy link
Member Author

No resolution yet, but the cmt. namespace is probably just too clunky to contemplate.

Here's a kind of logic. Geometric objects, which could be 2D real or complex, will all get the z prefix. Nothing else needs it. (?)

@ehkropf
Copy link
Collaborator

ehkropf commented Jan 12, 2015

I can buy into that scheme. The consistency it applies to geometric objects makes sense.

Though are we classing only closed curves as 2d objects or do region objets fall into this category as well? We have disk as a region, which would then be zdisk. But we also have circleRegion. Should it then be zCircleRegion?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants