Beehaw
  • Communities
  • Create Post
  • search
    Search
  • Login
  • Sign Up
GandhiTheDerg ( GandhiTheDerg@pawb.social )  to Programmer Humor@lemmy.ml · 3 years ago

Personally I prefer throw new nullpointerexception

pawb.social

message-square
44
link
fedilink
321

Personally I prefer throw new nullpointerexception

pawb.social

GandhiTheDerg ( GandhiTheDerg@pawb.social )  to Programmer Humor@lemmy.ml · 3 years ago
message-square
44
link
fedilink
  • lowleveldata ( lowleveldata@programming.dev ) 
    link
    fedilink
    arrow-up
    4
    ·
    3 years ago

    I have never used System.exit() or sys.exit(). What is a use case where you would call these explicitly?

    • niq ( niq@discuss.tchncs.de ) 
      link
      fedilink
      arrow-up
      22
      ·
      3 years ago

      For example if you want to set an explicit exit code. Calling python scripts will usually result in an exit code 0 after the script is run. If you want to set a different exit code for example 1 to indicate some error occured you can do that via sys.exit(1).

      Same thing applies to other languages of course.

    • ℛ𝒶𝓋ℯ𝓃 ( name_NULL111653@pawb.social ) 
      link
      fedilink
      arrow-up
      4
      ·
      3 years ago

      exit()-ing your step-sys already seems pretty explicit…

Programmer Humor@lemmy.ml

programmerhumor@lemmy.ml

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: !programmerhumor@lemmy.ml

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

  • Posts must be relevant to programming, programmers, or computer science.
  • No NSFW content.
  • Jokes must be in good taste. No hate speech, bigotry, etc.
Visibility: Public
globe

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

  • 1 user / day
  • 41 users / week
  • 45 users / month
  • 1.57K users / 6 months
  • 871 local subscribers
  • 43.7K subscribers
  • 1.25K Posts
  • 10.3K Comments
  • Modlog
  • mods:
  • AgreeableLandscape ( AgreeableLandscape@lemmy.ml ) deleted by creator
  • cat_programmer ( cat_programmer@lemmy.ml ) 
  • BE: 0.19.21
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code