A Pocket Guide To Programming Core

Programming Language Types

Programming languages can easily distinguished into two main types as per variable declaration.

  • Strongly Typed
  • Loosely Typed

Strongly Typed

Strongly typed languages are those that strictly need or require variable type declaration at time of declaring a variable. For example.

// Java
String name = "John Doe";

// C++
string name = "John Doe";

// C#
string name = "John Doe";

All above variable declarations in Java, C++ and C# will be incorrect if we remove or don’t use “String” at start our statement.

Loosely Typed

Loosely typed languages are opposite of strongly typed languages. As they allow you to declare a variable without telling or adding variable type at time of declaration. For example.

// PHP
$name = "John Doe";

// JavaScript
var name = "John Doe";

# Python
name = 'John Doe'

Almost all loosely typed languages determine variable type using information stored in a variable or the way we declare a variable. For example.

// A variable of type string should have "" around it in PHP
$name = "John Doe";

// PHP Integer
$age = 16;
$year = 2020;

# In Python we use ''
name = 'John Doe';

# Python Integer
age = 16;
year = 2020;

// JavaScript support both "" and ''
var name = "John Doe";
var name = 'John Doe';

// JavaScript Integer
var age = 16;
var year = 2020;

Now you should know difference between Strongly typed and Loosely typed programming languages.

Let’s move on to next chapter of this course. Please click on “Next” to continue.

Image placeholder

Hi! I'm Zeeshan Elahi

I have compiled and prepared this content with love for people like me and you. And as you know it always take some time and extra cups of coffee to read, compile and prepare a course or manual. If you have like reading this content and want to say thanks, please consider supporting from more stuff like this.

Leave a comment

Your email address will not be published. Required fields are marked *