Jump to content

Trouble with Widgets


Viston

Recommended Posts

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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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