Lemmings.world
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
jroid8@lemmy.world to Programmer Humor@lemmy.ml · 2 years ago

Tests are code too

lemmy.world

message-square
80
link
fedilink
1.4K

Tests are code too

lemmy.world

jroid8@lemmy.world to Programmer Humor@lemmy.ml · 2 years ago
message-square
80
link
fedilink
  • katy ✨@lemmy.blahaj.zone
    link
    fedilink
    arrow-up
    19
    arrow-down
    5
    ·
    2 years ago

    turned out to be a semicolon

    • Zaphod@discuss.tchncs.de
      link
      fedilink
      arrow-up
      25
      ·
      2 years ago

      The tests wouldn’t even run of that was the issue, pretty sure (depends on the language I suppose)

      • Victoria@lemmy.blahaj.zone
        link
        fedilink
        arrow-up
        16
        ·
        2 years ago

        fun situations can arise when you write , instead of ; For those not in the know, in c++ the comma operator evaluates the left expression, discards the value, then evaluates the right expression and returns the value. if you now have a a situation like this

        int i = 0,
        printf("some message");
        

        i has a completely different value, since it actually uses the return value of printf instead

        • scubbo@lemmy.ml
          link
          fedilink
          arrow-up
          5
          ·
          2 years ago

          And people give Python shit for significant whitespace 😂

    • rwhitisissle@lemmy.ml
      link
      fedilink
      arrow-up
      4
      ·
      2 years ago

      And in python, no less. Sloppy.

    • rob64@startrek.website
      link
      fedilink
      arrow-up
      4
      ·
      2 years ago

      I’ll just write thousands of lines of code inside a global object… I’m sure I won’t put a semicolon where a comma should be…

      • 🇸‌🇵‌🇪‌🇨‌🇺‌🇱‌🇦‌🇹‌🇪‌🇷‌@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        edit-2
        2 years ago

        Easy solution:

        Find all: ;

        Replace with: ,

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.

  • 325 users / day
  • 469 users / week
  • 1.84K users / month
  • 10.2K users / 6 months
  • 132 local subscribers
  • 35.6K subscribers
  • 1.69K Posts
  • 36.5K Comments
  • Modlog
  • mods:
  • cat_programmer@lemmy.ml
  • AgreeableLandscape@lemmy.ml
  • BE: 0.19.11
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org