Page 1 of 1

Working with the code

PostPosted: Tue Sep 15, 2015 10:46 am
by stu
Hi,

This is a bit of a follow up to my Sub routines always present thread.

I been working on a few projects lately and they involve quite a few lines of code, I realized at some point last year that its better to put most of the code in the subroutines code page as opposed to have code spread all across the publication elements, making it hard to debug and overall work with.

So for example many of my Buttons now just call a subroutine and there's subroutines within subroutines so a lot of what happens is handled from there. It works fine but whenever you go over... say... 500 lines of code its just harder and harder to keep track of what happening, even when using prefixes for the routine names.

The same way I mentioned in my Suggestion post Its maybe that is me as a terribly disorganized person, mea culpa if it is that way... But maybe someone more experienced could share some hints on better ways to organize code and working with it...

Regards

Re: Working with the code

PostPosted: Tue Sep 15, 2015 6:33 pm
by Neosoft Support
It's a good idea to include comments in your code describing what each subroutine does. That will help in the future because it's easy to forget. You can also rearrange subroutine blocks by cutting and pasting to group like things together into sections. Most large programs can be difficult to decipher especially if you're not the one who wrote it.

Re: Working with the code

PostPosted: Wed Sep 16, 2015 8:18 am
by Wrangler
For me, it would be better if the subroutines could be isolated. So when you select one from a list, it shows just that subroutine instead of going to a bookmark on a page full of subroutines. Less confusing, easier to find code, and less likely to be working on the wrong subroutine because you missed the label or the 'return' command. A popup with a single routine code would be ideal.

Re: Working with the code

PostPosted: Wed Sep 16, 2015 6:15 pm
by Neosoft Support
For me, it would be better if the subroutines could be isolated. So when you select one from a list, it shows just that subroutine instead of going to a bookmark on a page full of subroutines. Less confusing, easier to find code, and less likely to be working on the wrong subroutine because you missed the label or the 'return' command. A popup with a single routine code would be ideal.


NeoAppBuilder works that way and it may be possible to add something similar to NeoBook eventually.