Skip to content

Commit 4ec3c45

Browse files
Anduin2017mairaw
authored andcommitted
Update example code, prevent naming with numbers. (#11603)
Update the example code and rename `Class1` to `MyClass`. For some programmers may learn from that and add `Class2` and `Class3` which makes their code less maintainable.
1 parent c3bdff3 commit 4ec3c45

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/core/tutorials/with-visual-studio-code.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,14 @@ You can also watch a short video tutorial for further setup help on [Windows](ht
8585
## Add a class
8686

8787
1. To add a new class right-click in the VSCode Explorer and select **New File**. This adds a new file to the folder you have open in VSCode.
88-
2. Name your file `Class1.cs`. You must save it with a `.cs` extension at the end for it to be recognized as a csharp file.
88+
2. Name your file `MyClass.cs`. You must save it with a `.cs` extension at the end for it to be recognized as a csharp file.
8989
3. Add the code below to create your first class. Make sure to include the correct namespace so you can reference it from your `Program.cs` file.
9090
``` csharp
9191
using System;
9292

9393
namespace HelloWorld
9494
{
95-
public class Class1
95+
public class MyClass
9696
{
9797
public string ReturnMessage()
9898
{
@@ -113,7 +113,7 @@ namespace HelloWorld
113113
{
114114
static void Main(string[] args)
115115
{
116-
Class1 c1 = new Class1();
116+
MyClass c1 = new MyClass();
117117
Console.WriteLine($"Hello World! {c1.ReturnMessage()}");
118118
}
119119
}

0 commit comments

Comments
 (0)