Jump to content
Sign in to follow this  
picea892

Tips on organizing your code

Recommended Posts

picea892

Hi

Until recently I've only made short scripts so my bad habits and poor code layout has not affected me. Now for the first time I am pushing 1000 lines in one of my scripts and I'm really starting to feel the pain of being a self taught coder. It is some times rather difficult to find a spot in the code and I'm certain if I set this script aside for a couple months it will be very difficult to go back to it, simply because of how it has been written. So I want to clean it up but am not sure how to.

Could people share with me some tips and tricks on how to keep code organized. It'd be greatly appreciated.

Share this post


Link to post
Share on other sites
monoceres

Have you run tidy (Ctrl+t from SciTe4AutoIt)?

Other tips is to use comment regions (#CS and #CE) and regions (#Region, #EndRegion).

Also when you're writing the code try to modularize the code as much as possible, try to have standalone functions that don't rely on specific behaviors of other functions.


Broken link? PM me and I'll send you the file!

Share this post


Link to post
Share on other sites
picea892

#regions will help a lot! Thank you. I'm wondering if there is a default setting in SciTe to have all regions compressed on startup. It defaults to all regions open.

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.