Welcome to Keen Software House Forums! Log in or Sign up to interact with the KSH community.
  1. You are currently browsing our forum as a guest. Create your own forum account to access all forum functionality.

Reusable Code - How do you handle this?

Discussion in 'Programming Questions and Suggestions' started by Chrison, Oct 3, 2015.

Thread Status:
This last post in this thread was made more than 31 days old.
  1. Chrison Trainee Engineer

    Messages:
    49
    Hey,

    I'm just wondering how you guys handle the restrictions of K# in terms of reusable code / modifiers ...
    In general the idea behind OOP is to write something once and then simply reuse it by calling some sort of refecence (e.g. Namespace.Class.Method(Arg1, Arg2) )

    Since we dont have this option in K#, i'm currently copy&pasting all my stuff as static classes at the end of my GridProgram to allow reusability within my scripts.
    In additon (to save me some time) I use an Alias in the "using"-section
    using Debugger = Library.Debugger;
    This way I can easily determine which Class I need to copy&paste when putting my script together without the need to change a single line :) Unfortunally this ends up in plenty of copy&paste action each time I change something (especially for stuff thats used in many GridPrograms, not just in one...)

    Fortunally I can write & test most of my code within Visual Studio and use stubbed SE-Libs to do debugging outside of SE (most of my stubs implement some sort of Console.Writeline() instead of the SE-Code) But once in a while I need to go ingame and check if it still works with real blocks instead of fake ones :)
     
Thread Status:
This last post in this thread was made more than 31 days old.