Beehaw
  • Communities
  • Create Post
  • search
    Search
  • Login
  • Sign Up
orhtej2 ( orhtej2@eviltoast.org )  to Programmer Humor@programming.devEnglish · 1 year ago

Peak code reuse

eviltoast.org

message-square
12
link
fedilink
272

Peak code reuse

eviltoast.org

orhtej2 ( orhtej2@eviltoast.org )  to Programmer Humor@programming.devEnglish · 1 year ago
message-square
12
link
fedilink
alert-triangle
You must log in or # to comment.
  • meme_historian ( meme_historian@lemmy.dbzer0.com ) 
    link
    fedilink
    English
    arrow-up
    40
    ·
    1 year ago

    stupid comic style drawing of a snake with a derpy face eating its own tail

  • katy ✨ ( cupcakezealot@piefed.blahaj.zone ) 
    link
    fedilink
    English
    arrow-up
    40
    ·
    edit-2
    1 year 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 ( Malix@sopuli.xyz ) 
      link
      fedilink
      arrow-up
      17
      ·
      1 year ago
      isOdd(-1);
      
      • dev_null ( dev_null@lemmy.ml ) 
        link
        fedilink
        arrow-up
        1
        ·
        1 year ago

        deleted by creator

    • moseschrute ( moseschrute@piefed.social ) 
      link
      fedilink
      English
      arrow-up
      9
      ·
      1 year ago

      Maybe memo just to be safe, but LGTM!

    • dependencyinjection ( dependencyinjection@discuss.tchncs.de ) 
      link
      fedilink
      arrow-up
      6
      ·
      1 year ago

      isOdd(10000001);

      • katy ✨ ( cupcakezealot@piefed.blahaj.zone ) 
        link
        fedilink
        English
        arrow-up
        12
        ·
        1 year ago

        this incident has been reported

  • a14o ( a14o@feddit.org ) 
    link
    fedilink
    arrow-up
    37
    ·
    1 year ago

    To fix this, add if(num == 255) return true; before line 10.

  • HappyFrog ( HappyFrog@lemmy.blahaj.zone ) 
    link
    fedilink
    arrow-up
    33
    ·
    1 year ago

    Will this ever return? Won’t it just overflow the stack?

  • FiskFisk33 ( FiskFisk33@startrek.website ) 
    link
    fedilink
    arrow-up
    16
    ·
    1 year ago

    https://www.npmjs.com/package/is-even

    don’t look at the weekly downloads if you are faint of heart.

    • Hawk ( Hawk@lemmy.dbzer0.com ) 
      link
      fedilink
      English
      arrow-up
      5
      ·
      1 year ago

      If you really want to see some horror, follow the dependencies

  • OpenStars ( OpenStars@piefed.social ) 
    link
    fedilink
    English
    arrow-up
    14
    ·
    1 year ago

    Boss: don’t spend any time on it, just vibe code a solution.

    You: sure, I enjoy receiving a salary, what could go wrong?

  • FiskFisk33 ( FiskFisk33@startrek.website ) 
    link
    fedilink
    arrow-up
    6
    ·
    1 year ago
    isEven(0) ->
        true;
    isEven(Num) ->
        isOdd(Num-1).
    isOdd(0) ->
        false;
    isOdd(Num) ->
        isEven(Num-1).
    
  • humanspiral ( humanspiral@lemmy.ca ) Banned
    link
    fedilink
    arrow-up
    2
    ·
    edit-2
    10 months ago

    Removed by mod

  • guthib_net ( guthib_net@programming.dev ) Banned
    link
    fedilink
    arrow-up
    1
    ·
    edit-2
    1 year ago

    Removed by mod

  • guthib_net ( guthib_net@programming.dev ) Banned
    link
    fedilink
    arrow-up
    1
    ·
    edit-2
    1 year ago

    Removed by mod

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
    • If the mod doesn’t find it funny, you’re banned. Ha-ha!.. For real: do not use the community for “statements”. There are other places for such content. Keep it chill and funny.
Visibility: Public
globe

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

  • 301 users / day
  • 1.45K users / week
  • 3.18K users / month
  • 7.37K users / 6 months
  • 463 local subscribers
  • 33.4K subscribers
  • 1.52K Posts
  • 25K Comments
  • Modlog
  • mods:
  • Feyter ( Feyter@programming.dev ) 
  • adr1an ( anzo@programming.dev ) 
  • BurningTurtle ( BurningTurtle@programming.dev ) 
  • Pierre-Yves Lapersonne ( pylapp@programming.dev ) 
  • BE: 0.19.15
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code