August 3, 2014

IDE and Debugging Function Comparison between esProc and Perl and Python

esProc, Perl, and Python are all the scripting language for data analysis and processing. However, they differ in syntax style, function and features, applicable scenarios, and IDE. Some differences are quite obvious. Of all these differences, IDE determines the development efficiency and how easy can the beginner cross the threshold. This article discusses this difference emphatically in this aspect regarding these three languages. Overall function, script edit function, and debugging function.

1Object comparison

Perl
    Runtime environment version: 5.16.2
    Runtime environment can be downloaded at:                 http://www.activestate.com/activeperl/downloads
    IDE name and version: Komodo IDE        8.5
    IDE can be downloaded at: http://komodoide.com/download/
Python
    Runtime environment version: 3.3.4
    Runtime environment can be downloaded at: https://www.python.org/download
    IDE name and version: PyCharm Community Edition 3.1.3
    IDE can be downloaded at: http://www.jetbrains.com/pycharm/download/
esProc
    IDE name and version: 3.1
    IDE can be downloaded (including runtime environment) at: http://www.raqsoft.com/esproc-download.html

Description: Many IDE support Perl, including those open source and offered free, and commercial versions. They are of various qualities. In this article, we choose the relatively popular Komodo IDE 8.5, which is the commercial software introduced by Activestate company.
Still, there are also many IDE support Python. Even the Komodo IDE also supports Python. In this article, we use PyCharm mainly because of the popularity, stability, international languages, and other factors. In addition, even the free version of PyCharm provides the debugging function, which is superior to Komodo in this aspect.
The runtime environment of esProc can be downloaded alone. Alternatively, users can directly download IDE because the IDE for free version has already incorporated the runtime environment.
In order to have a clear view, the language name in the below text is equivalent to the corresponding IDE.

2. Overall function comparison

These three IDE are all of the GUI type. Each function zone can be recognized easily. In the below chart, the most frequently used function zones are identified emphatically.

Perl
Python
esProc
Common points:
1.  The three languages all provide the basic elements for programing, including script zone, debug zone, and output zone.
2.  The three languages all provide tabs for users to edit multiple files at the same time.
3.   The three languages all provide the common script edit functions such as copying, pasting, canceling, and searching.
4.   The three languages all have the complete debugging function.
5.   The three languages all support the result output to console, database, and file.
Comparison:
1.  Overall layout. Perl and Python layouts are complex with relatively more functions, while esProc layout is simple with relatively less functions.
2.  As for the script style, Perl and Python are designed with the row-style script, while esProc is designed with the grid-style script.
3.  As for the IDE output style, Perl and Python focuses on console text, and esProc focuses on table and list.

3.Script edit function comparison

The script edit involves a few items below: Distinguish code properties by fonts, automatic syntax verification, code block collapse, code block indentation hint, auto-completion, function help, and computing result printout. In the following sections, we will write the scripts of the same function to compare the script edit function of these three types of IDE.

Since the detailed script algorithm is not important, we simply outline it, as shown below: Please make statistics on the sales volume of each department based on the sales.txt and employee.txt. Of which, EmployeeID is the associated field/column between these two files, Department is in the employee.txt, and employeeSales is in the sales.txt.

Perl
1. Distinguish code properties by fonts. The keywords, variables, constants, and comments are respectively presented in different fonts, clear and understandable at one glance.
2. Automatic syntax verification. This is a powerful function and quite useful for beginners. For example, since the row 31 is not properly written, IDE marks it with wavy line automatically. Programmers can simply put mouse pointer on the wavy line to view the hint in details.


To view all syntax verification results, click the "Grammar verification status" label below. In the below section, a few lines of scripts are written with errors purposefully to test the results: 

3.  Collapsing code block: There is a collapse button near the left row number , which can be used to collapse the code block and make the overall structure more clear. For example, collapse all code blocks, and the result would be like this:


4. Code block indentation hint. There are 5 vertical dash lines from row 14 to row 27, which clearly indicates the standardized indentation position to remind the programmer of writing the code up to the standard.

5.  Auto-completion function: IDE will auto-complete the whole function structure when programmers typing in the function name and press Tab key. For example, write WHILE and press down Tab key. The below contents will appear:
6.  Function help:
Perl does not have the true function help though, several workaround can barely implement this function.
Method 1: Function description: Hold down CTRL and then move the pointer to function. The function description will appear without any return value, parameter description, or examples. For example:

Method 2: Google search. Select function and hold down Shift+F1. IDE will open the browser of the operating system, and search for this function with Google, as shown below:

Method 3: Local manual search. Programmers can open the local Help from the Help menu, and press Ctrl+F to enter the keyword. The result is as follows:
It is obvious that none of the tree methods is convenient enough.
7.  Print the computing result.
The formal computing result will usually be output to file or database. Programmers will verify the result in the IDE. In the Perl, the computing result can be printed to the output console: 
Python
1. Python also uses different fonts to distinguish code properties, which is as easy-to-use as Perl does.
2. Automatic syntax verification. Python also provides the automatic syntax verification with the same wavy line indication. By pressing CTRL + F1, we can view the hint contents, as shown below:
Unlike Perl, Python does not provide the tab for syntax verification status. However, on the right side, we can still view the error summary clearly. This is similar to Eclipse. For example, if writing two lines of erroneous scripts on purpose, two red short lines will appear on the right, as shown below:
As for the automatic syntax verification, each of Python and Perl has its own merit. In my opinions, Python is more intuitive and convenient.
3. Code block collapsing. Although Python allows for code block collapsing, it is invalid for the FOR statement, but valid for the FROM statement which requires the collapse to the least. This function of Python has little practical value and worse than that of Perl.
4. Code block indentation hint. This IDE does not provide the code block indentation hint, and it is not as convenient as Perl.
5.   Auto-completion function. As long as the first few letters are typed-in, the IDE will give the candidate words.
If adding a full stop behind the object, the members of object can be listed directly, as shown below:
As for the auto-completion function, Python is more convenient than Perl.
6. Function help: Python provide much more convenient function help than that of Perl.
Hold down CTRL and put the mouse pointer on the function. The help for this function will appear, as shown below:
7. Computing result output
Like Perl, Python also allows for printing the computing result to the console by scripting, as shown below:
As can be seen, the output syntax of Python is much simpler than that of Perl. But the result is presented in a less friendly way than that in Perl. The data would become messy if there are plenty. To convert the Python output formate to table or list, composing more complex script is required.
esProc
1. esProc also uses different fonts to distinguish code properties, which is as easy-to-use as Perl and Python does. However, in esProc, only the comments, constants, and expressions can be distinguished. The esProc expressions can not be further classified to function name and variable name. What a pity.
2.  Automatic syntax verification. esProc does not offer the automatic syntax verification, which is inferior to Perl and Python in this regard. For example, if we write a statement with error in B2 cell intentionally, no hint will appear in IDE, as shown below:
The hint only appears when executing:
3. Code block collapsing. This IDE provides the code block collapse function which is at the same level to Perl and more practical than Python. Since the original algorithm is rather simple, and there is too few codes in IDE, we are unable to see the collapse effect. So, let's change to a complex syntax to demonstrate it, as shown below:
On the row 4, there is a collapse mark . Once clicked, the FOR statement will collapse, as shown below:
4. Code block indentation hint. esProc puts its script in a grid, and the grid line can be regarded as the natural indentation mark. The code is clear and easy-to-read without having to spare extra effort to lay out or align. The work scope of esProc code can be indicated clearly with the grid indentation. That is more convenient and much easier to read than the bracket adopted in Perl, and more intuitive than the Tab in Python. The indentation error can basically be avoided. Take the multi-level indentation in the below figure for example:
For the FOR statement in the A8 cell, the work scope is the indented cells B8-D23. Since A24 is not indented, the cell holds the next statement which is parallel to the FOR statement. By the same principle, the work scope of the IF statement in the B11 cell is from C12 to D17.
In Python, indentation is also used to represent the work scope. But the manual indentation is error prone. Programmers may easily confuse it with the continuous spaces and Tab. In addition, the indentation of Python brings a side effect: In Python, multiple statements are not allowed to put in a same row, while this restriction does not exit in esProc.
5. Auto-completion function. esProc does not have the auto-completion function and is inconvenient than Python in this regard
6.  Function help. The function help of esProc is similar to Python, which is much more convenient than that of Perl. Take the join function in the A2 cell for example. Simply put the cursor at the function name, and press “Alt+down arrow“ to view the description, return value, parameter, and parameter options for the join function.
7. Print the computing result. It is most comfortable to print the computing result in esProc. esProc is the grid-style script. The code is written in the cell. By clicking the cell, you can view the execution result in this cell, as shown below:
As can be seen, programmers are not required to write the code purposefully when printing the computing result in esProc. The data will be presented in a form fit for data type, for example, 2 dimension table, multilevel list, and single value. In comparison of this function, esProc is more friendly than Perl and Python.

Findings:
1. Distinguish code properties by fonts. These three IDE support this function well. By comparison, esProc is a bit inferior to them. To implement the same function, esProc script is much simpler. So, there will not be many confusions in reading.
2. Automatic syntax verification. Both Perl and Python support this function, and Python is a bit stronger, while esProc does not support this function.
3.  Code block collapsing. These three IDE support this function well. By comparison, Perl and esProc is more practical than Python.
4. Code block indentation hint. esProc is more convenient and intuitive than Perl, while Python does not provide the indentation hint at all.
5. Auto-completion function. Python provides the full support, and Perl is relatively poorer, while esProc does not provide the auto-completion function.
6. Function help. esProc and Python provide the perfect support, while Perl need improving in this aspect.
7.Print the computing result. Regarding the support, esProc is the best, while Python and Perl are almost at the same level.
Analysis:
Perl is a tool of traditional code line with support for the basic functions. Although not good enough in the function help, auto-completion, and output, the coding is not affected much.
Python makes some innovations on the traditional code lines: Use Tab indention to indicate the work scope with the concise syntax and hidden pointer. So, the length of code line in Python is a bit shorter than that in Perl. Although Python is not good enough regarding the indented hint and printout, they have less impact on coding.
esProc is a new grid-style code that represents the work scope using the intuitive grid indentation. Owing to this, esProc syntax is more concise, the esProc code for implementing the same function is several times shorter than that of Python. esProc also provide the fairly dedicated support for data processing. The data types of esProc include the common 2 dimension table objects and the multilevel list (generic set). The esProc functions and syntax are designed for the massive data. The result is presented in a way adapting to the data type automatically. One thing worthy noticing is that there is still great room for esProc to improve in the auto syntax verification and automatic completion. The lack in these two aspects could presently bring a certain degree of troubles to the usability.

4.Debugging comparison

In the practical development procedure, the bug debugging is usually more time-consuming than coding. So, it is one of the most important functions of IDE, and the key points of the comparison.
Perl
1.Debug and control functions. Perl provides the debugging and control functions, such as run to break point, run to cursor, step into, and step out. For example, set the break point to the 14th row. The result is as follows:
2.Monitoring variable.
There are many methods for monitoring variables in the Perl. First: View directly in the code zone by placing the mouse pointer to a certain variable in the code zone. IDE will hint the value of this variable directly. Take the @empArray variable in the row 12 for example:
This method is relatively intuitive, but the variable value is not completely displayed, appearing somewhat meaningless in practical use. To view the complete variable value, we need to take the second method. View in the variable list.
The only advantage of this method is that users can have a full view of the variable value. In other aspects, this method are disadvantageous. Take the complicated operations for example. Variables must be expanded to view the value. The variable @empArray as an example must be expanded for three times. For another example, the data monitoring is so inconvenient that users can neither view the row data transversally nor the column data vertically. This is a far cry from the structured data and extremely unfriendly. Take the below figure for example:

There is still another disadvantage for this method. Too many useless temporary variables distract the programmers’ attention seriously. For another example, only 2 variables are really useful to the row 14: @sales and @empArray. But the variable list lists 9 variables under Locals, and 6 variables under Globals, in addition to the 13 variables under Special. As can be imaged, how serious the interferences from the temporary variables could be when the program runs to the row 57 and puts to an end. To minimize the interference, we need to take the third method: watch.

In the section below, we will add @sales and @empArray to the Watch zone, as presented below:
As can be seen, the Watch function remedies some drawbacks of variable list to ensure that key variables can be free from the interferences of temporary variables. If Perl can improve the syntax agility, then it is certain that number of the temporary variables can be reduced fundamentally.
3. Temporary expression parsing. In debugging, we are often required to resolve the temporary expression outside the code. For example, view the second record of the variable @empArray, or the second field of the second record. In the watch window, this function is implemented, as shown below:
Perl supports this function well.

Python
1. Debug and control function. Python also provides the complete debug and control function. Similarly, we set the break point at a similar function as that in Perl, the result is shown below:
2. Monitoring variable.
The variable monitoring method for Python is similar to that for Perl. Method 1: View directly in the code zone. Move the mouse pointer to the empArray variable to view the variable value, as shown below:
Similar to Perl, the complete variable value cannot be monitored with this method. However, on clicking on the variable value, the complete variable value will expand in the window, as shown below:
2 dimension table! This is the very desired variable monitoring style to meet our very requirement. As can be seen, in Python, the variable value is almost the same as the structured data in the database or txt file. Although the vertical column is poorly aligned and there is no column name, it is quite convenient to view transversally. Judging from this point, Python is more friendly than Perl, and more convenient than program debugging.
Then, check out the method 2: View in the variable list.
In Python, variable can be viewed by simply expanding it once, which is more convenient than that in Perl, as shown below:
As can be seen, the variable list of Python solves two defects of Perl: Operation is complex, and variable presentation is not friendly. However, there are also quite a few useless temporary variables in the variable list of Python, which is similar to Perl.
The method 3 can solve the variable interference. The watch function of Python is shown below:
3. Temporary expression parsing
Python provides the convenient temporary expression parsing. For example, view the second record of the variable @empArray, or the second field of the second record.
Python also offers good support in this respect. In addition, because the variable presentation of Python is friendlier than that of Perl. So, the practical using experience of Python will also be better.

esPro
1. Debugging and control function. esProc provides the functions such as run to break point, run to cursor, step-by-step, and other debugging. But there is no step-into and step-out available. Fortunately, the step into/out can be replaced with step-by-step and run-to-cursor. So, not great inconvenience would be incurred. In addition, esProc code is concise. Since most loop statements in esProc can be replaced with functions, seldom would step into/out be used.
In esProc, the break point is set on the cells. Once set, the cell will be in pink, and the statement to which the program reaches will be in blue. For example, the breakpoint can be set at the similar location as that in Perl, and then enter the debug mode, as shown below:
2.  Monitoring variable. The variable monitoring method of esProc is more friendly than that for Perl/Python. Method 1: View in the code zone directly. Click the cell in esProc to view the cell value on the right, and the cell name is just the temporary variable name. For example, click the cell B1 - the temporary variable of B1 equals to the empArray in Python and Perl.
The variable value will be displayed to the full, as can be seen here. They are auto-sized and rendered in the form of tables. Because it is a table, a typical table has a column name, with row and column being aligned automatically. So, viewing in esProc is much convenient than that in Python and Perl.
Method 2: View in the variable list. The variables like A1 and B1 are temporary variables, not requiring the definition to make the reference directly. But for the meaningful variable, a name can be defined. For example, the associated computing result in A1 is named as data. Take the below figure for example:
As can be seen, there is no unnecessary temporary variables on the variable list of esProc. Every variable on list is meaningful. So, no such case as messy Perl/Python variables affecting each other would happen in esProc. Simply click once to view the esProc variable. For operation, it is as convenient as Python and much stronger than that of Perl. The variable is displayed as 2 dimension table with column name, which is more convenient than Python.
Method 3: watch. Watch is mainly used to reduce the interference of temporary variables. Therefore, the watch window is not required. Judging from this point, although esProc offers few functions, it is more convenient than Perl and Python, because those functions that esProc reduced are just the vulnerability and patches of Perl and Python.
3. Temporary expression parsing. Similarly, esProc supports the temporary expression parsing in the debug mode. For example, to get the first record of B1, we can directly write the expression in B2, or click on the Calculate cell button on the tool bar. The result is shown below:
You can define a variable to display in the variable list. For example, to define the field Name of the first record as name1, just type the below contents in B6: =name1=B1(1).Name. The result is:
As can be seen, the temporary expression parsing of esProc has the similar features to Python, and ever more stronger than Perl. Because esProc can use the table to adapt to and render the computing result, the actual user experience of esProc is better than that of Python.
Findings:
Debugging and control function. Perl and Python provide more complete debugging function. esProc lacks the step in/out, but the actual experiences does not differ greatly.
Monitoring variable. esProc is obviously superior to Python, and Python is more convenient than Perl.
Temporary expression parsing. esProc and Python are at the same level. Both are easier-to-use than Perl. The practical user experience of esProc is better than that of Python.
Analysis:
The grid-style of esProc is very characteristic. Users are not required to define the temporary variables. By doing so, the use of variable name can be reduced dramatically. The variable list becomes clear and practical, and patches such as watch window becomes unnecessary. esProc supports the structured 2 dimension table object, especially fit for the massive data processing, and more convenient for the variable monitoring. esProc code is more concise and further refined, resulting in smaller coding and debugging workload. Plus, esProc provides a great many loop functions to replace most loop statements, making the complex control method like step in/out unnecessary.
Python is a tool of traditional line-style code. There is an improvement, but somewhat redundant still. So there are quite a few unnecessary temporary variables, requiring the watch window to filter out the key variables. The variable monitoring of Python is convenient, allowing for the direct variable value monitoring, and presenting the data in a structured 2 dimension table.
Perl offers the traditional line-style code. The temporary variable is as messy as that of Python. A great deal of time is wasted on coding and debugging. It is not convenient to view the Perl variable, the operation is complex, and the display is not friendly enough. In the respect of temporary expression parsing, there are still some obstacle for Perl to overcome.

No comments:

Post a Comment