Lemmini.fi
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
git [he/him, comrade/them]@hexbear.netM to programming@hexbear.netEnglish · 1 month ago

4 billion if statements

andreasjhkarlsson.github.io

external-link
message-square
7
link
fedilink
27
external-link

4 billion if statements

andreasjhkarlsson.github.io

git [he/him, comrade/them]@hexbear.netM to programming@hexbear.netEnglish · 1 month ago
message-square
7
link
fedilink
I recently stumbled upon this screenshot while researching social media on the train. Of course, it was followed by a cascade of spiteful comments, criticizing this fresh programmer’s attempt to solve a classical problem in computer science. The modulus operation.
  • RaisedFistJoker [she/her]@hexbear.net
    link
    fedilink
    English
    arrow-up
    4
    ·
    1 month ago

    casts my mind back to ace lewis https://github.com/AceLewis/my_first_calculator.py/blob/master/my_first_calculator.py

    • gay_king_prince_charles [she/her, he/him]@hexbear.net
      link
      fedilink
      English
      arrow-up
      3
      ·
      1 month ago

      Somehow, I’m most offended by the lack of “else” here which takes it from O(n) to O(1)

programming@hexbear.net

programming@hexbear.net

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: [email protected]
  1. Post about programming, interesting repos, learning to program, etc. Let’s try to keep free software posts in the c/libre comm unless the post is about the programming/is to the repo.

  2. Do not doxx yourself by posting a repo that is yours and in any way leads to your personally identifying information. Use reports if necessary to alert mods to a potential doxxing.

  3. Be kind, keep struggle sessions focused on the topic of programming.

Visibility: Public
globe

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

  • 4 users / day
  • 1 user / week
  • 16 users / month
  • 217 users / 6 months
  • 1 local subscriber
  • 290 subscribers
  • 78 Posts
  • 156 Comments
  • Modlog
  • mods:
  • Llituro [he/him, they/them]@hexbear.net
  • git [he/him, comrade/them]@hexbear.net
  • BE: 0.19.13
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org