434457 (10) [Avatar] Offline
#1
Hi Jon,

See below for my notes on Chapter 7 - a lot less issues and less to question - much more readable.

Cheers,
Will


p1.

If string isn’t the first .NET data type you learned about, it’s probably the second.


string should be in fixed-width font.

p1.
Just like the features we saw in chapter 6, string interpolation doesn’t allow you to do anything you couldn’t do before – it just allows you to do it more readably and concisely.


Chapter 6 should be capitalized.

p1.

So far, so teaching-grandma-to-suck-eggs.


Should be

So far, teaching-grandma-to-suck-eggs.



p2.

* Figure 7.1 shows all the parts of a composite format string you could use to display a price. ?


this sentence is superfluous as the figure title says almost exactly the same thing

p2.

* The output – on a machine in the US English culture – would look like this: ?


I was slightly confused by this sentence, thought you were talking about a cash register and the culture of tipping in those countries! There’s also locale and code page such that it could be reworded like so:

The output on a machine using the US/English locale code page would look like this:

There’s more explanation about culture below this paragraph so this may not be as relevant.

p3.

That wouldn’t work though, because args is a parameter array (it uses the params modifier).


If justifying that provider can’t go after args due to a params keyword, it might help to explain why and how it works as a list of arguments on the method call and that nothing can come after it.

p4.

Quite what that means will depends on your context:


should be:

Quite what that means will depend on your context:


p4.

For example, suppose you had were using a web service to fetch the list of best sellers from a publisher.


should be (2 issues - had, the):

For example, suppose you were using a web service to fetch a list of best sellers from a publisher.


p6.

Verbatim string literals can be interpolated as well – you just put a $ in front of them, just like you would to interpolate a regular string literal.


Maybe rewrite to show the $ and @ in the same sentence as it will click with the reader a bit more - developers are very visual people. e.g.

Verbatim string literals can be interpolated as well – you just put a $ in front of the @, just like you would to interpolate a regular string literal.


A possible simple nemonic: dat not ass - dollar-at, not at-s(dollar symbol). lol (maybe don't use this)

p9.

All four approaches give exactly the same result, but I’ve shown all of them to demonstrate multiple the language features work together to give a really clean final option.


should be:

All four approaches give exactly the same result, but I’ve shown all of them to demonstrate how the multiple language features work together to give a really clean final option.

p18.

I’m not going to claim that the examples here are the only sensible of nameof – they’re just the ones I’ve come across most often.

should be:

I’m not going to claim that the examples here are the only sensible uses of nameof – they’re just the ones I’ve come across most often.


p19.


As we saw in section X.XX, CallerMemberNameAttribute makes it very easy to raise events in INotifyPropertyChanged implementations when the property itself changes...


the section is not specified and CallerMemberNameAttribute is not otherwise used in this chapter

p21.

It doesn’t matter how you call the method: Method<Guid>() or Method<Button>() will both just return "T".


maybe an explanation of that (what I assume) nameof is based on the names determined at compile-time and not at runtime.
jon.skeet (465) [Avatar] Offline
#2
Now addressed the issues where I agree. (I won't go into the few where I've chosen not to.)

Just as a general rule, if I've put something like "section X.XX" that refers to something where I don't know the number yet (usually in a chapter I haven't written yet, or where I know it's about to move.)
434457 (10) [Avatar] Offline
#3
Ah, that makes sense about the sections. Thanks for the update on this. (I didn't expect all of them to be implemented). Good to hear it was somewhat useful. And congratulations on your 1,000,000 reputation on Stack Overflow! smilie
Sergii Volchkov (1) [Avatar] Offline
#4
On mnemonic to remember the order of symbols in interpolated verbatim string literals.

At least on US English keyboard, you type "$@" as Shift + 42, with 42 being, of course, the answer to the Ultimate Question of Life, the Universe, and Everything smilie
434457 (10) [Avatar] Offline
#5
Nice one! That's much better that the one I came up with! smilie