This would cover the newer operators like ?? and ?. that work well when programming with reference types that may be null. I鈥檓 not sure I like the title yet.
Hi @BillWagner after the great PGI session I'd like to take a first shot at this. And this seems like a nice small one to get the hang of it. And it seems about time that this is picked up.. ;)
Ant pointers on this still being relevant and how to proceed?
Thanks for reaching out @jfversluis
I apologize for the late response, I was enjoying the holidays. 馃巹 馃嵕
Let's start with an outline (either as a comment here, or as a WIP labelled PR.)
I'd like readers to learn techniques for writing concise and clear code using ?? and ?. instead of a series of nested if / else statements. Beyond that, I haven't worked through organizing the topic yet.
No problem @BillWagner ! As you should! And a happy new year to you 馃帀
I'll see what I can do! Thanks!
@jfversluis Have you started working on this one ? Do you need any help ?
Hi @sputier I'm so sorry, this totally got away from me! But maybe we could have a little chat on tips and best practices if you have some experience?
Hi @jfversluis ! Of course, if I can help you, I will ! For this first contribution, I would only suggest you to keep things simple : explain everything thinking a beginner could read and understand what you wrote :-)
Feel free to ping me (here or on twitter : Same @) if you have any question. If I have the answer you need, I'll be glad to give it to you !
First idea for an outline below.
I don't think there is much more to it? Or am I missing anything?
@jfversluis If you don't omit comparing if syntax with each of these operators before introducing the samples, I think this outline will be a good start for the article. Feel free to update it if you notice anything that should be highlighted (language version ?).
If you feel a bit insecure about what you wrote, you can create a WIP (work in progress) PR (i.e. labeled "[WIP] ...."), so the community may help you reviewing it.
Since @jfversluis droped the ball, I'm going to take over from him to tackle this issue 馃槃
Hi @BillWagner !
This issue still makes sense? I saw an article about ?? operator and another about ? reference types null operator.
The idea is join both subjects or what?
@lucasnobredev It still makes sense.
We cover those features well in the reference. However, we don't have tutorials, or How To articles on using ??, ?. and ?[] to work with variables that may have the null value.
Closing this because of a new direction in the C# guide. We should create a new tutorial for handling nullability in modern versions of C#. The additions of:
all mean the correct tutorial is how to handle null values in your application.
It's not how to use a specific operator (which is handled well already in the C# language reference.
Closing, as the new plan is being created.