Strongly Typed?


I kept hearing that certain programming languages were strongly typed. I don't recall learning the concept of strongly typed in school so I was a bit confused. Turns out it was a lot easier to understand than I was expecting.

Here is what I found on Google:
Strongly typed - is a concept used to refer to a programming language that enforces strict restrictions on intermixing of values with differing data types. When such restrictions are violated and error (exception) occurs.

Pretty much this means every Variable MUST have a type (int, string, Boolean). For example if you code in JavaScript you do not have to state the type when declaring a variable, but in languages like Java and C++ you must state the type. So, you see JavaScript would NOT be considered a strongly typed language.

Assigning a Variable in JavaScript:    var myName = "Daisy" or var age = 21
Assigning a Variable in Java:              String myName = "Daisy" or int age = 21

In JavaScript you use var to declare all variables of different types, but in Java you must state the type like String and int.

Comments

Popular posts from this blog

About 2 months in

Getting to know Salesforce