Lemmy Mengsk
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
orhtej2@eviltoast.org to Programmer Humor@programming.devEnglish · 19 hours ago

Peak code reuse

eviltoast.org

message-square
21
fedilink
291

Peak code reuse

eviltoast.org

orhtej2@eviltoast.org to Programmer Humor@programming.devEnglish · 19 hours ago
message-square
21
fedilink
  • katy ✨@piefed.blahaj.zone
    link
    fedilink
    English
    arrow-up
    33
    ·
    edit-2
    15 hours ago
    bool isOdd(int num) {  
    	const oddNumbers = [];  
    	for (let i = 1; i <= 10000000; i += 2) {  
      		oddNumbers.push(i);  
    	}  
    	if (oddNumbers.includes(num) {  
    		return true;  
    	}  
    }  
    
    • Malix@sopuli.xyz
      link
      fedilink
      arrow-up
      10
      ·
      16 hours ago
      isOdd(-1);
      
      • dev_null@lemmy.ml
        link
        fedilink
        arrow-up
        1
        ·
        16 hours ago

        deleted by creator

    • moseschrute@piefed.social
      link
      fedilink
      English
      arrow-up
      9
      ·
      edit-2
      16 hours ago

      Maybe memo just to be safe, but LGTM!

    • dependencyinjection@discuss.tchncs.de
      link
      fedilink
      arrow-up
      4
      ·
      14 hours ago

      isOdd(10000001);

      • katy ✨@piefed.blahaj.zone
        link
        fedilink
        English
        arrow-up
        6
        ·
        13 hours ago

        this incident has been reported

    • marcos@lemmy.world
      link
      fedilink
      arrow-up
      2
      ·
      14 hours ago

      You should make it oddNumbers.includes(num%10000000)…

    • schema@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      14 hours ago

      And if not, unicorns!

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.03K users / day
  • 4.35K users / week
  • 8.76K users / month
  • 19.3K users / 6 months
  • 1 local subscriber
  • 26.3K subscribers
  • 1.39K Posts
  • 33.5K Comments
  • Modlog
  • mods:
  • Feyter@programming.dev
  • adr1an@programming.dev
  • BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne@programming.dev
  • BE: 0.19.8
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org