JuliaApproximation / DomainSets.jl

A Julia package for describing domains as continuous sets of elements
MIT License
72 stars 12 forks source link

Remove convenience functions (`disk`, `circle`, etc.) #29

Closed dlfivefifty closed 5 years ago

dlfivefifty commented 5 years ago

There are too many convenience functions, which goes against a good practice code design principle that there should only be one way to write anything (to make find-and-replace easier, etc.). I think all the lowercase convenience functions can be removed: UnitDisk is just as good as disk, etc.

dlfivefifty commented 5 years ago

Ah, I see, they are used because the domains are mapped domains.

dlfivefifty commented 5 years ago

Though I think my point is still correct: 2*UnitBall() is arguably clearer than ball(2).

daanhb commented 5 years ago

In the absence of a type that stores a centre and radius, it seemed user-friendly to provide a routine that would return a domain that represents what the user wants. They are lower-cased because you can't predict which type they return. Right now they are indeed mapped domains. How about ball(radius=2)? But I agree there shouldn't be too many of these.

dlfivefifty commented 5 years ago

I think 2UnitBall() is pretty user friendly

daanhb commented 5 years ago

I can live with that

dlfivefifty commented 5 years ago

Some will need to stay for now: e.g. ellipse