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.

kamen , in Three monitors, and i feel insulted

Stereotypes exists so that I can be the 5% that doesn’t fall into them.

Two monitors but a solid case side panel (in fact it’s a case that’s so old that at the time TG side panels were not common). If I could be at liberty to choose parts purely based on looks, I’d go with something black, minimalistic and with no RGB.

boonhet ,

Huge fan of the non-TG Fractal Design R series cases for your use case. Pretty, but minimalistic. Airflow might be a bit of an issue given that they’re noise focused cases.

kamen ,

I have the Define R5 right now and it’s mostly good, but it’s choking a bit. I was thinking of getting a Torrent because of the airflow. Even with the TG I think it looks good, could be useful for shoving an info display or a clock inside, moreover a solid side panel doesn’t make as much sense when it’s not dampened (and this is an airflow-focused case).

ytg , (edited ) in Daylight saving creator left the chat....

Before timezones and trains, each town had its own natural time (based on the sun or whatever). Would you have preferred that?

vox ,
@vox@sopuli.xyz avatar

tbf there are libraries capable of handling that too, like rust’s chrono

BluesF , in Three monitors, and i feel insulted

When I moved from the office to home I changed to a single monitor… And I have never missed the other one. I mean, I’m not a software engineer, so YMMV.

robocall OP ,
@robocall@lemmy.world avatar

But do you have a rainbow keyboard?

BluesF ,

Solid red cause I’m a cheepskate, but my mouse is flies the 🌈

Also thanks team, downvotes for saying I like having one monitor lmao

JayDee , (edited ) in Daylight saving creator left the chat....

I’ve just said ‘fuck it’ and switched all my clocks to UTC. I don’t even care anymore.

uis ,

Why not metric time(TAI)?

Quill7513 ,

Or why not just seconds past the epoch?

nabladabla ,

leap second corrected or not?

uis ,

Metric seconds or UTC seconds?

Quill7513 ,

I’m gonna say SI

JayDee ,
uis ,

Reasons just states difference, but does not answer why.

JayDee ,

There’s literally a section titled ‘why use UTC - not TAI?’.

dukk ,

On the other hand, TAI does not take into account the variations in Earth’s rotation speed, which determines the true length of a day. For this reason, UTC is constantly compared to UT1. Before the difference between the two scales reaches 0.9 seconds, a leap second is added to UTC.

On average, Earth has been slowing down a bit over the past decades, so UTC is currently running 37 seconds behind TAI.

uis ,

So leap seconds is advantage here?

perviouslyiner ,

Is that supported in any common operating systems?

uis ,

Yes, CLOCK_TAI here

maynarkh , in It's always semicolon, God damnit.......

Joke’s on you, I use semicolons in Pythpn

mariusafa ,

How? For real I hate python not having ; and { and depending on tabs and spaces (PAIN)

maynarkh ,

You can end any statement in Python with a semicolon, you can also put multiple statements on the same line, putting a semicolon between them.

dustyData ,

Python supports both, it’s just not pythonic. It’s not the way it’s meant to be written but you can write them if you want/are a masochist, because of the syntax’s flexibility.

jaybone ,

You should try ruby.

fl42v ,

May I interest you in tushar.lol/post/cursed-for/

mariusafa ,

Nice, my lovely C syntax. Thank you!

mexicancartel , in It's always semicolon, God damnit.......

Binds enter key with ; and remove semicolons manually after braces{

fluxion ,

Writes custom parser in python to automate removing semicolons after braces. Figures out a preprocessing hook to execute it automatically from java compiler. Starts extending it for other things. Misses deadline. Extends it for more things. Gets fired. Ends up with a full python -> java compiler. Posts project on github. Gets made fun of.

jaybone ,

I will not make fun of you pal.

neonred , in It's always semicolon, God damnit.......

Try Kotlin

brlemworld , in Three monitors, and i feel insulted

Wtf is a rainbow computer?

Dagwood222 ,

I gave you an upvote because I came to ask the same thing.

We’ve wandered into a bad neighborhood…

capital ,

RGB bro

Simmy ,

Can they just call it what it is? RGB

MonkeMischief ,

But it’s addressable to ROYGBIV bruh! D:

xor ,

check out pcmasterrace, people throw a bunch of colored lights on their custom computers…

Feathercrown , in It's always semicolon, God damnit.......

JS users sprinkling in a few semicolons whenever they feel like it

isVeryLoud ,

Gotta keep you on your toes

marcos ,

JS itself sprinks them wherever it feels like it, so why break the mood?

python ,

JS is absolute chaos programming and I love that way too much. You can just feel all the caffeine ingested by the guy who had to pull long nights to ship JS within 10 days. That’s exactly the vibe I’m going for with my code.

Feathercrown ,

JS gets us

uid0gid0 , in Three monitors, and i feel insulted

We are just carrying on the tradition of das blinkenlights

ohlaph ,

I thought that would lead me to a das keyboard.

ArmokGoB , in Three monitors, and i feel insulted

I have a Dell laptop. That probably explains why I’m such a shitty programmer.

passepartout , in Rebase Supremacy

I like the idea of it and there were times i used it correctly, but most of the time i do it wrong i guess.

johannesvanderwhales , in Three monitors, and i feel insulted

The watermark over the watermark on this…for that extra shitposty goodness.

PP_BOY_ , in Rebase Supremacy
@PP_BOY_@lemmy.world avatar

Why is anyone using X in 2024?

hddsx ,

I do, I have yet to switch to Wayland

CanadaPlus ,

It’s called Twitter now, by conservation of names. /s

milicent_bystandr ,

You didn’t hear of wayland.social?

MNByChoice ,

OFC it’s real wayland.social/explore

Encinos ,

Shit, I unironically thought they were talking about this, and I unironically haven’t switched because Barrier is broken on Wayland

13 ,
@13@kbin.run avatar

I use X because Cinnamon on Wayland has no option to change the keyboard layout

merthyr1831 ,

I tried their experimental Wayland session and it’s still super buggy on high refresh rate/high DPI screens (loads of graphical errors and artifacts) so still a ways to go imo

Theharpyeagle ,

I tried it for a moment, made games stutter like hell, switched back. I know I need to go in and figure it out at some point, but it’s hard to muster the energy when X, for the most part, works fine.

From what I’ve seen, it probably has to do with my Nvidia GPU.

30p87 ,

I’m currently at the point where I blame everything that works on my Laptop but not on my PC on Nvidia, because that’s literally the biggest difference between those two. Like currently my getty isn’t displaying properly, which is surely NVidias fault.

tostiman ,
@tostiman@sh.itjust.works avatar

Odd, when i switched to Wayland the stuttering stopped! Also on Nvidia

merthyr1831 ,

Depends on a few things with your setup: age of your GPU, the resolution/refresh rate of your monitor. I think even the choice of DP/HDMI can have an impact too

KSPAtlas ,
@KSPAtlas@sopuli.xyz avatar

On nvidia, it definitely feels much smoother, but some GPU accelerated programs like games become flickery

supercritical ,
@supercritical@lemmy.world avatar

Because my new intel integrated graphics cause Wayland to run like a slideshow.

technom ,

Because their name is Elon Musk.

Jumuta ,

because some of the hardware I use is too old to run Wayland

T156 ,

Wayland really doesn’t like RDP/remote access, so X is the only way to go if you want that to work properly.

AArun ,

I actually never had an issue on my wayland system. I used remmina for rdp but never had an issue.

Zuberi ,
@Zuberi@lemmy.dbzer0.com avatar

No censorship tbh

FiniteBanjo ,

But there is blatant censorship

Zuberi ,
@Zuberi@lemmy.dbzer0.com avatar

Nothing even remotely compared to any of the other platforms mate

FiniteBanjo ,

Platforms of the same nature like Mastodon.social ? Because no.

Actually, internal reports seem to indicate Twitter under Musk complies with much more takedown requests than it did previously, numbers seem to range from 80% to 98%, including requests from countries like China, Ethiopia, Turkey, etc. When people mention censorship by big tech the top three names are Twitter, Facebook, and Google. The only time I know of that twitter fought censorship was when India wanted them to takedown news about farmers’ protests, and Twitter lost in court, probably owing largely to the fact that he cut staff by 80% and ran the company’s finance into the ground by endorsing hate speech.

Zuberi ,
@Zuberi@lemmy.dbzer0.com avatar

No, I did not include mastodon in the “other platforms” because 99% of the normies aren’t on decentralized platforms anyway.

Very small pond we’re discussing, as sad as that is.

All I did was answer why THEY think Twitter is worth using. I personally don’t use Twitter, nor do I disagree w/ your take on censorship.

FiniteBanjo ,

Idk I hang out on Mastodon.social

If yall don’t like the chronological feed then find a hashtag you like and start following people.

Crow , in Rebase Supremacy

I’ve been using merge, and I hate that I don’t even know what rebase really does

BlackPenguins ,

Merge is taking all the code from the master branch and combining it with the task branch, resulting in a commit for just the merge itself.

Rebase is “re-basing” where your task branch was created from off the master branch. It essentially takes all the commits from master that happened since you branched, REWRITES THE HISTORY of your task branch by inserting those master branch commits before all your existing commits, and effectively makes your task branch look like it was branched yesterday instead of like 4 weeks ago. You changed where your task branch originated on the master. You moved its base.

Atlassian does a fantastic writeup on this.

Crow ,

So, with a merge you basically shuffle in the changes from both branches, but a rebase takes only the changes from one branch and puts it over the other? Edit: no. Read wrong. I should probably watch a vid about it or something

BlackPenguins ,

It inserts the master changes before the task branch ones.

morrowind ,
@morrowind@lemmy.ml avatar

So kinda like as if you had kept your branch synced the whole time?

BlackPenguins , (edited )

Kind of. Both merge and rebase result in the branches “synced up” but they do it in different ways.

Merge is making a batter for cookies, having a bowl for dry ingredients (task branch) and a bowl for wet ingredients, (master branch) making them separately and then just dumping the dry bowl into the wet bowl (merge).

Rebase is taking a time machine back to before you started mixing the dry ingredients, mix all the wet ingredients first then add the dry ones on top of that in the same bowl.

It’s really hard to create an analogy for this.

andrew , (edited )
@andrew@lemmy.stuart.fun avatar

Merge takes two commits and smooshes them together at their current state, and may require one commit to reconcile changes. Rebase takes a whole branch and moves it, as if you started working on it from a more recent base commit, and will ask you to reconcile changes as it replays history.

https://lemmy.stuart.fun/pictrs/image/2b06417c-740b-4d6f-a258-76c75a63c500.jpeg

Crow ,

That’s pretty cool, might actually do that. Tho, we currently don’t use the history as much anyways, we’re just having a couple of small student projects with the biggest group being 6 people. I guess it’s more useful if you’re actually making a real product in a huge project that has a large team behind it

RecluseRamble ,

Just remember to not combine it with force push or you’re in for some chaos (rewriting history team members have already fetched is a big no-no).

Transtronaut ,

Facts. Force push belongs in Star Wars, and nowhere else.

expr , (edited )

Or, you know, on your own feature branch to clean up your own commits. It’s much, much better than constantly littering your branch’s history with useless merge commits from upstream, and it lets you craft a high-quality, logical commit history.

RecluseRamble ,

Of course it has its uses. I didn’t mention them because the guy just learned about rebase - it’s unlikely to be applied flawlessly from the start.

expr ,

I was replying to the other comment, not yours. Though there’s not really a way of using rebasing without force pushing unless it’s a no-op.

Rebasing is really not a big deal. It’s not actually hard to go back to where you were, especially if you’re using git rebase --interactive. For whatever reason people don’t seem to get that commits aren’t actually ever lost and it’s not that hard to point HEAD back to some previous commit.

RecluseRamble ,

I was replying to the other comment, not yours.

I know. Answered anyway because I thought of the same thing as you.

Though there’s not really a way of using rebasing without force pushing unless it’s a no-op.

I like to rebase after fetching and before pushing. IMO that’s the most sensible way to use it even in teams that generally prefer merge. It’s also not obvious to beginners since pull is defaulted to fetch+merge.

expr ,

Ah gotcha.

like to rebase after fetching and before pushing. IMO that’s the most sensible way to use it even in teams that generally prefer merge.

What do you mean? Like not pushing at all until you’re making the MR? Because if the branch has ever been pushed before and you rebase, you’re gonna need to force push the branch to update it.

Personally I’m constantly rebasing (like many times a day) because I maintain a clean commit history as I develop (small changes to things I did previously get commits and are added to the relevant commit as a fixup during interactive rebasing). I also generally keep a draft MR up with my most recent work (pushing at end of day) so that I can have colleagues take a look at any point if I want to validate anything about the direction I’m taking before continuing further (and so CI can produce various artifacts for me).

It’s also not obvious to beginners since pull is defaulted to fetch+merge.

Yeah, pull should definitely be –ff-only by default and it’s very unfortunate it isn’t. Merging on pull is kind of insane behavior that no one actually wants.

RecluseRamble ,

What do you mean? Like not pushing at all until you’re making the MR? Because if the branch has ever been pushed before and you rebase, you’re gonna need to force push the branch to update it.

Not everyone works in large orgs that require pull requests. We have a dev branch multiple devs push to and just branch off for test phase. So I commit locally (also interactive rebasing when fixing stuff from earlier). When I’m ready to push, I fetch, rebase and push. I never force push here.

expr ,

Uh, it’s definitely a bad idea to be concurrently developing on the same branch for a lot of reasons, large org or not. That’s widely considered a bad practice and is just a recipe for trouble. My org isn’t that huge, and on our team for our repo we have 9 developers working on it including myself. We still do MRs because that’s the industry standard best practice and sidesteps a lot of issues.

Like, how do you even do reviews? Patch files?

Transtronaut ,

You can do all that without force push. Just make a new branch and do the cleanup before the first push there. Allowing force push just invites disaster from junior developers who don’t know what they’re doing. If you want to clean up after them, that’s your business, I guess.

expr ,

That’s exactly the same thing. A branch is nothing more than a commit that you’ve given a name to. Whether that name is your original branch’s name or a new branch’s name is irrelevant. The commit would be the same either way.

A junior cannot actually do any real damage or cause any actual issue. Even if they force push “over” previous work (which again, is just pointing their branch to a new commit that doesn’t include the previous work), that work is not lost and it’s trivial to point their branch to the good commit they had previously. It’s also a good learning opportunity. The only time you actually can lose work is if you throw away uncommitted changes, but force pushing or not is completely irrelevant for that.

zalgotext ,

Force pushes are perfectly safe if you’re working on your own branch, and even if you’re sharing a branch, you can still force push to it as long as you inform and coordinate with whoever else is working on that branch.

ScreaminOctopus ,

I wouldn’t recommend it. The Git documentation itself doesn’t recommend rebase for more than moving a few unpushed commits to the front of a branch you are updating. Using it by default instead of merge requires you to use --force-push as part of your workflow which can lead to confusing situations when multiple developers end up commiting to the same branch, and at worst can lead to catastrophic data loss. The only benefit is a cleaner history graph, which is rarely used anyway, and you can always make the history graph easier to read with a gui without incuring any of the problems of rebase.

surge_1 ,

Bad take IMO,

At 10+ YOE, I use rebase almost exclusively. Branch from main, rebase to clean up commit history before putting up a PR. If commits are curated properly you don’t run into conflicts very often. Branches really shouldn’t be shared too often anyway, and the ones that are should be write protected.

Catastrophic data loss isn’t really possible either with git since it’s all preserved and you can git reflog even if you mess up.

The meme is right. Git good

agressivelyPassive ,

Years of experience don’t really matter here, that’s just call to authority, in this case yourself. You might as well be the worst git user ever after 20 years of usage, or the best after 2. We don’t know that.

Anyway, what you’re saying basically requires a perfect world to be true. Feature branch flow is perfectly fine, but you do end up with merge conflicts constantly, unless you have cordoned off areas of the repo for certain users. Two people working on unrelated features, both change a signature of some helper/util method, merge conflict. Nothing serious, can be fixed in a minute, and rebasing or merging won’t help for either.

Merge is perfectly fine. And arguing about which strategy to use is one of those autistic debates we as an industry seemingly love to have. It doesn’t matter, but you’ll find people screaming at each other about it. See Emacs vs. Vi. Same crap.

surge_1 ,

Merge is fine, but not knowing both rebase and merge is dumb. And I guess I’ve been in a perfect world this whole time in huge technical orgs lol.

Croquette ,

When rebasing, it applies the changes without the commit history?

Does that mean that when you fast forward your main/dev branch and commit, you then add a single commit that encompasses every changes that were rebase?

expr ,

No, there are no fast-forwards with rebasing. A rebase will take take the diff of each commit on your feature branch that has diverged from master and apply those each in turn, creating new commits for each one. The end result is that you have a linear history as though you had branched from master and made your commits just now.

If you had branched like this:


<span style="color:#323232;">A -> B -> C (master)
</span><span style="color:#323232;">   
</span><span style="color:#323232;">      -> D (feature)
</span>

It would like this after merging master into your feature branch:


<span style="color:#323232;">A -> B -> C (master) ->   E (feature)
</span><span style="color:#323232;">                                      /
</span><span style="color:#323232;">     -> D -------------------> /
</span>

And it would like this if you instead rebased your feature branch onto master:


<span style="color:#323232;">A -> B -> C (master) -> D' (feature)
</span>

This is why it’s called a “rebase”: the current state of master becomes the starting point or “base” for all of your subsequent commits. Assuming no conflicts, the diff between A and D is the same as the diff between A and D’.

expr ,

This a really bad take and fundamentally misunderstands rebasing.

First off, developers should never be committing to the same branch. Each developer maintains their own branch. Work that needs to be tested together before merging to master belongs on a dedicated integration branch that each developer merges their respective features branches into. This is pretty standard stuff.

You don’t use rebasing on shared branches, and no one arguing for rebasing is suggesting you do that. The only exception might be perhaps a dedicated release manager preparing a release or a merge of a long-running shared branch. But that is the kind of thing that’s communicated and coordinated.

Rebasing is for a single developer working on a feature branch to produce a clean history of their own changes. Rebasing in this fashion doesn’t touch any commits other than the author’s. The purpose is to craft a high quality history that walks a reader through a proposed sequence of logical, coherent changes.

Contrary to your claim, a clean history is incredibly valuable. There’s many tools in git that benefit significantly from clean, well-organizes commits. git bisect, git cherry-pick… Pretty much any command that wants to pluck commits from history for some reason. Or even stuff like git log -L or git blame are far more useful when the commit referenced is not some giant amalgamation of changes from all over the place.

When working on a feature branch, if you’re merging upstream into your branch, you’re littering your history with pointless, noisy commits and making your MR harder to review, in addition to making your project’s history harder to understand and navigate.

surge_1 ,

1000 times this

pineapple_pizza ,

This diagram seems wrong to me. Isn’t the second image a squash merge? Also why would rebasing a feature branch change main?

bort ,

why would rebasing a feature branch change main?

the image does not update the feature branch. It merges the featurebranch into main with a regular old merge-commit on the main branch.

andrew ,
@andrew@lemmy.stuart.fun avatar

Yeah, the image (not mine, but the best I found quickly) kinda shows a rebase+merge as the third image. As the other commenter mentioned, the new commit in the second image is the merge commit that would include any conflict resolutions.

Atemu ,
@Atemu@lemmy.ml avatar

The only difference between a *rebase-merge and a rebase is whether main is reset to it or not. If you kept the main branch label on D and added a feature branch label on G’, that would be what @andrew meant.

xilliah ,

I’m relatively new to git and rebase looks like a mess to me? Like it appears to be making duplicate commits and destroys the proper history?

If you use rebase to get a more readable history, isn’t the issue the tool you use to view the history?

I guess I have to try it out a few times to get it.

agressivelyPassive ,

The commits aren’t duplicated, but applied to the main branch. Since git has commit ids, they won’t be re-rebased either.

Ephera ,

What you probably mean by duplicate commits is that it assigns new commit IDs to commits that have been rebased. If you had already pushed those commits, then git status will tell you that the remote branch and your local branch have diverged by as many commits as you rebased.

Well, and what is the “proper history”? If your answer is “chronological”, then why so?
For the rare times that it matters when exactly a commit was created, they’ve got a timestamp. But otherwise, the “proper history” is whatever you make the proper history. What matters is that the commits can be applied one after another, which a rebase ensures.

When you’re working on a branch and you continuously rebase on the branch you want to eventually merge to, then the merged history will look as if you had checked out the target branch and just made your commits really quickly without anyone else committing anything in between.
And whether you’ve done your commits really quickly or over the course of weeks, that really shouldn’t matter.

What is really cool about (supposedly) making commits really quickly is that your history becomes linear and it tells a comprehensible story. It won’t be all kinds of unrelated changes mixed randomly chronologically, but rather related commits following one another.
And of course, you also lose the merge-commits, which convey no valuable information of their own.

Atemu ,
@Atemu@lemmy.ml avatar

you also lose the merge-commits, which convey no valuable information of their own.

In a feature branch workflow, I do not agree. The merge commit denotes the end of a feature branch. Without it, you lose all notion of what was and wasn’t part of the same feature branch.

someonesmall ,

Agreed, you also lose the info about the resolved merge conflicts during the merge (which have been crucial a few times to me).

Ephera ,

Well, with a rebase workflow, there should be no merge conflicts during the final merge. That should always be a fast-forward.

Of course, that’s because you shift those merge conflicts to occur earlier, during your regular rebases. But since they’re much smaller conflicts at a time, they’re much easier to resolve correctly, and will often be auto-resolved by Git.

You’re still right, that if you’ve got a long-running feature branch, there’s a chance that a conflict resolution broke a feature that got developed early on, and that does become invisible. On the flip-side, though, the person working on that feature-branch has a chance to catch that breakage early on, before the merge happens.

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