C# — The Beginning by@jonmichaeldreher
688 reads

C# — The Beginning

Read on Terminal Reader

Too Long; Didn't Read

featured image - C# — The Beginning
Jon-Michael Dreher HackerNoon profile picture


Jon-Michael Dreher
react to story with heart

Very basics:

  1. A single line of code must end with a semi-colon;
  2. .NET framework includes: class library; CLR: common language runtime which takes care of low-level background functionality; curly braces define code blocks; Class: container for all of the methods of an application; Method: a named block of code that does something — because it has a name you can call it in order to execute it.
  3. Variables: a variable is a spot in the computer’s memory that holds information/data. You declare a variable by first giving it a data type and then giving it a name i.e. “string firstName”
  • It is best to declare a variable and at the same time assign a value to it — this is called “initialization.” Make the variable valid immediately upon declaring it.

4. The “=” sign is called the assignment operator. Whatever value is to the right of it is assigned to the variable to the left of it.

So far I really like C#. I believe it is a strongly-typed language, meaning you can’t change things on the fly like you can sometimes in JavaScript. I also like how it forces you to assign data types to variables immediately upon declaring them, which Typescript now takes care of and compiles nicely down into JavaScript.

These are the very basics of C#, if you have anything to add at a very elementary level, please include in the comments below. Happy coding!


. . . comments & more!
Hackernoon hq - po box 2206, edwards, colorado 81632, usa