Skip to content

Conversation

Octanoz
Copy link

@Octanoz Octanoz commented Jul 29, 2025

Pretty much what the title says:

//original
var names = new List<string> { "Sophia", "Rob", "Michelle" };

//updated
List<string> names = [ "Sophia", "Rob", "Michelle" ];

//original
for (var i = 0; i < words.Length; i++)

//updated
for (int i = 0; i < words.Length; i++)

From notebook 10 onwards, in the C# 101 section, suddenly everything is instantiated with var. In my opinion, if you're going to do that, at least dedicate a section to explain the possibility to do that because it just seems to come out of nowhere and feels like a different person wrote those sections compared to the previous ones. I changed a few to explicitly typed where I thought it would be important for a beginner to know what they're looking at but I have left most as they were since it's a judgment call or style preference what is "correct" there.

…ions. Replaced var on some variables in favour of explicitly typed variable types.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant