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

Reduce type clutter #38

Open
plut opened this issue Jan 12, 2021 · 1 comment
Open

Reduce type clutter #38

plut opened this issue Jan 12, 2021 · 1 comment

Comments

@plut
Copy link

plut commented Jan 12, 2021

Who doesn't love StaticArrays.Dynamic() all over the place? However, this makes exceptions a bit hard to read, and also types a bit hard to enter.

As an alternative, I suggest using one of the two following names for I/O instead: - or :. (These names may either be used internally and converted to Dynamic() only when Size() is called; or Dynamic might be used internally, and show for types overloaded instead. Both approaches are quite similar. I believe the first one is less fragile though; I've been quite burnt with overloads of show).

: : pros: it already means a full dimension, so it feels like the natural choice. cons: it is displayed as Colon(), which is still somewhat cluttery.

-: pros: it maximally reduces the type clutter since Tuple{-,2} is displayed as just that. Also, - is already usual mathematician-speak for “left unspecified”. cons: feels slightly a bit less usual than : in Julia.

(My preference would go to - for these reasons).

@mateuszbaran
Copy link
Collaborator

Yes, StaticArrays.Dynamic() is quite unfortunate. I'll think about this.

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

No branches or pull requests

2 participants