-
This application is an excellent resource for developers to build knowledge on how to use Fyne. Unfortunately, there are almost no code comments and for someone who doesn't yet have a grasp on how Fyne works, the code can be very difficult to understand. This is a serious roadblock to getting additional developers to use the Fyne library. In main() alone, reading through the code, I wonder to myself, What is the 'content' variable? What are 'title' and 'intro'? What does the setTutorial() function do and why is it declared there? Why is the text for 'title' and 'intro' set in setTutorial() when these variables are declared outside that function? The 'tutorial' variable has a Border with a with a VBox with a Separator and lots of nil's... then there's this 'content' variable that has... what, again? How does makeNav() work? What is unsupportedTutorial()? How does the Tutorials variable in data.go work and where is it used? What exactly are those widgets in the left column, and what black magic is used to set contents in the right pane when I click on one of them? Et cetera. Thirty minutes invested in adding comments to this code that explain what is happening would make a huge difference to new developers attempting to understand how to use Fyne in their own applications. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
The questions you are asking mostly revolve around how the demo is coded and not how Fyne apps work. The demo is meant to be a visual demonstration. You can see how each tutorial works in the "tutorials" package. In this project we avoid comments in code unless they are required to explain a complex topic. If code is not readable without a comment then the code should be clearer. For example a variable called |
Beta Was this translation helpful? Give feedback.
Like Andrew said, the demo is more of a visual example of how a Fyne application feels and what it can do. If you are interested in starting our development with Fyne it is a better option to start looking at https://docs.fyne.io/.
I am also of the opinion that well written code more or less shouldn't have to be commented. I'm sure there are parts of the demo that can be improved and made clearer but I don't think adding comments everywhere would help much from a learning experience.