I am going through the C# track to prepare for a game jam with Unity, and I thought the Cars, Assemble exercise is missing an explanation on casting.
It is not a big deal, as it can be found on StackExchange quite easily, but I can imagine that beginners can benefit from one or two sentences about (int) like a C-style cast or an explicit conversion via Convert.ToInt32.
The exercise depends on the numbers concept, which has:
C# has two types of numeric conversions:
1. Implicit conversions: no data will be lost and no additional syntax is required.
2. Explicit conversions: data could be lost and additional syntax in the form of a _cast_ is required.
I think so. Coming from C++ it is not a big difference for me, but newcomers might need a little more. Especially since the other exercises down the concept path make heavy use of casting like the interest exercise.
Maybe if we add a quick code example showing both conversions to that concept? That’d catch a student’s eye if they’re skimming like I’ve been doing on the C# syllabus. Personally, I take in the code examples first, then I read the nearby text, and then look at the code examples again.