okr765
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
cm0002@lemmy.world to Programmer Humor@programming.dev · 3 months ago

unsafeCode

lemmy.ml

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

unsafeCode

lemmy.ml

cm0002@lemmy.world to Programmer Humor@programming.dev · 3 months ago
message-square
13
fedilink
  • cross-posted to:
  • programmerhumor@lemmy.ml
alert-triangle
You must log in or register to comment.
  • Lucy :3@feddit.org
    link
    fedilink
    arrow-up
    25
    arrow-down
    1
    ·
    3 months ago

    Should return 0;.

    • Kwdg@discuss.tchncs.de
      link
      fedilink
      arrow-up
      27
      arrow-down
      1
      ·
      3 months ago

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

      • Lucy :3@feddit.org
        link
        fedilink
        arrow-up
        9
        arrow-down
        9
        ·
        3 months ago

        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
          ·
          3 months ago

          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
      arrow-down
      2
      ·
      3 months ago

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

      • shotgun_crab@lemmy.world
        link
        fedilink
        arrow-up
        8
        ·
        3 months ago

        Love me some Castlevania++

      • Lucy :3@feddit.org
        link
        fedilink
        arrow-up
        1
        ·
        edit-2
        3 months ago

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

      • riodoro1@lemmy.world
        link
        fedilink
        arrow-up
        2
        arrow-down
        1
        ·
        3 months ago

        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
          ·
          3 months ago

          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
          ·
          3 months ago

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

  • onlinepersona@programming.dev
    link
    fedilink
    arrow-up
    4
    arrow-down
    2
    ·
    3 months ago

    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
      ·
      3 months ago

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

      • The Ramen Dutchman@ttrpg.network
        link
        fedilink
        arrow-up
        1
        ·
        3 months ago

        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
    ·
    3 months ago

    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.

  • 1.16K users / day
  • 4.32K users / week
  • 8.46K users / month
  • 17.7K users / 6 months
  • 1 local subscriber
  • 23.2K subscribers
  • 1.17K Posts
  • 34K Comments
  • Modlog
  • mods:
  • Feyter@programming.dev
  • adr1an@programming.dev
  • BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne@programming.dev
  • BE: 0.19.9
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org