Just some dude.

  • 0 Posts
  • 22 Comments
Joined 2 years ago
cake
Cake day: June 11th, 2023

help-circle


  • Mak'@pawb.socialtoProgrammer Humor@programming.devYes, But...
    link
    fedilink
    English
    arrow-up
    29
    arrow-down
    2
    ·
    4 months ago

    …HTTP is a high level application protocol and its errors are supposed to be around access to resources…

    I’ve had fellow developers fight me on this point, in much the same way as your parent post.

    “If you return a 404 for a record not found, how will I know I have the right endpoint?”

    You’ll know you have the right endpoint because I advertised it—in Open API, in docs, etc.

    “But, if /users/123 returns a 404, does that mean that the endpoint can’t be found or the record can’t be found?”

    Doesn’t matter. That resource doesn’t exist. So, act appropriately.








  • I think you’ve already gotten some good answers here regarding the function itself:

    It sits and waits for the user to input something and hit Enter, and returns the value the user entered, which is then assigned to your nam variable. (See the documentation for the function.

    I might also offer the advice of confirming your understanding of the flow of a program. That is, understand that, in the general sense, the computer must resolve the right-hand side of the equals sign to a value before it can assign it to the left.

    For example, if the right-hand side is a literal value, it’s already resolved. For example, a line like name = “Joe” is easy—assign the string literal “Joe” to the variable name, when the line is run.

    If the right hand side is a mathematical equation, it must be resolved to a value when the line is run. For example, for a line like value = 2+2, the 2+2 must be resolved to 4 before it can be assigned to the variable.

    Then, for something like name = input(“Who are you?”), in order to resolve the right-hand side, the computer must first run the function before it can assign a value to the variable name.

    It can, of course, get more complicated, where you can call multiple functions on a line, and the results of one feed into the next, and so on. But, that can be an exercise for the near future.








  • I feel like this really the killer feature.

    I’ve seen a ton of digital ink spilled on all manner of positives, such as how amazingly-portable it is, or how it’s been doing wonders for the advancement of Linux gaming.

    But, I’ve yet to see anybody—outside you—speak about how amazing the suspend/resume is. And, that for me, is the reason why I play on a SteamDeck almost exclusively these days—even though I have a small collection of games I can play on Mac. I have such small windows of opportunity, and appreciate I can still play a game, even for a little as a few minutes.