Beehaw
  • Communities
  • Create Post
  • search
    Search
  • Login
  • Sign Up
Lena ( lena@gregtech.eu )  to Programmer Humor@programming.dev · 1 day ago

What the fuck javascript

gregtech.eu

message-square
23
link
fedilink
251

What the fuck javascript

gregtech.eu

Lena ( lena@gregtech.eu )  to Programmer Humor@programming.dev · 1 day ago
message-square
23
link
fedilink
  • Lupie ( Lupie@sopuli.xyz ) 
    link
    fedilink
    arrow-up
    11
    ·
    1 day ago

    No, it should not be an error. If you’re making a calculator and your user enters 1/0, your program should not have the propensity to crash; the result should simply be NaN and you should choose how you display that result to your user.

    • treadful ( treadful@lemmy.zip ) 
      link
      fedilink
      English
      arrow-up
      5
      ·
      1 day ago

      You talk like error handling isn’t a thing.

      • anewfox ( anewfox@lemmy.zip ) 
        link
        fedilink
        arrow-up
        7
        ·
        1 day ago

        fun fact: getting NaN from a numeric calculation is the error that you handle. if this wasn’t obvious, please don’t write code for anyone but yourself. hope this helps.

        • treadful ( treadful@lemmy.zip ) 
          link
          fedilink
          English
          arrow-up
          1
          ·
          23 hours ago

          NaN is a primitive value, not an Error.

          >> typeof 1 / "a"
          "number" 
          

Programmer Humor@programming.dev

programmer_humor@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: !programmer_humor@programming.dev

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics
    • If the mod doesn’t find it funny, you’re banned. Ha-ha!.. For real: do not use the community for “statements”. There are other places for such content. Keep it chill and funny.
Visibility: Public
globe

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

  • 809 users / day
  • 2.76K users / week
  • 5.18K users / month
  • 8.36K users / 6 months
  • 465 local subscribers
  • 34.1K subscribers
  • 1.66K Posts
  • 27.4K Comments
  • Modlog
  • mods:
  • Feyter ( Feyter@programming.dev ) 
  • adr1an ( anzo@programming.dev ) 
  • BurningTurtle ( BurningTurtle@programming.dev ) 
  • Pierre-Yves Lapersonne ( pylapp@programming.dev ) 
  • BE: 0.19.21
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code