-
Notifications
You must be signed in to change notification settings - Fork 181
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
Add syntax option to be more grammatically correct #1591
Comments
Hi @RexTremendae, Thanks for the suggestion. To be honest I'm a little torn on this... One one hand, it's true that it would be more correct grammatically. On the other, I don't like the idea of having another class that does exactly the same thing. I think the idea came up before, but I can't find the issue if it exists. @blairconrad what do you think? |
using An = FakeItEasy.A;
Scratch that. You can't make a generic alias (which is a shame; vote on this issue to change it!) |
Indeed, thanks for the suggestion. As @thomaslevesque says, I'm sure this
has come up before. We've always been torn. And always decided to leave the
syntax as is, keeping the single entry point. I think it's the better
choice.
M. Levesque, your suggestion is excellent. Shall we create an issue to find
a spot in the docs and add it as an official recommendation? I'm travelling
and working from phone, so if you don't mind doing it, I would appreciate.
Or I can fumble something out.
…On Fri, Jun 7, 2019, 03:47 Thomas Levesque, ***@***.***> wrote:
Hi @RexTremendae <https://github.com/RexTremendae>,
Thanks for the suggestion. To be honest I'm a little torn on this... One
one hand, it's true that it would be more correct grammatically. On the
other, I don't like the idea of having another class that does exactly the
same thing.
I *think* the idea came up before, but I can't find the issue if it
exists.
@blairconrad <https://github.com/blairconrad> what do you think?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1591?email_source=notifications&email_token=AAY7YFM4HFAI2YYK5QXVBULPZIVCBA5CNFSM4HVIBQWKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXFLVVI#issuecomment-499825365>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAY7YFKZRE7ZYLM7YTMIBNDPZIVCBANCNFSM4HVIBQWA>
.
|
Looks like you answered by mail, so you didn't see my edit. This suggestion doesn't actually work, because you can't make a generic alias, unfortunately. |
Too bad. In that case, how about creating a tiny tiny class that delegates to A? |
I assume you mean in user code, not in FakeItEasy? In that case: 👍 @RexTremendae if you need this, here's the code: public static class An<T>
{
public static INegatableArgumentConstraintManager<T> That => A<T>.That;
public static T _ => A<T>._;
public static T Ignored => A<T>.Ignored
} |
@thomaslevesque thanks for the input. But I still don't really understand what would be the harm adding it to FakeItEasy? From a user perspective I would really like to use this feature out-of-the-box without having to add it in the client code. |
There would be no harm, but that's not enough for a feature to be considered useful. In this case, very few people actually want this feature, and there's an easy workaround if you want it. So we'd rather not add clutter to the API surface for very little added value. |
My understanding of this library is that it should be possible to write code that can be read almost like natural language, i.e.
A<string>...
can be read as "A string..." etc.Writing
A<int>...
would read "A int..." which is grammatically incorrect. It should read "An int" in natural language.Suggestion: Add an
An
class which can be used totally interchangeable with theA
class.The text was updated successfully, but these errors were encountered: