Lemmy.one
  • Communities
  • Create Post
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
cm0002@lemmy.world to Programmer Humor@programming.dev · 6 个月前

unsafeCode

lemmy.ml

message-square
13
fedilink
  • cross-posted to:
  • programmerhumor@lemmy.ml
245

unsafeCode

lemmy.ml

cm0002@lemmy.world to Programmer Humor@programming.dev · 6 个月前
message-square
13
fedilink
  • cross-posted to:
  • programmerhumor@lemmy.ml
alert-triangle
You must log in or # to comment.
  • Lucy :3@feddit.org
    link
    fedilink
    arrow-up
    25
    ·
    6 个月前

    Should return 0;.

    • Kwdg@discuss.tchncs.de
      link
      fedilink
      arrow-up
      27
      ·
      6 个月前

      Not needed, main in C++ implicitly returns 0 if there is no return

      • Lucy :3@feddit.org
        link
        fedilink
        arrow-up
        9
        ·
        6 个月前

        Should ≠ Needs to

        You can do it, and it will work, but it’s unclean and not best-practice. I wouldn’t be surprised if it’s undefined behaviour.

        • xmunk@sh.itjust.works
          link
          fedilink
          arrow-up
          22
          ·
          6 个月前

          Just to clarify. It is defined behavior - there’s plenty of undefined behavior in C but that ain’t one of them.

    • esa@discuss.tchncs.de
      link
      fedilink
      arrow-up
      22
      ·
      6 个月前

      >What is C++? A miserable huge pile of "should"s

      • shotgun_crab@lemmy.world
        link
        fedilink
        arrow-up
        8
        ·
        6 个月前

        Love me some Castlevania++

      • riodoro1@lemmy.world
        link
        fedilink
        arrow-up
        2
        ·
        6 个月前

        should have a space after „>” and two new lines after „?”.

        I guess markdown is miserable as well.

        • kboy101222@sh.itjust.works
          link
          fedilink
          English
          arrow-up
          5
          ·
          6 个月前

          Hey now, markdown serves it’s purpose. It’s not great, but as a web dev, I don’t want people expecting full WYSIWYG editors in every website cause fuck that!

        • Colonel Panic@programming.dev
          link
          fedilink
          arrow-up
          3
          ·
          6 个月前

          not being able to master markdown might hint at why the commenter is struggling with C++

      • Lucy :3@feddit.org
        link
        fedilink
        arrow-up
        1
        ·
        edit-2
        6 个月前

        Still love it tho. You can make it whatever you want!

  • onlinepersona@programming.dev
    link
    fedilink
    arrow-up
    4
    ·
    6 个月前

    Didn’t you know that C++ programmers are better than compilers at checking code for safety though? And if they aren’t, it’s a skill issue.

    /s

    Anti Commercial-AI license

    • cm0002@lemmy.worldOP
      link
      fedilink
      arrow-up
      3
      ·
      6 个月前

      It’s all worth it for that sweet sweet 50ms speedup!/s

      • The Ramen Dutchman@ttrpg.network
        link
        fedilink
        arrow-up
        1
        ·
        6 个月前

        And sensible compile times.

        I’m trying to write a game in Bevy but my laptop’s Intel 7400 taking almost a minute to compile even small changes is really killing me.
        I’ve looked up rustc compile times on different CPUs and am seriously considering getting a new laptop with a Snapdragon X Elite or something in that vein for this.

  • KindaABigDyl@programming.dev
    link
    fedilink
    arrow-up
    1
    ·
    6 个月前

    deleted by creator

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
Visibility: Public
globe

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

  • 3.25K users / day
  • 5.98K users / week
  • 9.37K users / month
  • 19.8K users / 6 months
  • 197 local subscribers
  • 25.9K subscribers
  • 1.68K Posts
  • 62.7K Comments
  • Modlog
  • mods:
  • Feyter@programming.dev
  • adr1an@programming.dev
  • BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne@programming.dev
  • BE: 0.19.7
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org