Viston Posted July 11, 2017 Author Share Posted July 11, 2017 6 hours ago, Apaec said: If you're finding bits of your code are interfering with other parts and it's taking you such a long time to debug, perhaps consider the structure of your code? I don't know what your task class does which you're extending with this code, but if it's just some abstract class with those methods that you're overriding, then that seems pretty useless -why not just have your code in your onLoop where you can see it all at once ^^! I feel like onLoop on bigger scripts is not my thing. I can't stand looking at bunch of code glued together under 1 loop I'll end up with 3k lines of coding in one class Quote Link to comment Share on other sites More sharing options...
Apaec Posted July 11, 2017 Share Posted July 11, 2017 7 hours ago, HeyImJamie said: Don't you then end up with scripts like the 3k lines tut that existed somewhere on here 5 hours ago, Eliot said: Please don't encourage this (especially for non-trivial scripts). Having a gigantic onLoop would not make this easier to debug, but quite the contrary. The problem in this case is debugging skills and without them, regardless of structure, you will run into these problems. 4 hours ago, Visty said: I feel like onLoop on bigger scripts is not my thing. I can't stand looking at bunch of code glued together under 1 loop I'll end up with 3k lines of coding in one class Sorry I think I didn't explain myself correctly! You're right in saying that big on loops are bad, but I find the best way to manage that is to delegate script function to subclasses each with their own purpose, that way for larger and especially AIO scripts, your onLoop would be no more than 10 or 20 lines. For big scripts, breaking the code up is a must, I just don't think that a 'task' or 'node' (or whatever name you want to call it) framework is the best way and often there are much neater design patterns which fulfil a more object-oriented style! (: Apa 2 Quote Link to comment Share on other sites More sharing options...
Viston Posted July 11, 2017 Author Share Posted July 11, 2017 1 hour ago, Apaec said: Sorry I think I didn't explain myself correctly! You're right in saying that big on loops are bad, but I find the best way to manage that is to delegate script function to subclasses each with their own purpose, that way for larger and especially AIO scripts, your onLoop would be no more than 10 or 20 lines. For big scripts, breaking the code up is a must, I just don't think that a 'task' or 'node' (or whatever name you want to call it) framework is the best way and often there are much neater design patterns which fulfil a more object-oriented style! (: Apa True that, I've made multiple scripts by using onLoop, by seperating the functions into subclasses, but felt like somewhat Tasks were easier to maintain. However, I'll give it a try for my next project, and see how it goes, wouldn't hurt I guess 1 Quote Link to comment Share on other sites More sharing options...
Tom Posted July 11, 2017 Share Posted July 11, 2017 (edited) Since when was good code formatting a thing on these forums Edited July 11, 2017 by Tom Quote Link to comment Share on other sites More sharing options...