Is C# Statically, Strongly, Dynamically or Weakly Typed?

Sdílet
Vložit
  • čas přidán 20. 07. 2024
  • The code for this example can be found at:
    ryanmcbeth.com
    github.com/mcbethr/TypesInCSharp
    Think of "Typing" as the "Nouns" of a computer programming language. Types help make sure that you don't do things that don't make sense, like divide a string by a boolean.
    Strongly typed languages make sure that all types are checked at compile time. They are slower to compile but faster to run. C# is a Strongly typed language.
    Dynamically typed languages have their types checked at runtime.
    Statically typed languages don't have implicit conversions. Weakly typed languages have implicit conversions everywhere. C# is a Statically typed language.
    The VAR keyword in C# is typed at compile time, not at run time. So its inclusion doesn't make C# dynamic.
    The DYNAMIC keyword and turn off type checking at compile time in C# code, and it is mostly used for porting code from dynamic languages or allowing for the creation of new dynamic scripting languages.
  • Věda a technologie

Komentáře • 16