Off Topic > Off Topic
Programming Megathread
Foxscotch:
--- Quote from: Mr.Blocko on July 03, 2017, 05:41:25 PM ---So, can anybody describe the pros and cons of Kotlin vs Java
--- End quote ---
it's literally just syntax. if you like kotlin's syntax more than java's, use kotlin. otherwise, use java. they're both on the JVM so they are completely interoperable and functionally identical, just like with any JVM language
apparently kotlin can also be compiled to binary if you're interested in that but as far as I can tell it's a bit of a work in progress so
there's ALSO an officially-supported javascript transpiler but imo transpiling to js is kinda gay, except for typescript which gets a pass since it's just a superset of js. and also I'm sure there's at least a few java to js transpilers
Køtt:
kotlin sounds swedish
Waru:
--- Quote from: Metario on July 03, 2017, 10:23:34 PM ---makes it easier to maintain and if you want to roll out a change to all weapons you can just change the template and it'll update for all
--- End quote ---
but I already have a weapon class that I can change?
Headcrab Zombie:
Imo I'd have one class for everything as long as they all have the same basic behavior.
As soon as they start having different behavior (e.g. if weapontype = x then do a, if weapontype = y then do b, etc)
SUSHI:
I recently discovered a way to modify the byte code of functions at runtime in UnrealScript. I've partially released a proof of concept here.
This works by abusing the fact that class members in UnrealScript are actually just objects that hold metadata. You can get a reference to these metadata objects by using FindObject, DynamicLoadObject or the AllObjects Iterator.
Normally the class of these metadata objects are not exposed to unrealscript, so it's not possible to make changes to them. To work around this, I created a stub for each type of metadata -- and using a modified compiler -- allowed myself to forcefully cast them into their respective stub.
--- Quote from: Waru on July 03, 2017, 11:48:33 PM ---but I already have a weapon class that I can change?
--- End quote ---
Yeah only do that if you're going add weapon specific calculations, otherwise you're going to end up with a switch statement to branch off into different methods and that can get pretty hairy if you've got a lot of weapon types.