Skip Navigation
Programming Horror

Welcome to Programming Horror!

This is a place to share strange or terrible code you come across.

For more general memes about programming there's also Programmer Humor.

Looking for mods. If youre interested in moderating the community feel free to dm @[email protected]

Rules

  • Keep content in english
  • No advertisements (this includes both code in advertisements and advertisement in posts)
  • No generated code (a person has to have made it)

Credits

  • Icon base made by Lorc under CC BY 3.0 with modifications to add a gradient
Members
2,147
Posts
40
Active Today
5
Created
2 yr. ago
  • Programming Horror @programming.dev
    dosuser123456 @lemmy.sdf.org

    average dosuser123456 code formatting...

    im sorry for how bad this looks. yes this is actually what most of my code looks like, yes the minified parts were like that by hand, yes this is painful to look at to a point where i think this is the best place for it. yes, it actually works, at least. also yes there really are 0 comments as to wtf this shit is.

    (i mean, theres no rule banning code you wrote yourself...only ai generated, but this was made by hand)

     css
        
    @font-face{
      src: url('https://files.catbox.moe/vtsy6k.ttf');
      font-family: "msdos";
    }
    *{background-color:#222222 !important;font-family:"msdos"!important;color:#fff!important;image-rendering:pixelated;animation:textShadow 1.6s infinite;}
    textarea{background-color:#fff!important;color:#000!important;animation:none!important;}
    
    textarea::selection {
      background-color: #000 !important;
      color: #fff !important;
    }
    
    @keyframes flicker {
      0% {
        opacity: 0.27861;
      }
      5% {
        opacity: 0.34769;
      }
      10% {
        opacity: 0.23604;
      }
      15% {
        opacity: 0.90626;
     
      
  • Programming Horror @programming.dev
    dullbananas (Joseph Silva) @lemmy.ca

    Creator of Python has "

    <BODY BGCOLOR="#FFFFFF" TEXT="#000000">

    " on his personal website

  • Programming Horror @programming.dev
    Sleepless One @lemmy.ml

    Party with your BFF like it's 99

    A story from my day job. I submitted it to the Daily WTF. Fingers crossed that they'll accept it.


    In order to facilitate development of frontend apps that rely on my employer's antediluvian monolith codebase, a team of developers at the company came up with a backend for frontend (BFF) service that would allow developers on other teams (such as mine) to quickly make frontends that use the monolith's logic and data. The service uses a schema-driven UI approach, where developers make forms by specifying the input elements (along with some related layout and validation logic, also schema-driven) using JSON schemas. This also includes specifying classes on the element for styling purposes. Who wants hot reloading when tweaking styles for a frontend app when you can instead make a JSON schema in a separate DotNET codebase that needs to be compiled (this is sarcasm)? As gross as that aspect is though, it is not today's WTF.

    Right after lunchtime today, I saw a post

  • Programming Horror @programming.dev
    Kissaki @programming.dev

    nmake cancel

    ffaattaall eerrrroorr UU11005588: : tteerrmmiinnaatteedd bbyy uusseerr

  • Programming Horror @programming.dev
    ad_on_is @lemm.ee

    Bruh!

    imgur.com imgur.com

    Discover the magic of the internet at Imgur, a community powered entertainment destination. Lift your spirits with funny jokes, trending memes, entertaining gifs, inspiring stories, viral videos, and so much more from users.

    imgur.com
  • Programming Horror @programming.dev
    bigboismith @lemmy.world

    Found this beauty in one of my old projects from school

  • Programming Horror @programming.dev
    Sjmarf @sh.itjust.works

    mallocPlusAI

  • Programming Horror @programming.dev
    Admiral Patrick @dubvee.org

    With modern tools, you have to try very hard to do something stupid, because the tools (rightly) recognize you’re doing something stupid. [Andreas Karlsson] can speak to that first hand as he tried to get four billion if statements to compile.

    You may ask what state space requires four billion comparisons to evaluate? The answer is easy: the range of an unsigned 32-bit integer. The whole endeavor started with a simple idea: what if instead of evaluating whether an integer is even or odd with a modulo or bit mask, you just did an if statement for every case? Small ranges like 0-10 are trivial to write out by hand, but you reach for more automated solutions as you pass 8 bits and move towards 16. [Andreas] wrote some Python that outputs a valid C program with all the comparisons. For 16 bits, the source only clocks in at 130k lines with the executable less than 2 MB.

    Of course, scaling to 32 bits is a very different problem. The source file balloons to 330 GB, and most compilers ba

  • Programming Horror @programming.dev
    Mac @programming.dev

    string.lower implementation

  • Programming Horror @programming.dev
    JackbyDev @programming.dev

    Everything has admin access, a storytime post

    I have no idea how to title this post. Oh well.

    A few years back I worked somewhere that had a large breach. Many practices changed in the wake of it. Developers actually had admin access prior to the change which was very nice. In an effort to restrict access but also let folks do their jobs they deployed some tool that would start all programs that "needed" admin access as an admin. This included cmd for the devs. So every time I opened cmd I had to be careful not to break something since there was no way to launch it without admin access after that change.

  • Programming Horror @programming.dev
    GregorTacTac @lemm.ee

    Average CSS

    cross-posted from: https://lemm.ee/post/36467447

    I am not allowed to credit the site that has this disaster. Its owner said "Nobody should see that"

  • Programming Horror @programming.dev
    Aatube @kbin.melroy.org

    code golfing hurrah

  • Programming Horror @programming.dev
    Aatube @kbin.melroy.org

    C++23 has fixed space!

  • Programming Horror @programming.dev
    drsensor @programming.dev

    float as table id

  • Programming Horror @programming.dev
    frozen @lemmy.frozeninferno.xyz

    Who needs a commit message, anyway?

    I was looking through various RCON tools and found this. Someone does not like commit messages.

  • Programming Horror @programming.dev
    stale_cheetos @sh.itjust.works

    Almost had to mark this one NSFW

    For those unfamiliar with JS: subValue (the first argument in the forEach callback) is the value contained at arr[index].

  • Programming Horror @programming.dev
    blotz @lemmy.world

    PSD is not my favourite file format.

     undefined
        
    // At this point, I'd like to take a moment to speak to you about the Adobe PSD 
    // PSD is not a good format. PSD is not even a bad format. Calling it such would be an
    // insult to other bad formats, such as PCX or JPEG. No, PSD is an abysmal format. Having
    // worked on this code for several weeks now, my hate for PSD has grown to a raging fire
    // that burns with the fierce passion of a million suns.
    // If there are two different ways of doing something, PSD will do both, in different
    // places. It will then make up three more ways no sane human would think of, and do those
    // too. PSD makes inconsistency an art form. Why, for instance, did it suddenly decide
    // that *these* particular chunks should be aligned to four bytes, and that this alignement
    // should *not* be included in the size? Other chunks in other places are either unaligned,
    // or aligned with the alignment included in the size. Here, though, it is not included.
    // Either one of these three behaviours would be fine. 
      
  • Programming Horror @programming.dev
    Aatube @kbin.social

    Wikipedia's "official" newspaper's formatting

    Jesus Christ, just add an if statement for even or odd!

  • Programming Horror @programming.dev
    sus @programming.dev

    With the power of python, there is an easier way