Logo

Programming-Idioms

This language bar is your friend. Select your favorite languages!
  • C#

Idiom #3 Create a procedure

Like a function which doesn't return any value, thus has only side effects (e.g. Print to standard output)

void Finish(string name) 
    => System.Console.WriteLine($"My job here is done. Goodbye, {name}");
void Finish(string name)
{
    System.Console.WriteLine($"My job here is done. Goodbye, {name}");
}

If a method doesn't return anything, then it's marked as void
procedure Finish (Name : String) is
begin
   Put_Line ("My job here is done. Goodbye " & Name);
end Finish;

New implementation...
< >
programming-idioms.org