Lemmy LIETUVA
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
Binette@lemmy.ml to Learn Programming@programming.devEnglish · 2 years ago

Is it better to check if a file exists before trying to load it, or to try to load it, and catch the error and move on?

message-square
message-square
0
link
fedilink
1
message-square

Is it better to check if a file exists before trying to load it, or to try to load it, and catch the error and move on?

Binette@lemmy.ml to Learn Programming@programming.devEnglish · 2 years ago
message-square
0
link
fedilink

For context, I am trying to do a save system for a game.

alert-triangle
You must log in or # to comment.

Learn Programming@programming.dev

learn_programming@programming.dev

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !learn_programming@programming.dev

Posting Etiquette

  1. Ask the main part of your question in the title. This should be concise but informative.

  2. Provide everything up front. Don’t make people fish for more details in the comments. Provide background information and examples.

  3. Be present for follow up questions. Don’t ask for help and run away. Stick around to answer questions and provide more details.

  4. Ask about the problem you’re trying to solve. Don’t focus too much on debugging your exact solution, as you may be going down the wrong path. Include as much information as you can about what you ultimately are trying to achieve. See more on this here: https://xyproblem.info/

Icon base by Delapouite under CC BY 3.0 with modifications to add a gradient

Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 1 user / day
  • 6 users / week
  • 17 users / month
  • 58 users / 6 months
  • 0 local subscribers
  • 2.18K subscribers
  • 59 Posts
  • 32 Comments
  • Modlog
  • mods:
  • Ategon@programming.dev
  • JaumeI@programming.dev
  • bugsmith@programming.dev
  • BE: 0.19.18
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org