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.

rickdg , in NaN Cat wallpaper [artist unknown]
@rickdg@lemmy.world avatar

DHH is asking if he can get it in a t-shirt.

jana ,

Fun fact: NaN is of type number

NegativeLookBehind , in Pure Evil
@NegativeLookBehind@kbin.social avatar

Something similar happened to me a while back. I was copying some code from a Mac to a remote Linux host. For some reason the Mac was using a thing called an “en dash” which is slightly longer than a regular hyphen - and was really fucking frustrating to figure out.

pthaloblue ,

I don’t know why I’m here commenting about this, but I love type, so:

Hyphen (-): the short one, used for hyphenated words. fire-eaters. Close-up.

en-dash (–): slightly longer, traditionally the length of a lowercase"n" in the typeface. Used between for things like a timeframe. 10–11:30, August–October

em-dash (—): the longest of the three, and the length of a lowercase “m”. Used as a punctuation mark to denote a side comment or to abruptly cut off a sentence. “It’s a great punctuation mark—in fact I overuse it—but it’s still useful.” “Hey where are you going with that giant—”

I didn’t bother to double check the definitions, so there might be more specific rules, but these are my rules of thumb.

Spiralvortexisalie ,

Dictionary source for possible particulars: merriam-webster.com/…/em-dash-en-dash-how-to-use

pthaloblue ,

Ah this is nice!

Chemical ,

Thank you. I have learned something new today!

lobut ,

Some mac apps have some quirks, the default note app was probably not meant for pasting code in, but when you do it changes the quotes and makes them all fancy. Drives me up the wall and there’s nobody to blame but me.

NegativeLookBehind ,
@NegativeLookBehind@kbin.social avatar

I blame Steve Jobs.

Gullible ,

Let’s dig him up and put him on trial. If it’s good enough for the pope, it’s good enough for him.

jadedwench ,

I was looking for this. Some text from webpages end up pasting that way too, even on non-mac systems, and it is utterly infuriating. Nothing I hate more than having to paste something into notepad++ so I can fix all the stupid quotes from some online tutorial that is giving you things to paste into a command prompt.

AlexWIWA ,

Ah, my favorite character. I abuse the hell out of the em-dash.

psud ,

For someone who abuses it, there is a remarkable absence of em-dashes in your comment :—)

Thisfox , in R U A Cyberpunk

I had that laptop, got it second hand. Was great for Uni.

CyberDragonCore , in NaN Cat wallpaper [artist unknown]
@CyberDragonCore@programming.dev avatar

cute.

drew_belloc , in Pure Evil
@drew_belloc@programming.dev avatar

If the language doesn’t force me to use semicolons i will forget

newIdentity , in Pure Evil

Who uses semicolons in Javascript?

BearJCC ,

Old habits die hard. Learned JS, CSS and C++ all the same year about a decade ago.

seitanic ,
@seitanic@lemmy.sdf.org avatar

Programmers who care about best practices. Here are a couple of scenarios where

newIdentity ,

deleted_by_author

  • Loading...
  • seitanic ,
    @seitanic@lemmy.sdf.org avatar

    ~95% of the JS code you see on the Web has semicolons. Apparently, a lot of programmers think it’s worth that extra keystroke to avoid these types of bugs. I agree with them. The difficulty with programming isn’t “Arrgh, there are too many keystrokes, my hands are tired!” It’s “Arrgh, HTF did this bug get in here?!?”

    tryagain ,

    I don’t even bother typing them because I like having eslint do it for me.

    rockSlayer ,

    They made it a named function, but this is literally how you format anonymous functions in js, a key feature that usually gets called with stuff like an onclick or onload call in the html domain.

    tkarika ,

    Every real programmers

    psud ,

    In that sentence, we use “programmer” singular, because “every” is singular, though referring to many

    All real programmers

    Every real programmer

    Each real programmer

    No real programmer

    It’s pretty arbitrary

    Perfide ,

    People who like minimizing the amount of bug fixing.

    manapropos ,

    I use prettier which by default adds semicolons. Coming from predominately doing backend stuff (mostly in Java) I don’t really mind, especially when the formatter adds them for me

    newIdentity ,

    That’s what I do too, but i don’t manually add them

    tfw_no_toiletpaper , in Pure Evil

    I don’t even know what to say to this one.

    darcy , in Pure Evil
    @darcy@sh.itjust.works avatar

    any modern compiler or ide will notice this and warn you.

    massive_bereavement ,
    @massive_bereavement@kbin.social avatar

    Same, I thought this is gotta be a problem for someone who uses notepad as their main editor.

    Jumuta ,

    meanwhile vim:

    Amaltheamannen ,

    If you are coding on vim you use a language server 😝

    darcy ,
    @darcy@sh.itjust.works avatar

    vim is not an ide i believe. but an lsp will notice

    watcher ,

    Yeah, it will tell you that it existed a semicolon… 😁

    luciferofastora ,

    …for which my default fix would be to delete and reenter it in hopes of fixing ehatever hiccup the syntax validator is having

    cupcakezealot , in Always commit
    @cupcakezealot@lemmy.blahaj.zone avatar

    never commit on friday afternoon because you’ll regret it on monday morning

    0x0 , in R U A Cyberpunk

    I knew i was right in not throwing away my MiniDisk!

    Psythik ,

    MiniDisc*. Disks are hard drives, floppies, and SSDs. Discs are optical media.

    0x0 ,

    Do you mean “Disc” as a Sony trademark or a distinction between media types?

    UlyssesT , in R U A Cyberpunk

    Bullet chain needs no explanation.

    AllNewTypeFace , (edited ) in R U A Cyberpunk
    @AllNewTypeFace@leminal.space avatar

    The guy in the photo is still dressed like that, but now he’s the weird hobo who lives in the junkyard

    devious , in Always commit

    Well maybe if she had shown more interest in his pull requests, he wouldn’t be off forking other repos!

    Zeth0s , in Always commit

    I never push as last thing in the evening. I want to sleep over it and revise in the morning. --amend crew unite

    Michal ,

    What if while you sleep over it your laptop gets stolen or damaged? I’d rather push every small change than sit on it.

    Zeth0s ,

    I would lose max 3 hrs of work that I already know how to re do. I can live with that. I don’t want to publish too much unfinished/unpolished work. There is always the chance someone might need the branch.

    Even if drafts under development, I like to publish something that reaches the standard of my “best” me, not my “Friday evening” me

    explodicle ,

    Same here. At least for me, the hard part is figuring out how to do it.

    Michal ,

    Why not? Do you push directly to master?

    Zeth0s ,

    Because someone else might need to work on something on or from my branches. And I don’t want garbage in my history. There are cases I might not be able to squash merge, so all my history will be in the project history. I want each commit to be clean. It is not a lot of effort, and forces me to increase code quality, because I review my code more often.

    Rules for all projects I manage: never rebase published branches and always publish clean code (even implementation is unfinished).

    From experience following these simple rules make the whole project management easier and more effective

    darklamer ,
    @darklamer@lemmy.dbzer0.com avatar

    Don’t you have continuous backups of your work laptop!?

    Michal ,

    On one occasion i had to take over a task from a colleague while he was on his day off. He did not push his changes. I am sure he had backups but when i asked him to push his changes he had to drive home to do it.

    I’d rather company IP stays on its git server.

    Anticorp ,

    You should be pushing feature branches as you work on them, so if you have a crash or something, your work isn’t lost. Builds should be triggered from pull requests on the main branch, if triggered by anything. You should never push directly to main. At least that’s my preference.

    Zeth0s , (edited )

    Our ci/cd pipelines build also feature branches. I do push often, clean code. I don’t push when I am tired enough that I can’t trust my judgment that the code I am pushing is over my personal quality threshold. I add meaningful, concise commit messages. These are my rules.

    TheManuz ,

    I make WIP branches only for that purpose, so I can push half done work and rework it the day after.

    This means a lot of history changes, but only in the WIP branch.

    When history is clean, I rebase the feature branch.

    Is this a good practice? I never found a better way to backup partial code.

    yiliu , in Always commit

    “No, wait, it’s not what you think! There’s a continuous integration system, a commit would’ve triggered a new build! It might have paged the oncall! Babe! The test suite has been flaky lately!

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