Source language: Translate to:

Working with the code

General questions about NeoBook

Moderator: Neosoft Support

Working with the code

Postby stu » Tue Sep 15, 2015 10:46 am

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
User avatar
stu
 
Posts: 320
Joined: Wed Aug 07, 2013 11:37 am

Re: Working with the code

Postby Neosoft Support » Tue Sep 15, 2015 6:33 pm

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.
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5602
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Re: Working with the code

Postby Wrangler » Wed Sep 16, 2015 8:18 am

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.
Wrangler
--------------
"You never know about a woman. Whether she'll laugh, cry or go for a gun." - Louis L'Amour

Windows 7 Ultimate SP1 64bit
16GB Ram
Asus GTX 950 OC Strix
Software made with NeoBook
http://highdesertsoftware.com
User avatar
Wrangler
 
Posts: 1506
Joined: Thu Mar 31, 2005 11:40 pm
Location: USA

Re: Working with the code

Postby Neosoft Support » Wed Sep 16, 2015 6:15 pm

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.
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5602
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA


Return to General NeoBook Discussions

Who is online

Users browsing this forum: No registered users and 2 guests