Jump to content

Tips on organizing your code


Recommended Posts

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.

Link to comment
Share on other sites

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!

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

  • Recently Browsing   0 members

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