Feedback on IsDefault and Default members
See original GitHub issueThere was PR https://github.com/AvaloniaUI/Avalonia/pull/9590 changing member names IsDefault
and Default
instead of IsEmpty
and Empty
. While old names using Empty
can be used for area types like Rect
they were much better than the current ones for a few reasons:
- There’s
default
keyword not requiring any methods to be added, i.e. use== default
oris default
. - New names provide no sematic meaning. What is
Default
for the current case?
So I suggest to go back to Empty
/IsEmpty
or use Zero
/IsZero
instead. The last one is applicable to any numeric type, including vectors and in addition to that it’s a way forward to generic math even if it’s impossible to implement INumberBase<TSelf>
for some types like Rect
and Point
(vector types can support generic math, by the way).
Issue Analytics
- State:
- Created 7 months ago
- Reactions:3
- Comments:35 (29 by maintainers)
Top Results From Across the Web
Feedback on IsDefault and Default members · Issue #10264
There was PR #9590 changing member names IsDefault and Default instead of IsEmpty and Empty. While old names using Empty can be used...
Read more >Button.IsDefaulted Property (System.Windows.Controls)
Gets a value that indicates whether a Button is the button that is activated when a user presses ENTER.
Read more >Button.IsDefault Property (System.Windows.Controls)
Gets or sets a value that indicates whether a Button is the default button. A user invokes the default button by pressing the...
Read more >Is default initializing class members always advisable?
To follow the advice, I have to explicitly initialize bar (e.g. int bar{}; ). But what if I always initialize the member by...
Read more >What is default visibility for properties/methods in ...
Members or properties which have “protected” visibility are accessible only in their class or their subclasses. In this example, the protected ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Point, Size, Rect - remove Empty/Default. In the future we can add Zero to support INumeric APIs from .NET 7. It’s a good idea in general, but isn’t useful before we implement these interfaces. Which won’t happen in 11.0.
CornerRadius, Thickness - wpf doesn’t have anything for these, I wouldn’t add anything as well. Developers should use c# “default”.
Color, Rect - remove Empty/Default as it’s not consistent by behavior with WPF and Avalonia.
FontFamily - keep Default. Remove/make internal IsDefault (as suggested by @Gillibald).
Everything else (from original PR including boxshadow) - just use “default” C#, remove Empty/Default.
Discussed internally, and hopefully had an agreement.
@MikeCodesDotNet @maxkatz6 Can this be added to 11.0 milestone? It needs to be resolved one way or another before API release and it’s on my todo list.
Either:
Of course I’ll get to it myself but it will be a week or so and you’ll have to accept the PR.