This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Sammich Lord's profile picture

Quality Of The Scripts

Started by Sammich Lord, 09 December 2012 - 10:38 PM
Sammich Lord #1
Posted 09 December 2012 - 11:38 PM
I have been noticing the quality in the scripts that have been being made on this forum. I just saw a in-game IDE called "TACO" and it looks amazing. And everybody cannot forget about Rednet Explorer and Firewolf. It just amazes me.

We still get those simple password scripts now and then, but to see top quality scripts like the ones I listed is just great. I hope to see a ton of more scripts like these in the future.
Tiin57 #2
Posted 09 December 2012 - 11:57 PM
Hear, hear!
Human has an excellent point. How damn complex are Rednet Explorer and Firewolf? :P/>
Sammich Lord #3
Posted 09 December 2012 - 11:58 PM
Hear, hear!
Human has an excellent point. How damn complex are Rednet Explorer and Firewolf? :P/>
Firewolf has gone through like 4 re-writes and each time it was above 2 thousand lines.
GravityScore #4
Posted 10 December 2012 - 01:54 AM
And everybody cannot forget about Rednet Explorer and Firewolf. It just amazes me.

Hear, hear!
Human has an excellent point. How damn complex are Rednet Explorer and Firewolf? :P/>
Firewolf has gone through like 4 re-writes and each time it was above 2 thousand lines.

Thanks :D/>
It means a lot to 1lann and I to hear these kind word from everyone!
Mads #5
Posted 10 December 2012 - 07:24 AM
The only thing that I think is stupid, is that all of the complex programs use only 1 file. It get's so cluttered etc.

Just do something like this:



function req_r(path)
    return dofile(path)
end

function req_g(path)
    local t = dofile(path)

    for v, k in pairs(t) do
        _G[v] = k
    end
end

Where req_r() returns the tables returned by the path. and req_g() loads the table into the global table.
billysback #6
Posted 10 December 2012 - 07:41 AM
The only thing that I think is stupid, is that all of the complex programs use only 1 file. It get's so cluttered etc.

Just do something like this:



function req_r(path)
	return dofile(path)
end

function req_g(path)
	local t = dofile(path)

	for v, k in pairs(t) do
		_G[v] = k
	end
end

Where req_r() returns the tables returned by the path. and req_g() loads the table into the global table.
because then you have to distribute multiple files, and although you could create an "installation" file that they download and run it is, in the end, easier and the norm for programs to be in one file, however small or large.

You can still organize your code inside of one file however, using headers inside of brackets and/or splitting functions in to tables.
GravityScore #7
Posted 10 December 2012 - 08:42 AM
Firewolf is actually organised into 2 separate software distributions (the main part, and the server software - SHELL.RUN FTW!). The main section basically acts as an installer and creates all the data storage, and downloads data files and the server software. And I really don't see why I should separate the API out into a separate file. It's just another file to host, download, and time spent waiting for the HTTP request to complete.

We keep it in one file for the exact reason billysback said: the user only needs to download a single file, we don't need to create an installer, host more files, and wait for HTTP.
The only reason I would ever implement an installer is if I were writing an OS - even then I wouldn't advertise it as an installer. I keep a philosophy that everything should be as simple as possible - hopefully it is :P/> not sure if people notice…

My only worry is how completely bat-shit crazy everything will turn once HTTP is implemented…