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.

the_of_and_a_to , in ifn't

deleted_by_author

  • Loading...
  • JPDev OP ,

    unlessn’t

    Goun ,

    I’m sorry, I hate the “unless” so much

    NotSteve_ ,

    At one of my first jobs, I was tasked to rewrite a bunch of legacy Perl scripts in Python and the unless lines always made me trip up. I don’t know why but it really messed with my mental flow when reading Perl code

    chaogomu ,

    Basic used "else".

    It's nice. "if", "then", and "else". I spent a year programming a shitty roulette game on an Apple 2e back in high school. I still remember the joy of using if/then/else paired with goto to make a horrible mess of spaghetti logic.

    But yeah, "else" is nice.

    Deceptichum ,
    @Deceptichum@kbin.social avatar

    Let's just scrap every language except various forms of BASIC.

    pearsaltchocolatebar ,

    Please God, no. I had to unravel terminal scripting code that was written in some propriety BASIC language with basically no documentation.

    Took me a chunk of time trying to figure out how it worked before I made the realization that it was BASIC

    jaybone ,

    Try PL/SQL.

    SubArcticTundra , (edited )
    @SubArcticTundra@lemmy.ml avatar

    Using a standalone ‘else’ would tickle my brain in the same nice way that being able to declare a variable inside an ‘if’ statement as if it were a ‘for’ loop (which you can do in modern C++) does.

    Amaltheamannen ,

    Or a rust “if let”

    SubArcticTundra ,
    @SubArcticTundra@lemmy.ml avatar

    Ooh yes. Rust is king when it comes to this sort of inline stuff. Inline match. Mmmmmm!

    jaybone ,

    Block scoped variables are bad?

    SubArcticTundra ,
    @SubArcticTundra@lemmy.ml avatar

    🤷‍♂️

    Lmaydev ,

    Many languages let you scope variables.

    In c# you can create an arbitrary scope to declare variables in. Most likely in others as well.

    SubArcticTundra ,
    @SubArcticTundra@lemmy.ml avatar

    Ah clever, didn’t think of doing this. Not having to encapsulate if statements in scopes would still look cleaner though

    Lmaydev ,

    It’s handy if you’re creating temp variables for single use that you don’t need to use again.

    Although I admit I’ve only ever done it a couple times lol

    Again in c# you can omit the scope and only the next statement is part of an if or loop.

    marcos ,

    The Perl version of it is even greater!

    EnderMB ,

    I haven’t written any Ruby for years, but I still praise it in every conversation I have regarding programming languages. It’s basically a much simpler Python, with some design ideas that are both beautiful and deeply strange.

    OskarAxolotl ,

    Ruby was designed to evoke joy and they absolutely succeeded. Usually, programming is mostly a means to an end to me. But using Ruby just feels so amazing, it’s almost impossible to even describe to somebody who has never used it before.

    allywilson , in WDYM your terminal isn't a test suite?

    I just start every command with a space, don’t see the issue.

    mumblerfish ,

    Was working on a server where I did not want to put some dumb command into the history, so I add a space like you do. Press up. The command is there. The fucking insult I felt.

    PoolloverNathan ,

    It’s disabled by default, but you can enable it in .bashrc and then delete that edit session using a spaced command.

    Edit: brain fart

    superbirra ,

    it also depends on the shell, in zsh it persists on local history but does not get written to history file

    stoy , in Programming: The Horror Game

    Reminds me of when CodeBullet turned Pacman into a first person horror game

    SomeoneWhoIsntMe , in Programming: The Horror Game

    I kinda want this to be real…

    BatmanAoD ,

    It’s not too far off from how ed works!

    UndercoverUlrikHD ,

    How does ed work?

    BatmanAoD ,

    ed, the “standard editor” (according to its man page) and the predecessor of vi (the “visual editor”), is a terminal editor that doesn’t automatically display any of the text you’re working on; you have to use the p (“print”) command to display the lines your wish to see.

    UndercoverUlrikHD ,

    ಠ_ಠ

    BatmanAoD ,

    If you have a Linux or Mac handy, you can trying it out! It’s…kinda wild. If you know some Vim commands that start with :, there’s a good chance they’ll work in ed, except you don’t type : itself (effectively you’re always in “command mode”).

    There’s also a novelty Twitter account, @ed1conf, that tweets about ed.

    Some coworkers told me a story about a previous job candidate who said his preferred editor was ed. They thought it would be really interesting to see someone actually use it. But during the actual interview, when he opened ed, he didn’t recognize or understand it; he was actually accustomed to a graphical editor that he thought was called ed because he apparently did all his work on a system where someone had symlinked or aliased ed to a modern tool.

    pmjv ,
    @pmjv@lemmy.sdf.org avatar
    explodicle , in Programming: The Horror Game

    Uh oh, brace yourself for a bunch of whataboutism from blatantly selfish computer nerds. /s

    itsJoelle ,

    Hey man, I work on a Microsoft full stack — VS corrupts files or locks up regularly 🤷That’s before we touch Windows on a server box

    ghostdoggtv , in Programming: The Horror Game

    Not really visual anymore innit

    ji17br ,

    Spotlight studio

    xmunk , in ifn't

    Still not as good as whence

    fartsparkles ,

    Is this a reference to something because I’d love to read it if you have a time to share.

    xx3rawr ,

    Woah. I did a quick google and it’s not just a meme, but actually used in some major lang’s libraries.

    jjjalljs ,

    This is one of those “modern Google/search sucks” moments because I couldn’t immediately find examples of it in a programming language.

    xx3rawr ,

    I actually used DDG and most I’ve seen, they’re just used as arguments for functions notably in C and Python

    LeFrog , (edited )
    @LeFrog@discuss.tchncs.de avatar

    It is used in ksh korn shell to see what executable responds to a command:

    superuser.com/a/351995

    Edit: Oh, what a rabbit hole: Why not use “which”? What to use then?

    SubArcticTundra ,
    @SubArcticTundra@lemmy.ml avatar

    Legislation (which feels similar to programming languages sometimes) seems to have some keywords of its own. I remember seeing a lot of Whereas … and Having regard to ….

    TankieTanuki , (edited ) in What you are according to you fav language

    Can some nerd tell me what the rightmost two on the bottom row are?

    Edit: Didn’t notice how old this post was.

    sag OP ,
    @sag@lemy.lol avatar

    Second last on bottom row is swift use to build mac or ios software.

    flameguy21 , in Programming: The Horror Game

    This should be considered a war crime

    xia , in Programming: The Horror Game

    With a good eye-tracker and some tweaking, this might be usable…

    Aatube ,
    @Aatube@kbin.social avatar

    ...and OLED screens the price of LEDs...

    PanArab , in ifn't

    This can’t be for real. I’ll stick with C11 thank you.

    stardreamer ,
    @stardreamer@lemmy.blahaj.zone avatar

    Here you dropped this:

    
    <span style="font-weight:bold;color:#a71d5d;">#define </span><span style="font-weight:bold;color:#795da3;">ifnt</span><span style="color:#323232;">(x) </span><span style="font-weight:bold;color:#a71d5d;">if </span><span style="color:#323232;">(</span><span style="font-weight:bold;color:#a71d5d;">!</span><span style="color:#323232;">(x))
    </span>
    
    BatmanAoD , in Programming: The Horror Game

    The animation that goes with this is pretty slick: x.com/Phantom_TheGame/status/1748457358521426375?…

    BatmanAoD , in Programming: The Horror Game

    Oh hey, it’s modern ed!

    casmael , in Programming: The Horror Game

    Yeah so you gotta buy the lumafly lantern before you go in that area

    minyakcurry ,

    I never expected a Hollow Knight reference here

    andrew , (edited ) in WDYM your terminal isn't a test suite?
    @andrew@lemmy.stuart.fun avatar

    I legitimately back up my history file. Mostly because it likes to truncate itself randomly (though this may have been fixed in zsh, or my config, because it’s been a while). Just a systemd timer that triggers a shell script to copy it by date and rotate anything older than 100 copies.

    Edit: WHY DID I SAY ANYTHING? After like 3 months of no problems, my history truncated itself to 3 entries a few minutes ago. I’ve only ever seen a few days of loss before that lol.

    jelloeater85 ,
    @jelloeater85@lemmy.world avatar

    Have you tried Atuin? It’s amazing.

    andrew ,
    @andrew@lemmy.stuart.fun avatar

    I did try it for a bit. IIRC it slowed me down more than I cared for. Maybe worth trying again, though.

    sabreW4K3 OP ,
    @sabreW4K3@lemmy.tf avatar

    Haha, my bad!

    andrew ,
    @andrew@lemmy.stuart.fun avatar

    Fortunately I have my hourly backups! 😅

    caseyweederman ,

    I’m annoyed when my thirteen bash instances don’t share history, but I’d probably be a lot more annoyed if they did.

    andrew ,
    @andrew@lemmy.stuart.fun avatar

    That’s one thing I like about zsh, or my config at least, because I use i3 and therefore tend to open lots of shells. History is mostly local until I hit return twice (two empty prompts) at which point I can get history from other sessions. It’s stuck more global at that point though aside from future history.

    caseyweederman ,

    Ooh. I like that. I’m gonna try that, thanks.

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