Event system discussion

Discuss API design here.
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Postby satoon101 » Sat Jul 21, 2012 12:18 am

Pretty sure explicitly getting a variable by using the correct method to get its correct type isn't against the nature of Python. This, in all honesty, is not up for discussion. It seems very code-lazy to me to expect to be able to use a dictionary type object to return the correct value. Simply use the given GetInt, GetFloat, GetString, etc... to get the correct value that you are looking for.

Satoon
XE_ManUp
Developer
Posts: 2
Joined: Sun Sep 02, 2012 3:35 pm

Postby XE_ManUp » Mon Sep 03, 2012 12:49 am

Please keep in mind that anyone will be able to add the event functionality later. Most people that code will know the types that they are looking for and cast them as such. This, I believe, is why Mattie opted to simply return everything as a string. It is easy enough to change the type in Python if needed and required far too much legwork.

The resource file does declare the types that they "should" be, so it would be relatively painless to view this and declare for yourself. That's how we did it with the whole of GunGame. Another thought is that it can be detrimental to force the declared type. What if I "want" the userid to be a string because of the way my data table is laid out? Then I str() it, right? If someone wants something other than what it is, they are free to change it.
User avatar
BackRaw
Senior Member
Posts: 537
Joined: Sun Jul 15, 2012 1:46 am
Location: Germany
Contact:

Postby BackRaw » Sat Sep 13, 2014 5:56 pm

I don't know if this discussion is still open, but I wanna say that it's good as it is right now, and it's working perfectly fine :D please don't change it :)
My Github repositories:

Source.Python: https://github.com/backraw

Return to “API Design”

Who is online

Users browsing this forum: No registered users and 17 guests