V3: [C#] Add new reference document: readonly vs const

Created on 14 Jan 2020  路  9Comments  路  Source: exercism/v3

[C#] Add new reference document: readonly vs const

This issue describes how to add a new C# reference document: readonly vs const.

Description

The goal of the new reference document is to explain the different between (static) readonly fields versus const fields, which is confusing to many students.

The document should explain how the two approaches are different, taking into account:

  • What values they can be applied to.
  • Readability aspects.
  • Performance characteristics.
  • Memory aspects.
  • Generated IL code (optional).

Based on the aforementioned differences, the document should provide guidance on when to use which approach and why.

Resources to refer to

Contributing

To create the reference, please:

statuin-progress traccsharp typdocumentation typnew-reference-doc

Most helpful comment

copied my comment to the constants exercise #1044.

All 9 comments

I can help here! What would you like to see for instance?

@Kavignon great! Shall I assign the issue to you?

As for what is expected, this issue lists all the information we'd like to see in the document. The document itself could look like this document.

Sounds good to me!

Assign it to me!

@Kavignon Done.

@Kavignon Just checking up on your progress. Do you need any help?

Can we include readonly structs and members in this exercise.

@mikedamay This is not an exercise but a reference document. Something like https://github.com/exercism/v3/blob/master/languages/csharp/docs/code_style.md or https://github.com/exercism/v3/blob/master/languages/csharp/docs/memory_allocation.md, which are contents we can use in exercises. Originally, we considered linking to these documents, but just including their contents in the exercise might be best at first.

copied my comment to the constants exercise #1044.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

efx picture efx  路  3Comments

wolf99 picture wolf99  路  5Comments

tehsphinx picture tehsphinx  路  6Comments

tehsphinx picture tehsphinx  路  4Comments

kotp picture kotp  路  3Comments