Quick Question Static Analysis Upcoming Survey
by matthias.hauswirth@usi.ch
Dear all,
Hello! We are back! We have only three short points today: a quick question, a reflection on why you are probably already using static analysis without realizing it, and a teaser about a survey awarding an SBB-CFF-FFS voucher.
## Quick Question: Which IDE do you use?
If you teach Python programming, could you take one minute to help us greatly? Which IDEs do you use in your classes?
Please answer here:
https://usi.qualtrics.com/jfe/form/SV_86rQe17aOrq6Qlw
## Static Code Analysis
You’re in an IDE, you press the “Run” button, and your Python program runs. But, as you probably know, the IDE can already do some checks even *before* running the code, even when the program is not yet “in action”. These checks are known as static analysis. Static code analysis can be helpful, because it provides early feedback to programmers. We recently added static analysis support to the PyTamaro Web platform, and we started releasing the first improvements:
Improved Error Display: We now uniformly indicate errors with red wiggly underlines and consistently show error messages in red tooltips right above the broken code. When a runtime error occurs, it is reported below the code and with a sticky tooltip starting with a bolt icon.
Realtime Syntax Error Checking: We check code for syntax errors already before execution, while you are typing. This way you get immediate feedback (red wiggly underline, tooltips on hovering). We know whether code is syntactically correct, at any time, and we could have disabled the “Run” button for code with syntax errors. However, we still want to allow the basic Python experience of receiving SyntaxErrors at runtime. Thus, if you click “Run” for broken code, we point out the problem (“This code contains a syntax error, are you sure you want to run it?”), but we allow you to run the erroneous code anyways.
Improved Syntax Coloring: We improved the syntax highlighting in the editor to reflect four fundamental distinct kinds of tokens: keywords in bold black, comments in italic gray, string literals in gold, and number and boolean literals in green.
Supporting Randomness: For performance reasons, in the past we used to cache the results of program executions and serve you the cached result if you ran a piece of source code that already had been run before (by you or anyone else). Moreover, you could not click on the “Run” button multiple times, unless you changed the code. This was annoying if you wanted to run the same code multiple times, for example for programs using random numbers.
We now expanded our servers and eliminated the caching. The “Run” button is always enabled, improving your experience if you want to run code that produces random numbers. Here are two fun examples to try out, both simulate rolling a die:
Example 1: Simple textual example: get a random number from 1 to 6 and print it:
https://chk.me/6ImEwdx
Example 2: Graphical animation of rolling a die:
https://chk.me/HFWRYCU
## Pre-Announcement: Upcoming Survey on Python Errors
We are currently designing a new study about Python errors. It will be fully anonymous and will be open to every high school informatics teacher in Switzerland, and like last year we plan to provide an SBB-CFF-FFS voucher to all participants who complete the survey. Look out for an invitation in the next LuCE News.
Greetings from the Canton of snow-capped mountains and palm trees,
Matthias and the LuCE team
PS: You can find this and the previous message in our mailing list archive:
https://lists.usi.ch/mailman3/hyperkitty/list/luce-news@lists.usi.ch/
If you would like to unsubscribe from our list, or if you would like to update your email address, simply let me (Matthias.Hauswirth(a)usi.ch) know. You also can do it yourself here:
https://lists.usi.ch/mailman3/postorius/lists/luce-news.lists.usi.ch/
3 weeks, 2 days