AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Brain storming

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> General Chat
View previous topic :: View next topic  

How do you make a task oriented script?
Document it first, then I know what it's to do
18%
 18%  [ 2 ]
Whats a document?/Its all in my head
36%
 36%  [ 4 ]
Small scraps and notes
9%
 9%  [ 1 ]
A note book
9%
 9%  [ 1 ]
A combination of the above
18%
 18%  [ 2 ]
Other
9%
 9%  [ 1 ]
Total Votes : 11

Author Message
Invalid User



Joined: 14 Feb 2005
Posts: 442
Location: Texas, Usa

PostPosted: Wed Sep 07, 2005 5:58 am    Post subject: Brain storming Reply with quote

I was interest in how others made scripts, Like AGU and his task organizer...

Most of the time I use a notebook and jot down small reminders of this and that, rarely I write a document explaining how it will work(you know, for them big projects). Other times its all in my head.
_________________
my lame sig Smile
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
toralf



Joined: 31 Jan 2005
Posts: 3842
Location: Bremen, Germany

PostPosted: Wed Sep 07, 2005 7:35 am    Post subject: Reply with quote

It all starts in my head.
1) start to write the important part of the script (could be GUI or the action, depending which is more important/difficult).
2) re-structure the code and optimize it
3) comment the code, since I want my codes to be maintained (by myself or others).
4) Add the less important and the nice-to-have stuff
5) do 2) and 3) again

There is no document, only the source code with comments.
But I always try to
- separate code into GUI, Data and Action subroutines
- Use speaking names for vars, routines, functions
- indent the code
- not use GoTo
- not encapsulate subroutines into each other (instead use GoSub)
- not use more than one return per subroutine/function
_________________
Ciao
toralf
Back to top
View user's profile Send private message Send e-mail Visit poster's website
corrupt



Joined: 29 Dec 2004
Posts: 2419

PostPosted: Wed Sep 07, 2005 8:01 am    Post subject: Reply with quote

Most of the time I would have to say "Whats a document?/Its all in my head" but if it's something that I'm trying to figure out a solution for and/or a larger than normal script then the documentation is usually in the form of comments and/or commented out bits of code throughout the script. These comments and sections rarely remain in the final code though.

In general, I'll start coding the obvious parts that are needed to create a basic structure to work with, then start adding code to support the objectives. When I get to a point where things seem to be stable but there's more to add and/or a new idea comes to mind, I'll create a copy of the file and start modifying the copy with new code. Once the objectives are met I run a few tests, save a copy again, strip all non-functional/unnecessary code, strip all comments and test again. If all goes well I'll go back through the code and add comments at various key points (although I have a bad habit of skipping this very important step when I don't have much time available Embarassed ) .

The reason for stripping the comments then adding them again is to follow the flow/logic (or lack thereof Laughing ) to determine if anything may have been overlooked and/or might be accomplished better using different methods. Fortunately/unfortunately this can also lead to many changes and/or a rewrite.
Back to top
View user's profile Send private message Visit poster's website
Nemroth



Joined: 07 Sep 2004
Posts: 262
Location: France

PostPosted: Wed Sep 07, 2005 10:05 pm    Post subject: Reply with quote

I essentially program AHK for my work, for my own usage, as in my work there are a lot of usage of texts (of witch Word) and Excel sheets.
The aim of my work on AHK is to speed up and automate the use of my IBM Mainframe 3970 Windows emulation, and to take information elements (via clipboard) and give them a treatment under Word or Excel.

I note my ideas on a (paper) notebook when they come. As I use only one (compiled) file (the autohotkey.ini), I put them in it as soon as I can. I also note in there the projects, the "bugs" to resolve (things witch don't work or witch don't work as I want), the projects (short, median and long term), the to do list, the characteristics of the features to implement...
I code almost "directly", and if I have an important part to develop, I can make a separate ahk file for test purposes, before integration.

I take attention essentially to :
- Indent correctly the code,
- Comment it for simplify the future maintenance
- Save each modification with the date and a number, to be able to retrieve a working version if my trials are unsuccessfull.
- give names to variables, labels and so on wtich can't be confused ones with the others.
- try to use (as frequently as possible) a same (modified at launch time) GUI for differents purposes (but with similar characteristics).

In the future, I will have to develop separates (little) parts that must run independantly of the rest of the code.
Back to top
View user's profile Send private message
delta



Joined: 16 Feb 2005
Posts: 44

PostPosted: Sat Sep 10, 2005 10:30 am    Post subject: Reply with quote

Well, some time ago I would have voted for "all in my head". But I've found that I tend to have so many running tasks (not only AHK) that some of them would be forgotten for a long time or even forever. Confused And even if they were recovered somewhen I would start stratching my head: "What the heck did I DO here??"

So I decided to have a "task manager" for myself. Right now I use TreePad, a text/richtext editor that arranges your notes in a treelike structure.

When I do a bigger AHK thing I normally start drawing some outlines and collecting ideas. Next I try to break them up to smaller parts and to find basic functions/subs I need. It's then back and forth: writing down the structure in TreePad, writing some code, updating and enriching the TreePad file, writing more code, etc... I also keep track of important variables, especially where they are set and modified. And I try to have separate files, like one for the GUI and GUI actions, one for data processing and so on. Whenever possible I try to write scripts that can be reused, e.g. rather one that deals with queues/stacks in general and can be included into many other scripts than just one fragment deep inside a cryptic sub.

Oh, and I like paper notes, since they are quick, but once you start they usually tend to get lost in thousands of other notes lying around. So I try to cut this down to a minimum. (Gee, we have those ultra fast computers that can display a million colours and have huge hard disks to hold everything you could probably write down in your entire life and we still use pen and paper... something must have gone wrong in the development of computers.)
Back to top
View user's profile Send private message
aarondellis



Joined: 15 Aug 2005
Posts: 57

PostPosted: Sat Sep 10, 2005 2:21 pm    Post subject: Reply with quote

Freemind works well! Its free and allows you to drag your ideas around. You can then print an outline-like report.
http://freemind.sourceforge.net/
Back to top
View user's profile Send private message
corrupt



Joined: 29 Dec 2004
Posts: 2419

PostPosted: Sat Sep 10, 2005 5:25 pm    Post subject: Reply with quote

For misc. notes I use an app that I put together a while ago. Here's a link in case anyone finds it useful. It hasn't been updated in a while but will likely be updated soon to add a bit more functionality as I've been using it quite a bit lately.
Back to top
View user's profile Send private message Visit poster's website
delta



Joined: 16 Feb 2005
Posts: 44

PostPosted: Wed Sep 14, 2005 9:45 am    Post subject: Reply with quote

Hm, I'll add a treepad link then too. Smile You can buy a full featured rich text version, but there is also I nice free version (easily overlooked on the main page): http://www.treepad.com/treepadfreeware/
Back to top
View user's profile Send private message
Nemroth



Joined: 07 Sep 2004
Posts: 262
Location: France

PostPosted: Wed Sep 14, 2005 7:16 pm    Post subject: Reply with quote

I use Sniplets 2.1.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> General Chat All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group