Type safety is a functionality of a programming language where the data types are well defined during the compilation. Which means no dynamic / run time assignment of types. Like a string should be defined as a string from the beginning. However languages like Python or Java Script the variables type gets decided when it executes and based on the assigned value the compiler decides on run time the type of the variable. Strongly Typed is a quality of a programming language where Type Safety is applicable.
As you can see in the below screenshots we have a code that does not specifically declare the data type the other one does mention the data types specifically.
I have used Python and C# as examples side by side to compare.
So, when you are not defining the data types beforehand, the language compiler defines the data at run time. Both of these has their own advantages and disadvantages. I will discuss it in more details in a separate blog post.
Thread Safety, is a feature where we ensure a block of code will work as expected in a multi threaded environment.This is specially critical when you run your tests in local and then move your code to the prod environment with 16 core processor is running. There are scenarios where either you starve the processor by limiting it to a strict single threaded sequential execution or mess it up by not checking about the thread safety of your code. This is specially true with the usage of random collections with out checking about thread safety. Another area is memory leak where the program keep creating unnecessary objects due to multiple threads. We will discuss specifically on this points at our upcoming topic of Task based Async pattern (TAP). Also, how a common design pattern called singleton help us to achieve this scenario.