HomeAboutBlogPortfolioTechNews Register Login

My Blog

As I have studied web development I have learned that there is a lot to know. Everytime I learn something new I realize there is much more I don't know. So here are some things I have learned along the way!

Interpreted vs Compiled, Static vs Dynamic, Strong vs Weak

Becoming a Programmer

First we need to understand that there are three levels of programming languages.  Languages like JavaScript, Java, C, and other languages that we typically hear about are high-level languages.  Relatively speaking they are easy for humans to read and understand. A level below the high-level languages is Assembly code.  It is still somewhat readable by humans but a lot harder to understand. The lowest level that the CPU can read is machine code.  This is the binaries with ones and zeros.


So when we write code we write source code.  Which is the code typed into a text editor or IDE by a programmer.  I have heard that source code is the term for code written in a compiled programming language such as C or Java and interpreted languages such as JavaScript code is not called source code, just code.  So if you know for sure leave comments and let me know.


Either way the code needs to be changed to machine code to be read by the CPU.  This is called translation. Compiled languages and interpreted languages gets translated differently.  

Another thing to understand is run-time.  Run-time is the period when the code is being executed.  Compiled languages gets translated before execution, whereas interpreted languages gets translated line by line at run-time.


Note:  from my understanding some compiled languages get compiled to assembly before machine code.  I will admit that I do not know if that is true as well with interpreted languages.


Statically typed is when the data type for constructs are checked before run type.  Dynamically typed is when it is done during execution. Sometimes there is confusion with this and the meanings of weakly and strongly typed.  Weakly typed in general are languages that don’t require you to set a data type when you initialize a variable. They generally are more flexible with changing that variable’s type later on in the code.  Strongly type requires you to define the data type for the variable.


Typically languages that are compiled, statically typed, and strongly typed are faster at execution.  Interpreted, dynamically, weakly typed languages allows for more flexibility. 


A language can have any combination or characteristics of those combinations that I have explained.  With today’s languages and technologies there is a lot more grey areas in these definitions, but understanding these characteristics of the programming language that you write in, will help you write better code.