freeCodeCamp icon indicating copy to clipboard operation
freeCodeCamp copied to clipboard

fix(curriculum): use C# highlighting in static typing discussion

Open a2937 opened this issue 1 month ago • 7 comments

Checklist:

Closes #63811

In the example I replaced Java with C# since FreeCodeCamp taught C# at one point. Additionally I've added C and C++ because as far as I know, prism's C# rules might require those as rule dependencies.

a2937 avatar Nov 16 '25 23:11 a2937

I did not want to add all those just for one lesson, I think it's unnecessary bloating, previously it had js, but it was changed

the questions here use highlighting: https://www.freecodecamp.org/learn/foundational-c-sharp-with-microsoft/write-your-first-code-using-c-sharp/guided-project-calculate-and-print-student-grades

something should already be implemented somewhere

https://github.com/freeCodeCamp/freeCodeCamp/blob/aaec1b82b9c02568bdbaf0e95e5c150fecf9d360/curriculum/challenges/english/blocks/write-your-first-code-using-c-sharp/647e235a8acb466c97ccbf00.md#L25-L26

it says clike, where does it come from? if it's already implemented someway you may not need to do all this

majestic-owl448 avatar Nov 17 '25 08:11 majestic-owl448

About the page you linked, it doesn't look like it has the correct highlighting for int.

screenshot of C# lesson

a2937 avatar Nov 17 '25 14:11 a2937

then maybe we actually need the clike rules

majestic-owl448 avatar Nov 17 '25 15:11 majestic-owl448

CLike demo

That's just it. After testing, I don't think CLike actually has support for keywords like int.

https://prismjs.com/test#language=clike

a2937 avatar Nov 17 '25 16:11 a2937

then what is needed for the C# highlight? do the language for the codeblock needs to be replaced with csharp?

majestic-owl448 avatar Nov 17 '25 16:11 majestic-owl448

Ideally it should be csharp so it will have C# highlighting in my opinion. Nice and simple and self-explanatory. I still need to see what additional rulesets are required by C# but C and C++ were a good bet.

a2937 avatar Nov 17 '25 16:11 a2937

then we can open an issue later to update all the language blocks once you are done

majestic-owl448 avatar Nov 17 '25 16:11 majestic-owl448