Skip to content

The first lesson for the Ninjas taking the path of C#. This will teach the kids the basics of a strongly typed language.

Notifications You must be signed in to change notification settings

megadojo/HelloWorldCSharp

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

8 Commits
ย 
ย 

Repository files navigation

๐Ÿš€ C# Hello World Project

Lesson Snapshot

Build your first C# program that shows welcome messages on the screen. (Ages 8-18)

Folder & File Map

HelloCoderDojo/
โ”œโ”€โ”€ .git/
โ”œโ”€โ”€ HelloCoderDojo.csproj
โ””โ”€โ”€ Program.cs

Step-by-Step Build Guide

1. Fork and Clone the Repository โœ…

  • What to do: Go to https://github.com/PhillyCoderDojo/HelloWorldCSharp โ†’ Click "Fork" button in top right โ†’ Then open GitHub Desktop โ†’ Click "Clone a repository from the Internet" โ†’ Select your fork โ†’ Choose a location on your computer โ†’ Click "Clone"
  • Where we're working: Making your own copy of our starter project, like getting your own LEGO set that matches the teacher's
  • Code snippet: None
  • Why it matters: This gives you your own version of the project to change without affecting the original, just like saving a game to your own memory card
  • Git command: git clone https://github.com/YOUR-USERNAME/HelloWorldCSharp.git
  • Documentation Link
  • ๐Ÿ“ธ SCREENSHOT: image

image

2. Open Repository Folder โœ…

  • What to do: Find and open the folder you just created for your repository
  • Where we're working: Looking inside your new project home
  • Code snippet: None
  • Why it matters: We need to see where our code will live
  • Git command: cd HelloCoderDojo
  • ๐Ÿ“ธ SCREENSHOT: image

3. Launch JetBrains Rider โœ…

  • What to do: Find Rider in your Start Menu/Applications folder and open it
  • Where we're working: Starting up our coding tool
  • Code snippet: None
  • Why it matters: We need our coding workshop to start building
  • Git command: None
  • ๐Ÿ“ธ SCREENSHOT: image

4. Create New Project โœ…

  • What to do: Click "New Solution" on the welcome screen
  • Where we're working: Setting up our coding project
  • Code snippet: None
  • Why it matters: This is like starting a new LEGO set with instructions
  • Git command: None
  • ๐Ÿ“ธ SCREENSHOT: image

5. Set Up Console App โœ…

  • What to do: Select "Console Application" โ†’ Name it "HelloCoderDojo" โ†’ Choose your repository folder as location โ†’ Select .NET 8.0 โ†’ Click Create
  • Where we're working: Creating the blueprint for your program
  • Code snippet: None
  • Why it matters: Tells the computer what kind of program we're making
  • Git command: None
  • ๐Ÿ“ธ SCREENSHOT: image

6. Create a .gitignore File โœ…

  • What to do: In your project folder, create a new file named ".gitignore"
  • Where we're working: Making a special list that tells Git which files to ignore
  • Code snippet:
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Bb]in/
[Oo]bj/
[Ll]og/
[Ll]ogs/

# Visual Studio / Rider files
.vs/
.idea/
*.suo
*.user
*.userosscache
*.sln.docstates
*.userprefs

# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/

# NuGet Packages
*.nupkg
*.snupkg
**/[Pp]ackages/*
!**/[Pp]ackages/build/

# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*

# Files built by Visual Studio
*_i.c
*_p.c
*_h.h
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
  • Why it matters: Keeps your project clean by not tracking files that your computer creates automatically
  • Git command: None yet
  • ๐Ÿ“ธ SCREENSHOT: image image

7. First Commit โœ…

  • What to do: Go back to GitHub Desktop โ†’ Review changes โ†’ Enter "Initial project setup" as commit message โ†’ Click "Commit to main"
  • Where we're working: Saving your project's starting point
  • Code snippet: None
  • Why it matters: Like taking a snapshot of your LEGO creation so far
  • Git command: git add . && git commit -m "Initial project setup"
  • ๐Ÿ“ธ SCREENSHOT: image

8. Explore Your Project โœ…

  • What to do: In Rider, look at Solution Explorer (usually on the left side)
  • Where we're working: Looking at all the pieces of your project
  • Code snippet: None
  • Why it matters: Finding all the parts we need to build with
  • Git command: None
  • ๐Ÿ“ธ SCREENSHOT: image

9. Find Program.cs โœ…

  • What to do: Double-click on Program.cs in Solution Explorer
  • Where we're working: Opening the main file where we'll write our code
  • Code snippet: None
  • Why it matters: This is your blank canvas for writing instructions
  • Git command: None
  • ๐Ÿ“ธ SCREENSHOT: image

10. Write Welcome Messages โœ…

  • What to do: Delete any existing code and type these three lines
  • Where we're working: Writing in the Program.cs file
  • Code snippet:
Console.WriteLine("Hello, Philly CoderDojo!");
Console.WriteLine("Welcome to C# programming!");
Console.WriteLine("Today is Saturday, June 14, 2025");
  • Why it matters: Telling the computer what words to show on screen
  • Git command: None yet
  • ๐Ÿ“ธ SCREENSHOT: image

11. Run Your Program โ–ถ๏ธ

  • What to do: Click the green โ–ถ๏ธ button at the top or press Ctrl+F5
  • Where we're working: Testing your program to see if it works
  • Code snippet: None
  • Why it matters: See your program come to life!
  • Git command: None
  • ๐Ÿ“ธ SCREENSHOT: image

12. Commit Your Changes โœ…

  • What to do: Go to GitHub Desktop โ†’ Review changes โ†’ Enter "Add welcome messages" as commit message โ†’ Click "Commit to main"
  • Where we're working: Saving your progress in the magical notebook
  • Code snippet: None
  • Why it matters: Taking another snapshot of your work
  • Git command: git add Program.cs && git commit -m "Add welcome messages"
  • ๐Ÿ“ธ SCREENSHOT: image image

13. Make It Personal โœ…

  • What to do: Change the messages to include your information
  • Where we're working: Changing the words in Program.cs
  • Code snippet:
Console.WriteLine("Hello, my name is [YOUR NAME]");
Console.WriteLine("I am [AGE] years old");
Console.WriteLine("I want to learn programming because [REASON]");
  • Why it matters: Making the computer say things about YOU
  • Git command: None yet
  • ๐Ÿ“ธ SCREENSHOT: image

14. Run Again โ–ถ๏ธ

  • What to do: Click the green โ–ถ๏ธ button again to see your changes
  • Where we're working: Testing your personalized program
  • Code snippet: None
  • Why it matters: Making sure your changes worked correctly
  • Git command: None
  • ๐Ÿ“ธ SCREENSHOT: image

15. Commit Personal Changes โœ…

  • What to do: Go to GitHub Desktop โ†’ Review changes โ†’ Enter "Add personal information" as commit message โ†’ Click "Commit to main"
  • Where we're working: Saving your personalized version
  • Code snippet: None
  • Why it matters: Taking a snapshot of your customized program
  • Git command: git add Program.cs && git commit -m "Add personal information"
  • ๐Ÿ“ธ SCREENSHOT: image

16. Push to GitHub โœ…

  • What to do: In GitHub Desktop, click "Push origin" to upload all your commits
  • Where we're working: Sending your project to the internet cloud
  • Code snippet: None
  • Why it matters: Backing up your code so it's safe forever
  • Git command: git push origin main
  • ๐Ÿ“ธ SCREENSHOT: image

Run & Test โ–ถ๏ธ

  • Click the green โ–ถ๏ธ button in Rider or press Ctrl+F5
  • You should see your messages appear in the console window
  • Common Error: If you see red underlines, check for missing semicolons (;) at the end of each line
  • ๐Ÿ“ธ SCREENSHOT: image image

Bonus Challenge ๐Ÿ”ฅ

Make your program ask for the user's name and say hello to them!

Hint:

Console.Write("What is your name? ");
string name = Console.ReadLine();
Console.WriteLine($"Hello, {name}!");
  • ๐Ÿ“ธ SCREENSHOT: image

  • Git command: git add Program.cs && git commit -m "Add interactive name prompt"

About

The first lesson for the Ninjas taking the path of C#. This will teach the kids the basics of a strongly typed language.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published