3 ms·
In C# world they somehow manage to do it without all of this annotation oriented programming
by hardware2win 3y ago
In C# world they somehow manage to do it without all of this annotation oriented programming
- deleted 3y ago[deleted]
- rogerkeays 3y agoJust to make it clear, Fluent does not use any annotations.
- stanac 3y agoNot really. First argument (the object you are extending) needs to be marked with `this`, which is an annotation.
- hardware2win 3y agoEhh, ive been talking about whole lang and ecosystem But I agree about "this" being similar concept
- whizzter 3y agoThere are tons of annotations over the hood. The "this" that GP mentions is for for extension methods similar to the article to be regcognizeed as such (never done if the annotation isn't present), they're written such as: static int Foo( this Bar bar, int biz) => bar.xyz+biz; Bar bar = new Bar() { xyz=123; }; int result = bar.Foo(456); // Works even if Foo wasn't a part of Bar initially Elsewhere annotations(called attributes in C# land) can often be used in the same way as in Java to document serialization behaviour,etc. So in practice there aren't much differences apart from how library authors haven't embraced it entirely as much for automagic bindings (partly due to philosophy, partly due to other facilities being more appropriate).
- dtech 3y agoThere is a massive difference between a feature universally offered by the language and something only supported by using a specific library of compiler plugin...
- dtech 3y agoWhat a weird take. Parent obviously meant @X meta-programming annotations, not language syntax and keywords with a specific definition. The definition that includes it is so broad that it loses all meaning, it would make "private", "class" or "boolean" also annotations.
- depoll 3y agoIn .net world, the C# "this" syntax is itself just syntactic sugar over an annotation (attribute in .net parlance): https://learn.microsoft.com/en-us/dotnet/api/system.runtime.compilerservices.extensionattribute?view=net-7.0 https://learn.microsoft.com/en-us/dotnet/api/system.runtime....
- nh23423fefe 3y agoofftopic: why is this link a broken redirect in chrome but not firefox?
- ElectricalUnion 3y agoMy guess is that MSDN POs prioritize testing with Blink/Edge WebView2 over other engines.
- michaelcampbell 3y agoIsn't this just saying some languages do things others do not?
- hardware2win 3y agoNo, annotations are available in both, yet one community uses them more often
- michaelcampbell 3y agoSo, "some languages do this with annotations, others don't need it". My point stands. I mean it's fine to not like annotations or the decision to use them, but that another language does things differently is almost a tautology and hardly worthy of note. IMO, reasonable people will disagree.