HybridArrays.jl icon indicating copy to clipboard operation
HybridArrays.jl copied to clipboard

Reduce type clutter

Open plut opened this issue 4 years ago • 1 comments

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).

plut avatar Jan 12 '21 21:01 plut

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

mateuszbaran avatar Jan 13 '21 08:01 mateuszbaran