API's are a pain. But programs are easy. [PLEASE READ] [PLEASE SPREAD]
#1
Posted 07 December 2012 - 05:42 PM
I was looking for games and I saw the perfect game. TETRIS! But turns out you HAVE TO INSTALL API'S. Why not just make it a program anyway? Its as easy as putting shell.run("APIName") at the top of your code! And its technically less work because you dont have to write the API in functions. for example let's pretend a API with the name of BobTheBuilder (I know its a stupid name but were pretending) then every function would have to be BobTheBuilder.functionName() but by using a program its just functionName().
Please share this with a lot of people so we can stop needing to install API's!
#2
Posted 07 December 2012 - 05:45 PM
walia6, on 07 December 2012 - 05:42 PM, said:
I was looking for games and I saw the perfect game. TETRIS! But turns out you HAVE TO INSTALL API'S. Why not just make it a program anyway? Its as easy as putting shell.run("APIName") at the top of your code! And its technically less work because lets a API with the name of BobTheBuilder then every function would have to be BobTheBuilder.functionName() but by using a program its just functionName()
Please share this with a lot of people so we can stop needing to install API's!
I like the "api.function()" thing. It keeps your code organized. However, I never use API's, I just put apiname = {} at the top of my code, then you can define apiname.functionname(). Just my 2ยข
#3
Posted 07 December 2012 - 06:23 PM
Also, in case you're referring to my Tetris game, I made it automatically download the needed APIs now.
#4
Posted 07 December 2012 - 06:26 PM
mind linking me to the post?
#5
Posted 07 December 2012 - 06:27 PM
EDIT: Misread that. Here's the link to the thread. Pastebin link is in the main post.
Edited by faubiguy, 07 December 2012 - 06:33 PM.
#6
Posted 07 December 2012 - 06:28 PM
I really want to play it.
#7
Posted 07 December 2012 - 09:08 PM
None of these are feasible when you include every function you'll need for a program explicitly in that program. Imagine having to copy and paste read() into every single program you wrote in order to let it take user input with it. APIs certainly have their place.
I think your complaint is much more about the lack of an auto-installer than about the use of APIs.
#8
Posted 07 December 2012 - 11:13 PM
walia6, on 07 December 2012 - 05:42 PM, said:
I was looking for games and I saw the perfect game. TETRIS! But turns out you HAVE TO INSTALL API'S. Why not just make it a program anyway? Its as easy as putting shell.run("APIName") at the top of your code! And its technically less work because you dont have to write the API in functions. for example let's pretend a API with the name of BobTheBuilder (I know its a stupid name but were pretending) then every function would have to be BobTheBuilder.functionName() but by using a program its just functionName().
Please share this with a lot of people so we can stop needing to install API's!
This program should be named startup also you must have a folder called apis on the root of the computer you can edit the directory location in the code. I use this so i can play shipper without needing the art API installed in the global APIS directory.
local apiDirectory = "/apis" if fs.exists(apiDirectory) and fs.isDir(apiDirectory) then local tFileList = fs.list(apiDirectory) for k,v in pairs(tFileList) do write("Loading : "..v.." ") local test,result = os.loadAPI(apiDirectory.."/"..v) if test then print("success") end end else print("ERROR : cant find ",apiDirectory," Directory") end
#9
Posted 08 December 2012 - 02:30 AM
thats also why i rarely post any code
so i dont have to force people to install my apis
im going to make a program that compiles a program and api together (without extracting)
#10
Posted 08 December 2012 - 03:02 AM
#11
Posted 08 December 2012 - 03:09 AM
bjornir90, on 08 December 2012 - 03:02 AM, said:
personally i hate programs that extract a ton of stuff just to run a single program
its much much less convenient then just including the used functions in the top of your code
#12
Posted 08 December 2012 - 03:16 AM
bjornir90, on 08 December 2012 - 03:02 AM, said:
#13
Posted 08 December 2012 - 05:12 AM
If we was just to copy the functions of the API's to the top of his program he would be adding 1032 lines on top of the code that he used, this is just unnecessary and makes things untidy.
APIs can also be made by other people in order to make other peoples programs easier to make, on top of this is obviously makes the program more readable and tidy.
No offense, but this is such a ridiculous thread.
#14
Posted 08 December 2012 - 04:30 PM
#15
Posted 08 December 2012 - 04:50 PM
os.loadAPI("apiname") loads an api.
Many of us who make and use a lot of apis have startup files taht load them all for us, like the code BigSHinyToys posted earlier in this thread. Then it's a non-issue; apis on a computer go into the apis directory, and they reload every time the computer boots up.
#16
Posted 09 December 2012 - 08:36 AM
#17
Posted 09 December 2012 - 08:48 AM
MechaTallon, on 09 December 2012 - 08:39 AM, said:
Whatever. It works, so how is it bullshit? Of course, I'd love to hear some constructive feedback, but I doubt very much it will be forthcoming. The only thing that I think is missing right now is metatables in API's - but that is something I plan to rectify.
#18
Posted 09 December 2012 - 09:01 AM
MechaTallon, on 09 December 2012 - 08:50 AM, said:
Well would be easy to create that yourself
#19
Posted 09 December 2012 - 09:23 AM
#20
Posted 09 December 2012 - 09:29 AM
ChaddJackson12, on 09 December 2012 - 09:23 AM, said:
Then that's your problem. There are many examples on how to use API's and a help section.
It just occurred to me - if you want to load an API from a string you might as well just include it in the program.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users