From 9f16487a200b52c0d5c0837af885180c4324d3af Mon Sep 17 00:00:00 2001 From: Anna Date: Fri, 12 Dec 2025 05:01:16 -0500 Subject: [PATCH] fix(curriculum): use C# highlighting in static typing discussion (#63890) --- client/.babelrc.js | 3 +++ client/src/templates/Challenges/utils/index.ts | 6 +++++- .../672d264645e289208e562f10.md | 11 ++++++----- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/client/.babelrc.js b/client/.babelrc.js index 99b91a8617d..d51671bcca5 100644 --- a/client/.babelrc.js +++ b/client/.babelrc.js @@ -40,8 +40,11 @@ const config = { { languages: [ 'bash', + 'c', 'clike', + 'cpp', 'css', + 'csharp', 'html', 'javascript', 'json', diff --git a/client/src/templates/Challenges/utils/index.ts b/client/src/templates/Challenges/utils/index.ts index 843f4975914..d09423d6ec2 100644 --- a/client/src/templates/Challenges/utils/index.ts +++ b/client/src/templates/Challenges/utils/index.ts @@ -53,7 +53,11 @@ export function enhancePrismAccessibility( pug: 'pug', ts: 'TypeScript', typescript: 'TypeScript', - tsx: 'TSX' + tsx: 'TSX', + csharp: 'C#', + clike: 'CLike', + c: 'C', + cpp: 'C++' }; const parent = prismEnv?.element?.parentElement; if ( diff --git a/curriculum/challenges/english/blocks/lecture-working-with-data-types/672d264645e289208e562f10.md b/curriculum/challenges/english/blocks/lecture-working-with-data-types/672d264645e289208e562f10.md index 5bfa255b349..625a7f5d47a 100644 --- a/curriculum/challenges/english/blocks/lecture-working-with-data-types/672d264645e289208e562f10.md +++ b/curriculum/challenges/english/blocks/lecture-working-with-data-types/672d264645e289208e562f10.md @@ -20,15 +20,16 @@ In this example, we have a variable called `example` with the data type of strin The flexibility of dynamic typing makes JavaScript more forgiving and easy to work with for quick scripting, but it can also introduce bugs that may be harder to catch, especially as your program grows larger. -In statically typed languages like Java or C++, you must declare the data type of a variable when you create it, and that type cannot change. +In statically typed languages like C# or C++, you must declare the data type of a variable when you create it, and that type cannot +change. For instance, if you declare a variable as `integer`, you can only assign it integer values. If you try to assign it a different type, the program will throw an error. -Here's an example in Java language: +Here's an example in C# language: -```java -int value = 42; // value must always be an integer -value = "Hello"; // This would cause an error in Java +```csharp +int data = 42; // data must always be an integer +data = "Hello"; // This would cause an error in C# ``` The difference between dynamic typing and static typing lies in the flexibility vs. the safety of your code. Dynamically typed languages offer flexibility but at the cost of potential runtime errors.