What does hard coding mean?

So let me help you as well as with an example

Hard coding is when you embed the data you are going to use right into your source code. So you can’t change it without modifying the actual code.

local p = Instance.new("Part")
p.Position = Vector3.new(6.73, 5.246, 9.52)

The numbers you have put in are hard-coded because, you typed them right into your code. What if you want to change this position? It means you will have to change up the numbers.

The opposite of hard coding is soft coding. Now say you have a reference part. You will position your part wherever the reference part is. So you move it around to the new place in studio.

local p = Instance.new("Part")
p.Position = workspace.Reference.Position -- no more need to modify this code ever again!

You are now getting it from the part’s Position property as opposed to hardcoding its position.

(btw @Syclya got that from here)

2 Likes