Ask a Question

Does anyone has any experience in building new framework to test UI application using python

Colin_McCrae
Community Hero

Re: Does anyone has any experience in building new framework to test UI application using python

I haven't used the TC IDE with Python, but the indentation use is deliberate.

 

Python is designed to work this way.

 

https://www.python.org/dev/peps/pep-0008/

 

It is meant to encourage neat code design. And stop spaghetti code. Which I guess it does as spaghetti code in Python quickly becomes unreadable.

 

I guess if you REALLY wanted visual separators, you could always just use comments?

AlexKaras
Community Hero

Re: Does anyone has any experience in building new framework to test UI application using python

Hi Colin,

 

> Python is designed to work this way.

Yes, I know this.

This talk is, actually, out of scope, so quick comment without the intention for the discussion. 🙂

It is my personal opinion that not bad idea (code visual clarity) was implemented in an average way. The worst thing is that if for some reason (poor web page formatting, different editors, any other reason) original indentation of your code is broken, it is not easy task to restore it (which is equivalent to restore of the code logic). With the majority of other languages (Pascal, C, Java... Even VB) this is a matter of automated formatting.

In addition, personally I had a lot of inconveniences because of this Python feature. The case that I am used to use temporary debug logging. Especially in cases when debugger is not available. (E.g. TestExecute or Python without IDE set up.) To have those temporary debug logging statements to be easily identifiable later, I used to put them at the very beginning of the line. This is fast and makes those temporary lines of code visually quickly identifiable. Obviously, this approach does not work with Python and I had to indent those temporary statements and mark them with some comment to be able to identify them later. (BTW, I don't like automatic formatting in Visual Studio because of the same exact reason.)

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
cancel
Showing results for 
Search instead for 
Did you mean: