Global "create" function

The people outside of these forums don’t see much of a difference between using your create() function and writing it out manually.

That’s the exact reason local variables and garbage collection was invented.

By the way, that is in-studio. You have to prestige to Elite Grand-Master Script-Kid rank.

“The people outside of these forums don’t see much of a difference between using your create() function and writing it out manually.”
How out-of-touch are you? Are you assuming that every person that’s not a member of the forums is a complete and utter idiot? Just because someone isn’t a member of the forums doesn’t mean that they can’t program.

“That’s the exact reason local variables and garbage collection was invented.”
Computational performance was not my concern. Have you ever read “The Magic Number Seven”? Humans can only keep track of ~7 things in their brain at a time. Needlessly spamming variables that will not be needed more than five lines later just makes it harder to keep up an overview of your own code.

Isn’t the point of [strike]local[/strike] temporary variables so that you don’t have to remember things when you’re looking back on your code?

I think create is a terrible thing to use. You need to put a table into memory just to throw it away afterwards, and the order is not as expected. There are a million cases where someone could come up with some weird hack that saves a few seconds.

If you type the same thing over and over, make a function for it. (this applies to everything)

local function createPart()
	local p = Instance.new("Part")
	p.Anchored = true
	p.TopSurface = 0
	p.BottomSurface = 0
	return p
end
local superDescriptiveVariableName = createPart()

Even this would be better than create, lol:

local superDescriptiveVariableName = (function()
	local p = Instance.new("Part")
	p.Anchored = true
	p.TopSurface = 0
	p.BottomSurface = 0
	return p
end)()

or

local superDescriptiveVariableName; do
	local p = Instance.new("Part")
	p.Anchored = true
	p.TopSurface = 0
	p.BottomSurface = 0
	superDescriptiveVariableName = p
end

Echo, devAdrian - If you guys are going to go back and forth like that beyond talking about Ethan’s suggestion please take it to PMs.

The people outside of these forums don’t see much of a difference between using your create() function and writing it out manually.

That’s the exact reason local variables and garbage collection was invented.

By the way, that is in-studio. You have to prestige to Elite Grand-Master Script-Kid rank.[/quote]

Actually, garbage collection doesn’t collect local variables like you seem to think it does. If you say local >200 times in the same scope (includes higher scopes) you will get an error because you have more than 200 local variables. Even if you write out:

local a
local a
local a
local a
...

201 times, it will still error.

lol.

Protip: Ctrl+Alt+(Up/Down)

Protip: Ctrl+Alt+(Up/Down)[/quote]

I used to have a bunch of those in my workflow but I went on a pretty lengthy hiatus during end of senior year.

[size=1]I couldn’t stop myself from posting this lool.[/size]

I wonder what scripters who use special create functions do with all their free time?

[quote] [quote=“devAdrian” post=173004]

[/quote]

Protip: Ctrl+Alt+(Up/Down)[/quote]

I used to have a bunch of those in my workflow but I went on a pretty lengthy hiatus during end of senior year.[/quote]

I actulally pressed Ctrl+Alt+Down in studio, making my screen turn upside down… gg