lemmyjan
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
Jeena@piefed.jeena.net to Programmer Humor@lemmy.mlDeutsch · 3 months ago

Tell me the truth ...

lemmy.ml

message-square
7
link
fedilink
2

Tell me the truth ...

lemmy.ml

Jeena@piefed.jeena.net to Programmer Humor@lemmy.mlDeutsch · 3 months ago
message-square
7
link
fedilink
alert-triangle
You must log in or register to comment.
  • Donkter@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    3 months ago

    Solution? Store 8 booleans in 1 byte.

  • Tolookah@discuss.tchncs.de
    link
    fedilink
    arrow-up
    0
    ·
    3 months ago

    I use bit masks, suck it! (Really though, programming on an embedded CPU might be reasonable to do this, depending on the situation, but on a PC, trying to not waste bits wastes time)

    • Binette@lemmy.ml
      link
      fedilink
      arrow-up
      0
      ·
      3 months ago

      exactly! it is more costly for your pc cpu to check for a bit inside a byte, than just get the byte itself, because adresses only point to bytes

      • virku@lemmy.world
        link
        fedilink
        arrow-up
        0
        ·
        3 months ago

        Store 8 bits in the same byte then 👌

        • 𝕽𝖚𝖆𝖎𝖉𝖍𝖗𝖎𝖌𝖍@midwest.social
          link
          fedilink
          arrow-up
          0
          ·
          3 months ago

          Wrong direction!

          Store only bits using word-length ints (32 bits in most modern architectures), and program everything to do math using arrays of 32 int-bits to numbers!

          • virku@lemmy.world
            link
            fedilink
            arrow-up
            0
            ·
            3 months ago

            Oh man! That took me down memory lane!

            I once had to reverse engineer a database to make an invoice integration. They had an int named flags. It contained all status booleans in the entire system. Took me a while to figure that one out.

            • 𝕽𝖚𝖆𝖎𝖉𝖍𝖗𝖎𝖌𝖍@midwest.social
              link
              fedilink
              arrow-up
              1
              ·
              3 months ago

              We’ve all been there, friend. The bit arrays can’t hurt you now.

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.

  • 38 users / day
  • 810 users / week
  • 3.62K users / month
  • 5.29K users / 6 months
  • 1 local subscriber
  • 38K subscribers
  • 484 Posts
  • 1.74K Comments
  • Modlog
  • mods:
  • cat_programmer@lemmy.ml
  • BE: 0.19.11
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org