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.

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.

jabjoe , in Daylight saving creator left the chat....
@jabjoe@feddit.uk avatar

The only code with timezones should be the bit squishy meat bags touch. Everything’s is should be UNIX time. Or it you are unfortunate enough to be on Windows, NT time.

Some unfortunate programmers already have to deal with the speed of time not being a constant. In a distant future, timestamps might always have a universal position (and speed), and is that much different from timezones?

Or we find some way of removing time distortion of physics. Find the universe’s real systick. 😃

Zannsolo ,

No UTC. Convert/use UTC on the way in and covert to local time for the user or local time of the noun the date is for in the display.

jabjoe ,
@jabjoe@feddit.uk avatar

Any UTC type is going to do native time and convert for display.

But with native time directly, you can just an int64 with loads of space for fine resolution via multiplication.

Storing time broken up into separate units is crazy.

AgentGrimstone , in Daylight saving creator left the chat....

I’m not a developer but give him one for me too

CosmicCleric , in Daylight saving creator left the chat....
@CosmicCleric@lemmy.world avatar

If only I had a numeric type that could hold the value of how many seconds since the creation of the Universe, without overflowing, I’d be set.

BennyHill , in Your scrunglebop is disponscabulated
@BennyHill@lemmy.ml avatar

As a non programmer this is just how all programming questions look like to me.

MasterNerd , in Three monitors, and i feel insulted
@MasterNerd@lemm.ee avatar

RGB is overrated

fishbone ,

Useless RGB is overrated. I color coded my keyboard and it’s unbelievably helpful, especially for altered keys (ie: media keys/macro keys).

dan , in Review Please
@dan@upvote.au avatar

I try to keep my changes under 300-350 lines. Seems like a good threshold.

I’m still annoyed that Github doesn’t have good support for stacked diffs. It’s still not possible to say that one PR depends on a different one, and still has no ability to review and land them as a stack.

iknowitwheniseeit ,

How is this different from creating a feature branch and making your PR against them until everything is done, then merging that into the main branch?

nomen_dubium ,

also iirc gitlab does offer something like this as a feature now with “merge trains” (though i’ve never really used it, usualy just go for the feature branch out of habit x) )

dan ,
@dan@upvote.au avatar

Making PRs against a feature branch still has the same problem.

Say you’re working on a major new feature, like adding a new log in flow. It’s a good idea to split it into many small changes: create initial log in form, implement user sessions, add SSO support, add “remember me” functionality, etc.

Those changes will likely depend on each other, for example adding the “remember me” checkbox requires the form to actually be built, and you probably don’t want to wait for the reviewers to review one change before continuing your work. This means you naturally end up with PRs that depend on each other in a chain.

Stacked PRs (or stacked diffs, stacked MRs, whatever your company calls it) means that:

  1. The code review tool lets you specify dependencies between the PRs, for example the “remember me” PR depends on the initial login form implementation
  2. It shows the dependencies visually in the UI, like a chain or tree
  3. Changes can’t be landed until the PRs they depend on have been reviewed
  4. There’s a way to land an entire stack
  5. When you review a PR later in the stack, it doesn’t show any of the changes that were made earlier in the stack. Each PR focuses just on the changes in that part.

Making all your commits directly to a branch then creating a PR for the whole branch is similar, but reviews are a nightmare since it’s only a single review for the entire branch, which can be thousands of lines of code.

At my workplace, we use feature flags (essentially if statements that can be toggled on or off) rather than feature branches. Everyone works directly from the main branch. We use continuous deployment which means landed code is quickly pushed to production. New features are hidden behind a feature flag until they’re ready to roll out.

iknowitwheniseeit ,

You can make a PR against your feature branch and have that reviewed. Then the final PR against your man branch is indeed huge, but all the changes have already been reviewed, so it’s just LGTM and merge that bad boy!

dan ,
@dan@upvote.au avatar

You can make a PR against your feature branch and have that reviewed

But what if you have multiple PRs that depend on each other? Or are you saying only have one PR open at a time? That sounds like it’d be very slow?

iknowitwheniseeit ,

I suppose it is possible to have two PR that have changes that depend on each other. In general this just requires refactoring… typically making a third PR removing the circular dependency.

It sounds like your policy is to keep PR around a long time, maybe? Generally we try to have ours merged within a few days, before bitrot sets in.

dan ,
@dan@upvote.au avatar

Sorry, my comment was unclear. I didn’t mean a circular dependency, just PRs that have a chain of dependencies (e.g. PR 100 that depends on 99, that depends on 98, that depends on 97)

They’re usually not around for a long time, but there can be relatively large chains if someone is quickly adding new features.

Olgratin_Magmatoe , (edited ) in Review Please

My first PR at my current job was about 130 files for the front-end, and about 70 for the backend. This hits close to home.

Secret300 , in Review Please

What anime this from?

hunkyburrito ,
bleistift2 , in I just ask my problem bro...chill....

Peple misunderstand “Closed as duplicate” as an insult, when it’s just the hint to look at the provided link. If you didn’t find the answer previously, this just means there are multiple ways to express the problem, which use different words and thus don’t all find the same google result.

BatmanAoD ,

They also changed the wording from “closed” to “on hold” years ago, and I don’t think I’ve ever seen the people complaining about the site take any notice.

JoYo ,
@JoYo@lemmy.ml avatar

It’s because they don’t use the site and they don’t have a problem to solve. They’re just here to complain.

codemonkey644 ,

But it’s those people who close it as a duplicate and not post the link to a valuable answer.

bleistift2 ,

You cannot even mark it as duplicate without providing a link to the answer. What are you talking about?

https://feddit.de/pictrs/image/5a9fd699-51a2-440e-ac02-4ae1d5551ff5.png

lastunusedusername2 ,

You can provide a link to an answer but it’s invariably not to the same question.

MotoAsh ,

No, it is always the same question.

… from a person sitting in a very different situation with a slightly different problem.

marcos ,

Some times the question has no semblance at all. Other times the answer has no semblance at all. Some times there’s no answer at all. And obviously, modern SO is full of people that will just post a ridiculously incorrect answer. There is a wide variety of possibilities!

I remember being very surprised as a I followed one of those links and got the answer I needed. But I don’t remember exactly when.

MotoAsh ,

I’ve had both happen a lot. Only the basic stuff gets a correct answer, because nuance is difficult even for the tech savvy.

lastunusedusername2 ,

At the very least it has some of the same words. And the person marking it as duplicate figured it was probably the same.

Heavybell ,
@Heavybell@lemmy.world avatar

It’s annoying when it is not a duplicate tho

Anticorp ,

Which is quite often

BatmanAoD ,

That’s fair, but if you edit the question to explain how it’s different (without which, how could anyone even answer your question?), it can be (and often is) reopened.

testeronious , in Aaargh....my eyes......my eyes......

Cleanest code by Unclest Bob

myxi , in Variable Declaration
@myxi@feddit.nl avatar

I turn off LSPs during my train of thoughts. I don’t want all red and yellow underline bullshit to disrupt my thoughts. Like, calm the fuck down. I WILL write the correct code eventually; just give me some fucking time.

Well, I use Neovim, so turning off the LSPs or restarting them is sufficiently simple.

When I work on a new project, or on a new feature, I temporarily turn off the LSP, and rely on the compiler to figure out where the code errors. Plain white text gives me the freedom to write whatever the fuck I want without any disruption. Of course, I eventually turn on the LSP again to fix the little issues.

baseless_discourse , (edited )

Many languages allow type hole like _ to indicate to the compiler/lsp that this is an expression you will fill in later.

So that lsp don’t put a squiggle on the entire program, only the type hole

myxi ,
@myxi@feddit.nl avatar

I also leave out little syntax errors and only only focus on the rough idea during my train of thoughts. And the variables, aren’t really supposed to be implied as private or unused – I do eventually meaningfully use them. If I have to prefix all my variables with a underscore to avoid the LSP, I might instead just disable the LSP. When I eventually turn the LSP back on, it tells me the actually unused variables and imports that I can now get rid of.

Because of the LSP, I used to write maybe three hundred lines of code per hour, but now I probably average at least five hundred or more.

RonSijm , in Variable Declaration
@RonSijm@programming.dev avatar

On the other hand, when my IDE doesn’t tell me:

Build Server: “BUILD FAILED! SonarQube says that Roslyn says that you’re not using one of your variables!”

Yea okay calm down, and why are you snitching now, Roslyn? Should have told me directly 🙃

WILSOOON , in Uh...oh...

This is a good one, although theory is a much better problem to have than practice

turtlepower ,

Yeah, but practice makes perfig perfect.

ZILtoid1991 , in Gamedev is Easy

EnableSpatialAudio()

I thought most games nowadays don’t do any of that, because you can save that CPU time for a little big more frames.

snugglebutt ,
@snugglebutt@lemmy.blahaj.zone avatar

Save that CPU time for Denuvo

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