Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Why do people put code in a comment?

Asked by 5 years ago

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)

0
So that people who choose not to watch the whole video can just copy and paste the code. Sorukan 240 — 5y

1 answer

Log in to vote
4
Answered by
BenSBk 781 Moderation Voter
5 years ago

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.

Ad

Answer this question