Beehaw
  • Communities
  • Create Post
  • search
    Search
  • Login
  • Sign Up
JPDev ( JPDev@programming.dev )  to Programmer Humor@programming.dev · 3 years ago

ifn't

programming.dev

message-square
44
link
fedilink
414

ifn't

programming.dev

JPDev ( JPDev@programming.dev )  to Programmer Humor@programming.dev · 3 years ago
message-square
44
link
fedilink
alert-triangle
You must log in or # to comment.
  • T. Hex ( 0x0@lemmy.dbzer0.com ) 
    link
    fedilink
    arrow-up
    124
    ·
    3 years ago

    I propose a new, more threatening kind of control flow.

    do {
      /* something */
    } or else {
      /* you don't want to find out */
    }
    
    • Homosexual sapiens ( Strawberry@lemmy.blahaj.zone ) 
      link
      fedilink
      arrow-up
      28
      ·
      3 years ago

      this is just a menacing try/catch!

    • moody ( moody@lemmings.world ) 
      link
      fedilink
      arrow-up
      13
      ·
      3 years ago

      It_would_be_a_shame_if(condition)

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

      It exists, kind of. Python has this construct

      for item in iterable:
          ...
      else:
           ...
      

      which always puzzles me, since it depends on a break statement execution. I always have to look it up when the else block is executed.

    • OpenStars ( OpenStars@startrek.website ) 
      link
      fedilink
      English
      arrow-up
      5
      ·
      3 years ago

      You just made me a offer I can’t refuse. I go now to sleep with the fishes…

    • Mesa ( Mesa@programming.dev ) 
      link
      fedilink
      arrow-up
      5
      ·
      3 years ago

      The better try-catch. More intuitive if you ask me.

    • rothaine ( rothaine@beehaw.org ) 
      link
      fedilink
      English
      arrow-up
      4
      ·
      3 years ago
      do {
        /* something */
      } do hast {
        /* something */
      }
      
      • T. Hex ( 0x0@lemmy.dbzer0.com ) 
        link
        fedilink
        arrow-up
        6
        ·
        3 years ago
        do {
          /* something */
        } do hast {
          /* something */
        } do hast mich {
          /* something */
        }
        
  • OpenStars ( OpenStars@startrek.website ) 
    link
    fedilink
    English
    arrow-up
    65
    ·
    3 years ago

    Please God let this be a humorous post that somehow does not also find a way to manage to come true…

    • jtk ( jtk@lemmy.sdf.org ) 
      link
      fedilink
      English
      arrow-up
      49
      ·
      3 years ago

      I would have bought it if they said ifnot instead, it’s the same number of characters and wouldn’t require a major parser overhaul to support keywords with a ’ in the name.

      • Pup Biru ( pupbiru@aussie.zone ) 
        link
        fedilink
        arrow-up
        26
        ·
        3 years ago

        i mean, “unless” tends to be the usual term for an “if not” keyword in languages that implement such a thing

        • Fal ( Fal@yiffit.net ) 
          link
          fedilink
          English
          arrow-up
          15
          ·
          3 years ago

          Which is awful and incredibly confusing. I hate ruby

          • msage ( msage@programming.dev ) 
            link
            fedilink
            arrow-up
            3
            ·
            3 years ago

            And Perl

            • NigelFrobisher ( NigelFrobisher@aussie.zone ) 
              link
              fedilink
              arrow-up
              3
              ·
              3 years ago

              And my axe!

          • Pup Biru ( pupbiru@aussie.zone ) 
            link
            fedilink
            arrow-up
            3
            ·
            3 years ago

            totally agree; just saying that if it’s GOT to be something, that something should probably be unless… unless . . .

          • frezik ( frezik@midwest.social ) 
            link
            fedilink
            arrow-up
            2
            ·
            3 years ago

            I find that you need to choose carefully when to use it. Simple cases tend to be alright. Larger, more complex conditions shouldn’t touch it.

      • OpenStars ( OpenStars@startrek.website ) 
        link
        fedilink
        English
        arrow-up
        12
        ·
        3 years ago

        Yeah, to be clear, I don’t like it, I don’t like it one bit:-P.

    • mryessir ( mryessir@lemmy.sdf.org ) 
      link
      fedilink
      arrow-up
      1
      ·
      edit-2
      2 years ago

      deleted by creator

      • OpenStars ( OpenStars@startrek.website ) 
        link
        fedilink
        English
        arrow-up
        2
        ·
        3 years ago

        Gulp…

         [link]

        Also, just for fun, the prequel:

  • MagicShel ( MagicShel@programming.dev ) 
    link
    fedilink
    arrow-up
    48
    ·
    3 years ago

    Reduce exclamation marks!? Great Scott!!! Is there a shortage of punctuation in the future!?

    • KairuByte ( KairuByte@lemmy.dbzer0.com ) 
      link
      fedilink
      arrow-up
      13
      ·
      3 years ago

      You could have saved two, all you had to do was use the interrobang. You’re a monster.

    • SubArcticTundra ( SubArcticTundra@lemmy.ml ) 
      link
      fedilink
      arrow-up
      9
      ·
      3 years ago

      All known deposits were depleted

  • janabuggs ( janabuggs@beehaw.org ) 
    link
    fedilink
    arrow-up
    30
    ·
    3 years ago

    I’m struggling to understand if this is true or ifn’t true

  • taanegl ( taanegl@beehaw.org ) 
    link
    fedilink
    arrow-up
    24
    ·
    3 years ago

    I’m just hoping this paves the way to code with Southern dialect

    iffun is == true
    iffun ain't == false
    
    • timetravel ( timetravel@lemmings.world ) 
      link
      fedilink
      arrow-up
      21
      ·
      3 years ago

      May I introduce you to the joys of #define and creating your own horrible sub language

      • frezik ( frezik@midwest.social ) 
        link
        fedilink
        arrow-up
        6
        ·
        3 years ago

        That reminds me of an old paper about how to create a compilable C program out of old game ROMs. Decompile to assembly. Implement a bunch of #define statements that implement all the ASM statements. Now compile it to a native binary on whatever platform.

        Won’t likely be faster or more accurate than regular emulation methods, but it’s a neat idea considering that the source code on all this stuff was lost a long time ago.

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

    Why not just ifnot? Same count of characters but an o instead of a possibly problematic single quote.

    • Ferk ( Ferk@kbin.social ) 
      link
      fedilink
      arrow-up
      12
      ·
      edit-2
      3 years ago

      Yes… how is “reducing exclamation marks” a good thing when you do it by adding a ' (not to be confused with , ´,‘or’` …which are all different characters).

      Does this rely on the assumption that everyone uses a US QWERTY keyboard where ! happens to be slightly more inconvenient than typing '?

  • xia ( xia@lemmy.sdf.org ) 
    link
    fedilink
    English
    arrow-up
    20
    ·
    3 years ago

    “Help’s with readability”? You know what else helps? Not using contractions and introducing an unbalanced single quote.

    • bdonvr ( bdonvr@thelemmy.club ) Banned
      link
      fedilink
      arrow-up
      25
      ·
      3 years ago

      If they’d’nt’ve done that, it’d’ve been better. Agreed.

      • Cwilliams ( Cwilliams@beehaw.org ) 
        link
        fedilink
        arrow-up
        3
        ·
        3 years ago

        they’d’nt’ve

        Aside: rip Tom Scott

    • survivalmachine ( survivalmachine@beehaw.org ) 
      link
      fedilink
      arrow-up
      3
      ·
      3 years ago

      This feels racist against Appalachia. We naturally speak with contractions and are commonly referred to as “unbalanced”.

    • frezik ( frezik@midwest.social ) 
      link
      fedilink
      arrow-up
      3
      ·
      3 years ago

      Runs havoc on parsing, too. It’s bad for both humans and robots. I say we ship it.

  • jtk ( jtk@lemmy.sdf.org ) 
    link
    fedilink
    English
    arrow-up
    11
    ·
    3 years ago
    ifn't (myNum don't= 3 && myStr ain'tnull'rblankish)
    
    • SubArcticTundra ( SubArcticTundra@lemmy.ml ) 
      link
      fedilink
      arrow-up
      5
      ·
      3 years ago

      I hate seeing colloquial terms like ‘ain’t’ in non-comment (ie. standardized) parts of code

  • vlad ( vlad76@lemmy.sdf.org ) 
    link
    fedilink
    arrow-up
    8
    ·
    3 years ago

    What’s wrong with “else”

    • NekkoDroid ( NekkoDroid@programming.dev ) 
      link
      fedilink
      arrow-up
      29
      ·
      3 years ago

      It’s not ifn't

    • Darkassassin07 ( Darkassassin07@lemmy.ca ) 
      link
      fedilink
      English
      arrow-up
      3
      ·
      3 years ago

      if(condition) {#block never used} else {#actually do a thing}

      Vs

      ifn't(condition) {#actually do a thing}

      Vs

      if!(condition) {#actually do a thing}

      • gandalf_der_12te ( gandalf_der_12te@feddit.de ) 
        link
        fedilink
        arrow-up
        2
        ·
        3 years ago

        vs

        if (not condition) {#actually do a thing}

    • MNByChoice ( MNByChoice@midwest.social ) 
      link
      fedilink
      arrow-up
      2
      ·
      3 years ago

      Cannot start a statement with else. One can with ifn’t. There is a new thing where we don’t branch (which is a separate discussion).

      Or am I missing the joke…

  • tiredofsametab ( tiredofsametab@kbin.social ) 
    link
    fedilink
    arrow-up
    7
    ·
    3 years ago

    die unless $keyword == “unless”;

    • DieguiTux8623 ( DieguiTux8623@feddit.it ) 
      link
      fedilink
      arrow-up
      1
      ·
      edit-2
      2 years ago

      deleted by creator

  • fl42v ( fl42v@lemmy.ml ) 
    link
    fedilink
    arrow-up
    6
    ·
    3 years ago

    This has to be illegal. I mean, it’s basically suicide incitement (or whatever is the phrase for it)

  • luciole (he/him) ( luciole@beehaw.org ) 
    link
    fedilink
    arrow-up
    4
    ·
    3 years ago

    I shan’t!

  • max ( max@lemmy.blahaj.zone ) 
    link
    fedilink
    arrow-up
    2
    ·
    3 years ago

    ;-;

  • lordmauve ( lordmauve@programming.dev ) 
    link
    fedilink
    arrow-up
    2
    ·
    3 years ago

    Python already has this.

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.

  • 507 users / day
  • 1.3K users / week
  • 3.19K users / month
  • 7.22K users / 6 months
  • 463 local subscribers
  • 33.4K subscribers
  • 1.52K Posts
  • 25K Comments
  • Modlog
  • mods:
  • Feyter ( Feyter@programming.dev ) 
  • adr1an ( anzo@programming.dev ) 
  • BurningTurtle ( BurningTurtle@programming.dev ) 
  • Pierre-Yves Lapersonne ( pylapp@programming.dev ) 
  • BE: 0.19.15
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code