There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

programmer_humor

This magazine is from a federated server and may be incomplete. Browse more on the original instance.

mac , in Welcome to the wonderful world of code obfuscation
@mac@programming.dev avatar

Image Transcription: Meme


[Paneled meme with a brain that gets increasingly glowing]


[The brain is smaller than the skull]


<span style="color:#323232;">if dayOfWeek.name == "Sunday" || dayOfWeek.name == "Saturday"
</span><span style="color:#323232;">    weekend = true
</span>

[The brain is glowing in some areas]


<span style="color:#323232;">if dayOfWeek &lt; 2 || dayOfWeek > 6
</span><span style="color:#323232;">    weekend = true
</span>

[The brain is shooting out rays of light]


<span style="color:#323232;">weekend = !((dayOfWeek - 1) % 6)
</span>

I am a human volunteer who transcribes posts to improve accessibility on programming.dev and you could be one too! !transcribing

RenegadeTwister , in Merge then review

deleted_by_author

  • Loading...
  • MashedTech ,

    Modern agile is just waterfall with steps.

    DrMango ,

    Wait… waterfall is waterfall with steps 🤔

    MashedTech ,

    Agile just adds routines and extra steps

    DaveedMee , in GoOn
    @DaveedMee@beehaw.org avatar

    127.0.0.1

    baseless_discourse , in Oh yea, that's the good stuff **huffs glue**

    Is this how you do Fin in peasant languages?

    Knusper ,

    No, not at all. It’s a joke post, abusing the in-memory representation of the Option type to construct numbers. When nesting the Option type, it turns into a densely packed bit vector…

    And if I understand the purpose of Fin correctly, you’re picking on the one ‘peasant language’ that actually has something like that built-in.
    In Rust, you can specify the type of an array as e.g [u8; 3]. Which is an array containing values of type u8 (unsigned 8-bit integer) with a fixed, compile-time-guaranteed length of 3. So, [u8; 3] could be used to represent an RGB color, for example.
    It is an array, not a set, but well, close enough.

    baseless_discourse , (edited )

    Fin is a type of finite oridinals bounded by a nat. For example the WTF type in there is the same type as Fin 8.

    Of course every language can have Fin with a fixed integer, like the post suggest, by just stacking options.

    However for a properly defined Fin type, the input number is dynamic, serves as a bound for the element of the type. For example, Adga was able to type the fact that nth fibonacci number is a finite ordinal bounded by a function of n. Which I believe is not typable in rust?

    MurdoMaclachlan , (edited ) in Oh yea, that's the good stuff **huffs glue**
    @MurdoMaclachlan@lemmy.world avatar

    Image Transcription: Code


    [Transcriber’s note: the first line in the following transcription is incorrect. After the equals, there should be eight instances of the word “Option”, each succeeded by a less-than symbol, then two brackets, like (), before the first greater-tha symbol. However, if you type a less-than symbol on Lemmy, it seems to strip that symbol and whatever word comes next out of the source when you save the comment.]

    
    <span style="color:#323232;">type Wtf = Option>>>>>>>;
    </span><span style="color:#323232;">let two = Some(Some(Some(Some(Some(Some(None))))));
    </span><span style="color:#323232;">let three = Some(Some(Some(Some(Some(None)))));
    </span><span style="color:#323232;">let six = Some(Some(None));
    </span><span style="color:#323232;">unsafe {
    </span><span style="color:#323232;">    assert_eq!(
    </span><span style="color:#323232;">        std::mem::transmute::(two) * std::mem::transmute::(three)
    </span><span style="color:#323232;">        std::mem::transmute::(six)
    </span><span style="color:#323232;">    );
    </span><span style="color:#323232;">}
    </span>
    

    I am a human who transcribes posts to improve accessibility on Lemmy. Transcriptions help people who use screen readers or other assistive technology to use the site. For more information, see here.

    Oha ,

    Good Human

    pkill ,

    Good human, but why not use tesseract though? I mean it works quite well with monospace fonts

    MurdoMaclachlan ,
    @MurdoMaclachlan@lemmy.world avatar

    Still needs to be checked over to make sure it didn’t get anything wrong. In my experience the mistakes AI make with monospace fonts tend to be very awkward to notice (like 1 and l and I and | being interchanged), so I’d have to go over with a fine tooth comb which, for me, since I type quickly, isn’t noticeably faster and is a lot more boring.

    silencioso , in Merge then review

    Before everyone loses their minds, in Extreme Programming there are safeguards other than PR reviews. Before you submit a PR, you are supposed to have written the tests and to have written your code with pair programming, so your code already has some safety measures in place. On top of that, when you merge and deploy, more tests are run, and only if all of them are green do your changes go into production.

    agilob OP ,
    @agilob@programming.dev avatar

    you are supposed to have written the tests and to have written your code with pair programming,

    I commented out the tests because they were failing, pipelines were green so I merged. Now it’s running on prod. What do you do?

    silencioso ,

    Fire you for destroying the tests. It’s intentional sabotage.

    Blackthorn ,

    I would fire you for incompetence and sabotage. Problem solved.

    pomodoro_longbreak ,
    @pomodoro_longbreak@sh.itjust.works avatar

    Give you public kudos for moving fast and breaking things. We need more fearless cowboys like you around here

    MeanEYE ,
    @MeanEYE@lemmy.world avatar

    You lost me at “pair programming”. Having tests for what you can test is fine. But there’s code that simply can’t be tested, or at least not easily at which point you are just wasting time. Open source mantra is always great in my opinion… release early, release often. In addition to that have a test version of your software before you push it to production if there’s sensitive data. That’s usually good enough to catch issues.

    And he’s right, reviewing changes before merge just takes time and resources away from project while the master branch keeps moving. Merge, if there are issues, whoever submitted the change is obliged to fix it. You can always checkout earlier version.

    dbilitated ,
    @dbilitated@aussie.zone avatar

    I just made a github action that merges anything updated in master into feature branches automatically. you get pinged if there’s a conflict but the automerge keeps drift to a minimum so it’s less common and fixed sooner.

    better than merging poorly tested/reviewed code.

    and yeah, a small team of superstars doesn’t need reviews so much, but most teams have a range of devs with different levels of experience and time working with particular parts of a large codebase. Someone more senior or more expert derisks people picking up tickets and improves code quality.

    it also leads to plenty of good conversations about the best way to implement, so overall it’s a win.

    MeanEYE ,
    @MeanEYE@lemmy.world avatar

    Well, Git was designed to branch out, not be a single repo with bunch of users. So one team can have a local repo, that in turn gets merged into big one, etc. Structure matters as you say. Small experienced teams move fast. Big teams require a lot of management and supervision. I still think it’s better to split people up into small teams and give individual tasks, or let them pick tasks that need to be done.

    redcalcium ,

    Pair programming? Then the code is already reviewed.

    hglman ,

    Yes, that’s part of the point. Dumping all at once into a merge and asking people to comprehend it all isn’t particularly realistic.

    SVcross , in Merge then review
    @SVcross@lemmy.world avatar

    Didn’t knew KenM was on LinkedIn.

    ISometimesAdmin , in Welcome to the wonderful world of code obfuscation
    @ISometimesAdmin@the.coolest.zone avatar

    Depending on whether this code is in a hotpath (and considering how "elementary" it is, I figure that's a possibility), this could very well be a significant speed improvement.

    Though I'd say that only excuses it if it's truly an elementary function (and not one line as part of a larger function), as otherwise it's unreadable garbage. But on its own it:

    • has a clear purpose
    • (presumably) isn't reimplementing functionality
    • is easily tested
    • can be modified with no side effects (besides breaking your calendar, but that's beside the point)
    DroneRights OP ,

    It’s one line as part of a larger function. Also, it doesn’t actually say weekend, it just executes some other functionality if !(day % 6). I made it more readable so that everyone here could understand what it does

    HiddenLayer5 , in GoOn

    Name every protocol

    QuazarOmega ,
    • TCP
    • UDP
    stringere ,

    UDP

    I’d love to tell you a joke about UDP but I’ll never know if you get it.

    QuazarOmega ,
    • TCP
    • UDP

    (Yes, this is a TCP joke)

    doctorcrimson , (edited ) in GoOn

    ipv4 [0,255].[0,255].[0,255].[0,255]

    ipv6 [0000,ffff]:[0000,ffff]:[0000,ffff]:[0000,ffff]:[0000,ffff]:[0000,ffff]:[0000,ffff]:[0000,ffff]

    Hobo ,

    This excludes all the ipv4 ips that have a 0 in the 2nd, 3rd, and 4th octets. Sorry but we’re going to have to revoke your Network Engineering credentials.

    doctorcrimson ,

    thanks, fixed

    tabularasa ,

    Not to nitpick, but an IPv6 address is represented as eight groups of four hexadecimal digits separated by :. Like 2001:0db8:3333:4444:5555:6666:7777:8888.

    nephs ,

    I’ll leave the regex to validate an ipv6 address as an exercise to the reader.

    doctorcrimson ,

    Omg, that’s twice now I’ve messed it up. Fixed.

    blakeus12 , in GoOn
    @blakeus12@hexbear.net avatar

    s.w.x.y/z

    plug it into a 5-dimensional graph and there you go.

    Fargeol , in Oh yea, that's the good stuff **huffs glue**
    parlaptie ,

    It’s somehow inverted. If it was Peano, two would be represented by two Somes, not by six. I have no idea how this one works.

    MiddledAgedGuy , in GoOn
    rez_doggie , in GoOn

    0.0.0.0/0

    michaeljo94 , in GoOn

    0.0.0.0/0

    Emma_Gold_Man ,

    Better hope the goon hasn’t heard of IPv6 either, or you’re toast

    oatscoop ,

    ::/0

    Kase ,

    Undefined

  • All
  • Subscribed
  • Moderated
  • Favorites
  • [email protected]
  • random
  • lifeLocal
  • goranko
  • All magazines