Skip to content

C# - #2

Open
Beard777 wants to merge 3 commits into
HowProgrammingWorks:masterfrom
Beard777:CSharp
Open

C##2
Beard777 wants to merge 3 commits into
HowProgrammingWorks:masterfrom
Beard777:CSharp

Conversation

@Beard777

Copy link
Copy Markdown

Создал все виды итераций на языке C#.

@GYFK
GYFK requested a review from Raixur June 6, 2017 21:42

@Raixur Raixur left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't look like C# at all!

Critical errors:

  • Function signature must have return type or return void.
  • Classes with same name in global namespace won't compile.
  • No using directives.

Improvements:

  • No Enumerable.Select() example (js - map).
  • No foreach lambda expression example.

Codestyle:

  • Class and function names shouldn't be uppercase, PascalCase is preferred.

Comment thread CSahrp/break.cs
{
const bool flag = true;
Console.WriteLine("Hello");
if (flag) break;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

break must be used inside the loop, otherwise it won't compile and don't make sense.

Comment thread CSahrp/continue.cs
{
const bool flag = true;
Console.WriteLine("Hello");
if (flag) continue;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

continue must be used inside the loop, otherwise it won't compile and don't make sense.

Comment thread CSahrp/for.cs
{
public FOR()
{
for (let i = 0; i < 10; i++)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let is used for LINQ not for simple variable initialization, use var instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants