C# — The Beginning by@jonmichaeldreher

C# — The Beginning

Jon-Michael Dreher HackerNoon profile picture

Jon-Michael Dreher

Software Developer

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!