Version 1 of Software creation with Tcl/Tk

Updated 2009-06-15 02:11:32 by FabricioRocha

Fabricio Rocha - 13 Jun 2009 Maybe you want to keep track of your expenses in a way that GnuCash can't help you. Maybe you have an apparently great idea for something that could be done on your PC but it seems that nobody thought the same before. You can imagine the interface, the dialogs. You can even imagine how nice your program would be, what other people would think of it, what about a website...

In other words: you want to create a new software. You know a little bit of Tcl/Tk and you feel it is the best tool for moving your ideas from your mind to reality. But... how to do it? Where to start? Is there a library that could help? How to use it? How to organize your code? Can you draw your own icons or would you like to find some for free? How could the interface look better? Which procedures to write first? How can you take advantage of some Tcl peculiarities? How can you leave room for future versions, how to avoid a crash if your program reaches something that you don't want to implement immediately?

There is a bunch of questions that fill your head when you feel the bite of the programming bug, but it is not so easy to find answers for them, and even professional programmers sometimes find themselves in doubts. There is a good number of coding standards guides, but much less information about software architecture and design, and the documents in this category are mostly driven to company-sized development, big databases, etc; not to the lone programmer which wants to create a little desktop or mobile application.

I propose this page in the hope that more experienced Tclers can teach and discuss with newbies and intermediate users which practices they use when creating new apps, what must be avoided, how to create good interfaces, how to keep focus on the important things, and so on. I admit I have some big struggles with some of these topics, and I believe that lots of newbies in programming find themselves doing the same questions. It should not become a coding guide like how-to-name-your-variables, nor a bunch of copied-and-pasted procs; but a more generic guide on how to go from an idea to a running software -- something which might be applied to most programming languages, but here with some special Tcl/Tk sauce. Far from being the definite cake recipe; but a good way to start.


Developing and polishing the idea

''So, when the light shines on your head, what do you do first? How to improve the idea? Do you prefer to start coding right after, or look for a similar software before trying?

Fabricio Rocha 14-Jun-2009 - When a new idea comes to my mind, I like to write it down like explaining to myself what the program should do, which should be the highlights and special features in a user's view, etc. Then the concept seems to get more organized naturally, and soon some more ideas and implementation details come. I don't know if this is really a good thing, because I feel I spend lots of time writing and planning before actually doing code; but there is a lot of people which says that planning is never lost time.


The interface

''Is it useful to create interface mockups? On paper, on a prototyping software, in Tcl/Tk itself? What must be observed in the interface design?

Fabricio Rocha 13 Jun 2009 - Paper prototyping is the first thing I use when thinking about an interface. Just get a notepad, a pencil, draw an empty window and start drawing widgets and writing tiny letters on them. I know there is a good number of people who uses Tcl/Tk itself for prototyping, and then it becomes a matter of adding backstage functionality later; but I'm still not at this stage and I really miss a visual interface designer for Tk (Visual Tcl is quite outdated).


What to consider before starting to code

Try to find if there is something like the software you want to create? Try to find libraries which might be used?


Useful tools for Tclers

This is a very common question which got a page for itself in the Tclers Wiki: are there tools which are required or would be useful when developing in Tcl?

Fabricio Rocha - 14-Jun-2009 - As many programming languages, Tcl/Tk does not really need anything more than a text editor, and the most seasoned Tclers seem to be very happy with Vi or emacs. I use Komodo Edit because of its autocompletion tips, which are really helpful when you don't have a pocket reference guide. An up-to-date GUI design tool, as I said previously, would be greatly appreciated (I am trying to create one, but it's still too far from being eligible for discussion). Debugging could be useful as well. I have tried to use RamDebugger but it didn't work. But so far the simple use of puts for checking variables in strategic code locations has been sufficient.


Files and directories

Split the code in multiple files... or not?


Development tips

Copy procedure names on paper? Run again whenever a new procedure is added?


Coding standards

There are some pages in the Wiki which go into details about programming style in the sense of making the code more readable and easy to maintain:

Tcl Style Guide

Tips for writing quality software


Using other people's code

Where to find useful code? How will the use of third-party libraries affect your coding? Do you have to tell the authors? How to distribute libraries with your software?


Documentation and website

''Which kind of documentation is needed and expected by users? How detailed must it be? Write these docs during development or just before the initial release? How to know if a website is needed, and when to create it?


Category Tutorial Category Development Category Concept