Strict Typing: What's the point?

image

Regular:

local RunService = game:GetService("RunService")

local function WaitForChild(Name, Parent)
	if not Parent:FindFirstChild(Name) then
		repeat RunService.RenderStepped:Wait() until Parent:FindFirstChild(Name)
		return Parent:FindFirstChild(Name)
	end
end

local Folder = WaitForChild("Folder", script)
print("Regular found a folder!")

Strict Typing:

local RunService = game:GetService("RunService")

local function WaitForChild(Name : string, Parent)
	if not Parent:FindFirstChild(Name) then
		repeat RunService.RenderStepped:Wait() until Parent:FindFirstChild(Name)
		return Parent:FindFirstChild(Name)
	end
end

local Folder = WaitForChild("Folder", script)
print("StrictTyping found a folder!")

What’s like the point of it if it isn’t faster?

Thanks, WE

I think this explanation is pretty good. In short, if you fed a function the wrong argument, the type checker would warn you about it before you hit run.

2 Likes

So it doesn’t make code faster? So I don’t have a point in using it then.

Well, you spend less time debugging your code, which is definitely a good benefit. Also, the post I linked literally said that it might become more efficient in the future.

1 Like

Ok, so I better start converting Bloxy Kart to Strict typing then!

Does this also work with variables?
Edit: Yes it does. I figured it out.