Jump to content

Trouble with Widgets


Recommended Posts

Posted
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 :feels: I'll end up with 3k lines of coding in one class

Posted
7 hours ago, HeyImJamie said:

Don't you then end up with scripts like the 3k lines tut that existed somewhere on here :feels: 

 

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 :feels: 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

  • Like 2
Posted
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 :)

  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...