Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why do people put code in a comment?

Why doo people put code in a comment? I don't understand it. When I was watching steadyon's region 3 tutorial he put the code for making the part in a comment

Like sometimes I see source code for something and I see code in a comment

--[[
local p = Instance.new("Part",game.Workspace)
--]]
game:GetService("Debris"):AddItem(p,5)

1 comment

0

So that people who choose not to watch the whole video can just copy and paste the code.

1 answer

✓ Accepted answer

Making lines of code comments is used to disable a specific piece of code in order to:

  • Single out which part of code is causing an issue.
  • Test what would happen if a certain part of code did not run.
  • Keep the code in case it is needed in future, despite not having a current use.
  • Et cetera.

This is known as commenting out code.

This discussion is preserved as it was. New answers, comments, and votes are closed.