Code Monkey home page Code Monkey logo

Comments (7)

tylerecouture avatar tylerecouture commented on May 27, 2024 1

I think the error explanations are going to be one of the most unique parts of this course. Thank you for this amazing resource!

Do you think it would help to add code examples to the "How to fix this" section? A before and after, error and fixed, similar to what you have under the "Show solution" in the first error lesson. Maybe code examples of some of the most common causes of the error?

image

from learn-gdscript.

generrosity avatar generrosity commented on May 27, 2024 1

I find it funny the first error tutorial logically shows how indentation works, but symantically is an entirely missing codeblock ( eg if I was writing up several functions headers at the same time and missing one 'pass').

Big question: How much feedback would you like on explainations?

You are our tutors ๐Ÿ’š I find the screenshot above backwards - its starts with using the same terminology as the error, only then explaining the term. Of course, could be helped appending the words followed by uncommented code, at a minimum 'pass' or 'return' ; and I could see how you could show this with an image and full whitespace markers. I could imagine an optional view so tutor types could get the error code to help feedback.

I personally love writing cheatsheets and explainations - but in the field scripting is quite different to tutoring or writing a Godot plugin

from learn-gdscript.

YuriSizov avatar YuriSizov commented on May 27, 2024

@tylerecouture It can be quite hard to give code samples. At least for now, errors are grouped logically, but their exact cause can be very different. We may re-classify them into different groups based on feedback, but it can be rather impractical to uniquely describe each error message (there are over 300 of them for the GDScript parser). So giving an error example can mislead a student when it's generic enough but their code and their error is very specific.

from learn-gdscript.

Xananax avatar Xananax commented on May 27, 2024

The case of the second exercise is interesting, because it's an immediate reminder that even explaining an error is not enough to provide guidance to a complete beginner.

The error is an indentation on, because comments are ignored. However for a human, the error is "forgetting to remove the # character" (related: #66).

There are two solutions to this, none of which are exactly simple to set up:

  1. Get the error's context (surrounding lines) and put that through a set of heuristics, human-made checks, Levenshtein, etc, and provide a "did you mean X?" functionality. Elm does this, and the user experience is fantastic as a result.
  2. Provide a (possibly external) thesaurus of Godot errors, with a list of what they might mean. This list would also support user comments, so it stays updated and live with as many use cases as possible. The PHP docs do this with mild success.

I think both options are good, but each individually probably exceeds the scope of that particular application (though the second may be externally developed, and simply linked to). They also probably exceed what the UI is able to fit.

I am not sure how to solve this.

For our purposes, we can craft specific messages. For example, for exercise 2 ("Your First Error") we could custom-craft an explanation that explains why the parser sees indentation. We can also, on @pycbouh's suggestion, add to the lesson some text explaining how parsers are stupid and are not always going to point at the right mistake.

from learn-gdscript.

YuriSizov avatar YuriSizov commented on May 27, 2024

Just for the record, when I said "parsers are stupid", I meant it in the most literal way possible. ๐Ÿ™ƒ It's in their nature to work off of an idea of perfectly formatted input string and fail at a sight of an issue. Sometimes they bork in a seemingly random place and report an issue that is not helpful to the user.

I guess that's what the lesson may explain.

from learn-gdscript.

generrosity avatar generrosity commented on May 27, 2024

I think taking the angle of 'parsers are stupid' is a good one - specifically that it is pattern matching. There is an obvious pattern in (colon)(return)(tab)(codeblock) and pointing out the pattern is broken more than trying to generate possible solutions.

Again I like graphics - I could see an image in this style with the explicit spacing and highlighting being useful. (dim unhighlighted code) (yellowhighlighter around :: (colon)(return)(tab)(codeblock) )
image

from learn-gdscript.

NathanLovato avatar NathanLovato commented on May 27, 2024

@generrosity feedback is always welcome.

Regarding content, we especially need feedback from absolute beginners: which help message helped them solve their problem? Which didn't? With examples of the error code and what they tried.

Regarding content, that's the most valuable kind of feedback for us, even though we'll still take everyone's.

from learn-gdscript.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.