9
kiki
27d

If you were a code antipattern, what would it be?

I'm definitely NIH -- "Not Invented Here".

I write everything from scratch. When I don't, more often than not, I don't install code deps -- I copy their code and modify it. I port it to my set of utils, my syntax preferences, optimize it, strip parts and modes I don't need, and at the end there's no clear line between what was my code and what wasn't. My code doesn't import, it absorbs.

Comments
  • 6
    I've suffered from clean code for many many years

    Finally sober, enjoying my YAGNI code
  • 5
    @12bitfloat wow. I spent so much time convincing people that uncle bob is a moron that I basically gave up. Clean code to software engineering is what tailwind is to css -- cancer.
  • 4
    @kiki Don't stop the fight my girl

    Many people still need convincing
  • 5
    I also prevent dependencies by writing myself. It also feels good that you know exactly what is happening. It's just clean and you know that it keeps working.
  • 2
    Big ball of mud?
  • 2
    Mine would be GOTO statements.
  • 3
    @Chewbanacas nothing wrong with goto statements - tsoding. I agree with him tbh. There are just fine use cases.
  • 1
    Legacy code :D
  • 1
    @retoor then lets say, so many goto statemenrs that its logic , let alone proper function becomes unprovable
  • 2
    I spend waaaaay too much time optimizing stuff that doesn't need it.

    I've been slowly chipping away at the pipeline speed just because it annoys me. Got it down from ~60 to ~12 mins now. Whilst still keeping all the insanity it does. still seething it isn't sub 1 minute yet.

    Spending time refactoring code just to use less memory, saving literally bytes, I work in PHP btw, so you wouldn't even feel the speed increase.
  • 2
    @rootshell 200ms for me
  • 2
    @kiki damn.
    To be fair when I came in it was an big ubuntu image being rebuild multiple times without caching most of the test hit an real database. Azure CR is used to cache image with code.
    It's still mostly terrible but I've fixed all the tests that randomly break and made it faster while keeping all the insanity. Though all the compiling is now done in a base image, the pipeline was set up like an schoolproject, its still terrible but even if I do everything in my power I'm not sure I can get it to sub 2 mins tbh. I'm closing in on 10 minutes runtime but its a shit show the actual deployment is done by an bash script via ssh from an external party.
  • 2
    @rootshell I think it’s because we just have different stacks. I use node + es modules frontend. I don’t have tests, I don’t have a bundler, I don’t use docker. My build toolchain is just minifying js with terser, minifyjng css with csso, and html with some tool I can’t remember. That’s it.
  • 1
    @kiki yeah that does sound a bit faster then having to compile crap, multiple docker images being build etc.
    Still any pipeline longer then 5 mins isnt a good pipeline imo since it slows you down when speed matters.
    I have had multiple times where a demo didnt work and I was like. I'll report back when it does work due to it being so slow. Which looks foolish in front of clients imo.
  • 2
    @rootshell agree! you go man, good luck

    (you'll need it :D)
Add Comment