Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / programming

The Time Machine and the PWCT Visual Programming Language

5.00/5 (5 votes)
17 Mar 2013CPOL5 min read 33.6K   402  
The idea behind using the Time Machine inside Programming Without Coding Technology

Introduction

I am going to introduce the concept behind the Time Machine inside Programming Without Coding Technology (PWCT). The Time Machine is a tool inside PWCT environment with the following features:

  1. Move backward/forward during the application construction process
  2. Run programs at a point in the past
  3. Play program as movie to know how to create the program step by step
  4. Order time frames on the latest order of steps inside steps tree
  5. Refresh steps based on the latest components updates
  6. Generate documentation explains how to construct the program step by step

In this article, I am going to explain the points 1, 2 & 3.

Background

To program, you need a programming language. There are many programming languages around and most of these languages are text-based programming language like ASM, C/C++, Java, Python, Ruby, C#, PHP, ErLang, Harbour,...etc. where the code is text based and the programmer writes the code using a code editor.

Beside textual programming languages, we can use Visual Programming Environments (VPEs) like Visual Studio, Netbeans, Qt Creator,...etc. to get more productivity but we still need to deal with the text based code to complete our applications.

timemachine/v1.jpg

Fig 1. Qt Creator screen shot

timemachine/v2.png

Fig. 2 Netbeans screen shot

timemachine/v3.png

Fig. 3 Visual Studio screen shot.

Unlink textual programming languages, there are visual programming languages (VPLs) that use graphical representation to create programs instead of writing code by hand. Using visual programming language, the progammer doesn't need to write code by hand at all and the application construction process done through interaction with the GUI.

Most of the famous visual programming languages are domain specific languages like Alice, Scratch, LabView, ...etc

timemachine/v4.jpg

Fig. 4 Scratch Screen shot

timemachine/v5.jpg

Fig. 5 Alice screen shot

There are few general purpose visual programming languages like Limnor, Tersus & PWCT.

timemachine/v7.png

Fig. 6 Limnor screen shot

timemachine/v6.jpg

Fig. 7 Tersus screen shot

PWCT is a visual programming languages framework that comes with more than one visual programming languages created to push visual programming languages a step forward to be ready for use by professional and mainstream programmers.

Unlike other visual programming languages that are based on (Drag-And-Drop) method, PWCT is based on a new method called the Coding Simulation Method (CSM).

Using CSM, the application construction is done through continuous interaction with visual components, which itself is a result of interaction generate/update tree of steps which describes the program under development, the steps tree manipulation done through interaction with visual components without the need to deal directly with text based code, the code generation process are managed in the background by the visual components to hide complexity from the user and to provide easy to learn & use programming tool. The visual representation of the programs happen using traditional GUI controls (Tree, labels, textbox, listbox, etc.) to get high performance.  

To get more resources about PWCT, you can visit the project home and to test the Time Machine, you can download PWCT (Free-Open Source).

Using the Time Machine

When we run PWCT, we have the default project Start.SSF.

timemachine/p1.jpg

Fig. 8 PWCT Main Window

timemachine/p2.jpg

Fig. 9 Steps Tree (Graphical representation of programs replacement for text based code)

timemachine/p3.jpg

Fig. 10 Click the button (!) to build and run the application

timemachine/p4.jpg

Fig. 11 The Welcome application during the runtime

Using the slider beside the Time Machine button, we can move backward or forward during the application construction process.

timemachine/p5.jpg

Fig. 12 Using the slider to move forward/backward during the application construction process

timemachine/p6.jpg

Fig. 13 The steps tree at a point in the past before creating the procedure

We can run the program in the past (a point during the application construction process). For example, when we run the application in a point before creating the button event procedure.

We see that clicking the button doesn't close the application !!

timemachine/p7.jpg

Fig. 14 Running the application at a point in the past

Again, we can go forward and return to the present. When we run the application in the present at the last time frame during the application construction process, we find that clicking the button will close the application.

timemachine/p8.jpg

Fig. 15 back to the present and running the application in the present

When you open a project using PWCT, you can play this project as movie to know how to create the visual source step by step.

The playing process will start from the first step and you will see how to create/generate every step in the steps tree starting from selecting the component using components browser window and moving to entering data to the interaction pages.

You will see the results of every interaction process where after each interaction process, new steps are generated to the steps tree.

timemachine/p9.jpg

Fig. 16 Playing the program as movie to know how to create it step by step.

Playing programs as movie (steps only) will hide the construction details from the playing process and will let you concentrate on the steps generation and this is useful when you want to read and revise programs faster instead of knowing how to create the programs.

timemachine/p10.jpg

Fig. 17 Playing the program as movie (steps only without constructions details)

Points of Interest

The Time Machine can be used in education when we introduce visual programming using PWCT to the new programmers. Also, it can be used in PWCT programs debugging where it can aid in discovering bugs.

History

PWCT is a free-open source project started in Dec. 2005 and the first completed version released in 2008. The last release of PWCT is PWCT 1.8 (Smart) released in 2011 and the most advanced new feature in the release was the Time Machine which I have already explained in this article.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)