Pronunciation of programming structures (especially in C #)

As a person who does not speak English, I often have problems defining certain programming structures and abbreviations. I watched a few video tutorials and listened to podcasts, although I couldn’t catch them.

My question is, what is the common or correct pronunciation of the following code snippets?

  • Common, for example

    IEnumerable<int> or in the void Swap<T>(T lhs, T rhs) method void Swap<T>(T lhs, T rhs)

  • Indexing collections and indexer access, for example.

    garage[i] , rectangular arrays myArray[2,1] or jagged[1][2][3]

  • Lambda operator => , for example. in the where extension method

    .Where(animal => animal.Color == Color.Brown)

    or anonymous way

    () => { return false;}

  • Inheritance

    class Derived : Base (ongoing?)

    class SomeClass : IDisposable (implements?)

  • Arithmetic operators

    += -= *= /= %= !

    Are the += and -= tags the same for events?

  • Collection initializers

    new int[] { 4, 5, 8, 9, 12, 13, 16, 17 };

  • Casting

    MyEnum foo = (MyEnum)(int)yourFloat; (as?)

  • Nullables

    DateTime? dt = new DateTime?();

I noted the question with C# , as some of them relate only to C #.

+4
source share
4 answers
  • "I-enumerable of int", just "Swap"
  • "Garage sub i", "myArray sub two one"
  • "where the animal is such that ..."
  • "Derived from Base," "Someclass that implements IDisposable."
  • I would not be shy about these conversations; I would say that "set x equals x five times" or "the method subscribes to the event."
  • "An internal array containing ..."
  • "yourFloat cast as MyEnum"
  • "Nullable DateTime dt"
+3
source

For 3.)

I believe that the operator "=>" can usually be read as "such that",

 .Where(animal => animal.Color == Color.Brown) 

will be "animal so that the color of the animal equals brown."

Some of them are a little complicated, because I don’t remember actually saying them often.

+1
source

.Where(animal => animal.Color == Color.Brown)

I say: "the animal is coming ..." or "the lambda of the animal is ..."

() => { return false;}

I say lambda goes without arguments

new int[] { 4, 5, 8, 9, 12, 13, 16, 17 };

"New array int ..."

+1
source

1. An angular bracket is pronounced "out", as in Visual Basic

IEnumerable<int> β†’ IEnumerable of int

2. For one-dimensional arrays "from" is good

garage[i] β†’ garage of i . Not sure about myArray[2,1] β†’ myArray of 2 and 1

UPDATE : but people suggest using "sub". I do not know about it;)

3. Romkins said that

4. You are right

5. Plus-peer, minus-peer for arithmetic operations, AddHandler and RemoveHandler , Hook and Unhook , Register handler and Unregister handler are good for events

7. As good since there is an As operator in C #

8. Nullable of DateTime , or DateTime nullable are useful to you.

+1
source

Source: https://habr.com/ru/post/1333830/


All Articles