Message Boards Message Boards

Large-scale development with Wolfram Language

POSTED BY: Leonid Shifrin
5 Replies
POSTED BY: Murray Eisenberg

Nope, view functions as intended.

The text in the post says: "Below is the code of a rudimentary viewer for a DOM structure of an HTML page". So view shows the "skeleton" of the web page DOM structure, which is occasionally handy. It was never claimed in the post that view would allow one to actually view a web page in a way similar to the web browser experience. This would've been a vastly harder problem to solve in WL, and also rather useless - if one needs to view a web page, one should just use the browser.

POSTED BY: Leonid Shifrin

Is there a best practice recommendation in regards to using global variables in large GUI development? They are extensively used in:

https://github.com/WolframResearch/draw

Since studying that code, I have started following that development approach for big GUI applications as it makes my code more modular.

POSTED BY: Gustavo Delfino

The problem with Global` variables is that they are global... :) That is, if you open draw[] twice, it will share state and interfere with each copy.

Even if your GUI will not support multiple instances / prevent its existance, it is good to wrap definitions with private context by using standard BeginPackage + Begin["`Private`"] to not run out of symbols for multiple projects / other people projects.

At the end you could use $CellContext [1] but it is not convenient, out of the box, requires deeper understanding and slightly adapted setup to work so untill you know what is the end shape of your gui, it is not worth for beginners.

  1. https://mathematica.stackexchange.com/a/102391/5478
POSTED BY: Kuba Podkalicki

enter image description here - Congratulations! This post is now a Staff Pick as distinguished by a badge on your profile! Thank you, keep it coming!

POSTED BY: Moderation Team
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract