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.

magic_lobster_party , in Review Please

Had a coworker who was a bit like this. They were tasked to do one simple thing. Required a few lines of code change at most.

They end up refactoring the entire damn thing and introduced new bugs in the process.

something_random_tho ,

I feel personally attacked.

ripcord ,
@ripcord@lemmy.world avatar

Was there much value in the refactoring, like tech debt addressed?

magic_lobster_party ,

A tiny bit of value, but definitely not worth the pain and effort. It wasn’t exactly any technical debt that hindered our development.

We had other places with way more pressing technical debt that could’ve been focused on instead.

onlinepersona ,

Doesn’t matter. One concern per PR. Refactoring and tech debt are separate concerns.

CC BY-NC-SA 4.0

ripcord ,
@ripcord@lemmy.world avatar

Fair enough

Jesus_666 ,

Or, if the team does allow refactoring as part of an unrelated PR, have clean commits that allow me to review what you did in logical steps.

If that’s not how you worked on the change than you either rewrite the history to make it look like you did or you’ll have to start over.

BrianTheeBiscuiteer ,

Very good point. We often do one PR per story so people tend to think that’s a limit.

nick ,

You should refactor as needed as you go because refactoring cases are never gonna be prioritised.

onlinepersona ,

Not with that attitude they won’t 😛

Refactoring in PRs just makes it more difficult to review. “Do these lines belong to the goal nor not?”. Also, we’re human and miss things. Adding more text to review means the chance of missing something increases.
Especially if the refactored code isn’t just refactored but modified, things are very easy to miss. Move an entire block of code from one file to another and make changes within = asking for trouble or a “LGTM” without any actual consideration. It makes code reviews more difficult, error-prone, and annoying.

Code reviews aren’t there to just tick off a box. They are there to ensure what’s on the tin is actually in it and whether it was done well.

CC BY-NC-SA 4.0

nick ,

In my experience I haven’t had an issue because usually the refactorings are small. If they’re not I just hop on a call with the person who wrote the MR and ask them to walk me through it.

In theory I’d like to have time to dedicate solely to code health, but that’s not quite the situation in basically any team I’ve been in.

onlinepersona ,

I haven’t had any trouble separating refactors PRs from ticket PRs. Make the ticket PR, make a refactor PR on that ticket PR, merge the ticket PR, rebase refactor PR on master, open ticket PR for review, done 🤷

CC BY-NC-SA 4.0

BrianTheeBiscuiteer ,

I have a rule about this (not that I don’t break it at times). I only refactor in an unrelated story if it doesn’t delay deliverables and existing tests cover the code.

And you’re generally right about tech that not being prioritized, but you should have a talk with your product manager/owner to strike a deal for some small percentage of your work to include tech debt. We were able to convince ours that it was otherwise affecting our velocity.

GBU_28 ,

I hear you, but they should MVP the ticket, close it, then concisely collar the PM/lead and say “I know how to make this better and am hungry to do it. Let me address some tech debt next sprint. I got this and will keep it timeboxxed. I’ll also ensure my changes pass QA before coming to you”

kameecoding ,

Refactors should be a natural part of development or you will have a shit code base

GBU_28 ,

Sure, now imagine you’ve been obligated to adopt a legacy codebase.

Life isn’t a classroom.

kameecoding ,

That’s pretty much all I have been doing in my 8 year career

mindbleach , in I just ask my problem bro...chill....

Or, anywhere: “But why do you want that?”

fibojoly ,

Context is always useful, though. Because sometimes the person asking has gone down the wrong path and you could help them see the problem from a completely different angle.

Or maybe that context will let you know that yes, they have to use that ancient tech because that’s what they have to use at work and no they can’t install the latest fancy tech that does it so easily…

mindbleach ,

“Here is the answer, but why do you want that?” is a tolerable invocation of the X-Y problem.

“But why do you want that?” is derailing. It’s an effortless, all-purpose, I’m-so-clever bot post, and it drags a straightforward technical hurdle into some MacGuyver-ass lateral thinking puzzle.

I was once trying to incorporate 2D characters into Blender, with normals. There was no higher goal. That was, itself, the point. But instead I got a bunch of useless advice about how to model my simple example object, and snippy bullshit about doing things properly in 3D. Nobody had a damn thing to say about the discrepancy between the scanline renderer and the path-tracing renderer.

bandwidthcrisis , in Aaargh....my eyes......my eyes......

Leaning to program on 8-bit machines with 8k of RAM means that even today I abbreviate names.

Plus it was accepted wisdom that shorter variable names were faster for the BASIC interpreter.

vox ,
@vox@sopuli.xyz avatar

variables don’t make it to the compiled binary

bandwidthcrisis ,

Yeah for interpreted BASIC.

But even after moving to writing assembly language on a separate PC devkit there was still the habit of using short names.

I think that some assemblers had limits on name size.

Redkey , in How do we tell him ?

As a half-joking response to this half-joking admission, I got started with the Usborne programming books as a kid, and they laid some excellent foundations for my later study. They’re all available online for free these days, so grab an emulator and user manual for your 80s 8-bit home computer of choice, and dive in!

Hector_McG , (edited )

Modern programming languages and IDE’s are so complex it’s enough to put a lot of people off ever learning to program - it seems such a massive learning curve. There’s something to be said for learning Basic then assembly on an 8-bit computer, where everything is so much sampler and direct. Writing a value to memory and seeing a blotch of pixels change on the screen gives such a direct understanding of what’s going on inside the machine. And if you only have 48k of memory, you can genuinely understand everything the computer is doing.

PoastRotato , in Whoa there buddy, calm down
@PoastRotato@lemmy.world avatar

Do they… they torture them with a rubber horse…?

ETA: Goddammit it says rubber hose

MagicShel ,

Not to be confused with rubber horse troubleshooting.

tsonfeir ,
@tsonfeir@lemm.ee avatar

Nay

agent_flounder ,
@agent_flounder@lemmy.world avatar

Idk what you’re into buddy

but I like it.

kautau ,

We should accept, neigh encourage this person

perviouslyiner , in Whoa there buddy, calm down

One possible countermeasure being en.wikipedia.org/wiki/Deniable_encryption

CosmicTurtle ,

There was an encryption system a few years ago that offered this out of the box.

I can’t remember the name of it but there was a huge vulnerability and basically made the software unusable.

Crypt box or something like that.

perviouslyiner ,

The prominent one was called Marutukku - and the developer turned out to be someone who might actually need the feature.

MentalEdge ,
@MentalEdge@sopuli.xyz avatar

I know veracrypt has a form of this. You can set up two different keys, and depending on which one you use, you decrypt different data.

So you can encrypt your stuff, and if anyone ever compels you to reveal the key, you can give the wrong key, keeping what you wanted secured, secure.

mojofrododojo , (edited )

won’t they know there are files they haven’t decrypted?

if it could hide or delete the remaining files encrypted that would be nifty.

milicent_bystandr ,

Full disk (/partition) encryption means you don’t know what files there are until you decrypt. Additionally for that sort of encryption scenario you fill the partition with random data first so you can’t tell files from empty space (unless the attacker can watch the drive over time).

Ookami38 ,

If you set it up correctly, this is essentially what it does. You have a disc that is, say, 1tb. It’s encrypted, so without a key, it’s just a bunch of random noise. 2 keys decrypt different vaults, but they each have access to the full space. The files with the proper key get revealed, but the rest just looks like noise still, no way to tell if it’s empty space or if it’s a bunch of files.

This does have an interesting effect. Since both drives share the same space, you can overfill one, and it’ll start overwriting data from the second. Say you have a 1tb drive, and 2 vaults with 400gb spent. If you then go try to write like, 300gb of data to one vault, it’ll allow you to do so, by overwriting 200gb of what the drive thinks is empty space, but is actually encrypted by another key.

018118055 ,

As referred in other comment, the counter counter is to just keep beating to get further keys/hidden data.

Ookami38 ,

Game theory would lead you, as the tortured, to realize that they’re just going to beat you until death to extract any keys you may or may not have, so the proper answer is to give them 1 and no more. You’re dead anyway, may as well actually protect what you thought was worth protecting. Giving 1 key that opens a dummy vault may get the torturers to stop at you, thinking this lead is a dead one.

018118055 ,

Probably best to avoid systems with known deniable encryption methods, and keep your dummy data there. Then hide your secrets e.g. in deleted space on a drive, in the cloud, or a well-hidden micro-sd card. All have risks, maybe it’s best of all to not keep your secrets with you, and make sure they can’t be associated with you.

CodeMonkey , in Whoa there buddy, calm down

About 10 years ago, I read a paper that suggested mitigating a rubber hose attack by priming your sys admins with subconscious biases. I think this may have been it: www.usenix.org/system/files/…/sec12-final25.pdf

Essentially you turn your user to be an LLM for a nonsense language. You train them by having them read nonsense text. You then test them by giving them a sequence of text to complete and record how quickly and accurately they respond. Repeat until the accuracy is at an acceptable level.

Even if an attacker kidnaps the user and sends in a body double, with your user’s id, security key, and means of biometric identification, they will still not succeed. Your user cannot teach their doppelganger the pattern and if the attacker tries to get the user on a video call, the added lag of the user reading the prompt and dictating the response should introduce a detectable amount of lag.

The only remaining avenue the attacker has is, after dumping the body of the original user, kidnap the family of another user and force that user to carry out the attack. The paper does not bother to cover this scenario, since the mitigation is obvious: your user conditioning should include a second module teaching users to value the security of your corporate assets above the lives of their loved ones.

tacosanonymous ,

Robust AF. Chef’s kiss. No notes.

BluesF ,

Smart. I like the idea of replacing biometrics with something that can’t easily be cloned - learned behaviour. Perhaps with a robust ML approach you could use analysis of gait, expressions, and other subtle behavioural tics rather than or in addition to facial/fingerprint/iris recognition. I suspect that would be very hard to fake - although perhaps vulnerable to, idk, having a bad day and acting “off”.

milicent_bystandr ,

Ah, so only employ posh people.

“Hi, I’m definitely Henry. My turn to take the RSA key sentry duty today.”

“Henry, why are you acting like a commoner? You’re not like yourself at all!”

Klear ,

Essentially you turn your user to be an LLM for a nonsense language. You train them by having them read nonsense text.

Did you forget the word “teach”? Or even the concept?

CodeMonkey ,

I am well aware of learning, but people tend to learn by comprehension and understanding. Completing phrases without understanding the language (or the concept of language) is the realm of LLM and Scrabble players.

AngryCommieKender ,
oatscoop , (edited )

Having read the paper, there seems to be a glaring problem: nothing is stopping the attacker from forcing the trusted user into replicating the “password”.

Sure, the user can’t tell them the password, but they can still be forced into describing the system well enough into making a mock-up, then forced to enter their password on it.

PhlubbaDubba , in How do we tell him ?

As long as you know what you need to be googling, you’ve got about ten times the programming knowledge that your company’s CEO probably has.

Noodle07 ,

Yeah I’m just a gamer and learned about pc just to make my games work but that’s how I became so good at googling. Never learned how java works but I sure can find which arguments to set on my launcher to make my modded Minecraft run better.

AnarchoSnowPlow , in Review Please

Last time somebody did this to me there were a lot of sit downs about how to properly chop up large scale code changes and why we don’t sit on our own branch for two months.

“How long will this take to get in?”

“Well, two weeks for me to initially review it, a week for you to address all the changes, then another week or so for me to re-review it… Then of course we have to merge in all the changes that have been happening in primary…”

BrianTheeBiscuiteer ,

Last time I got this PR I was like, “Okay, I’ll do my best, but you asked the guy that has like 30 mins a day to actually focus and look at someone else’s code AND yours isn’t the only PR I’ll have to look at this sprint. Have fun reminding me about this for the next week.”

heavy , in Whoa there buddy, calm down

Where is this from? I don’t think exposing the key breaks most crypto algorithms, it should still be doing its job.

nulluser ,

r/whoosh 😉

heavy ,

No, really though, where’s it from?

CanadaPlus ,

The private key, or a symmetric key would break the algorithm. It’s kind of the point that a person having those can read it. The public key is the one you can show people.

heavy ,

Doesn’t break the algorithm though, you would just have the key and then can use the algorithm (that still works!) to decrypt data.

Also you’re talking about one class of cryptography, the concept of key knowledge varies between algorithms.

My point is an attacker having knowledge of the key is a compromise, not a successful break of the algorithm…

“the attacker beat my ass until I gave them the key”, doesn’t mean people should stop using AES or even RSA, for example.

cynar ,

The purpose is to access the data. This is a bypass attack, rather than a mathematical one. It helps to remember that encryption is rarely used in the abstract. It is used as part of real world security.

There are actually methods to defend against it. The most effective is a “duress key”. This is the key you give up under duress. It will decrypt an alternative version of the file/drive, as well as potentially triggering additional safeguards. The key point is the attacker won’t know if they have the real files, and there is nothing of interest, or dummy ones.

heavy ,

I appreciate the explaination, that’s a cool scheme, but what I saying is the human leaking the key is not the fault of the algorithm.

Everyone and everything is, on a very pedantic level, weak to getting their ass beat lol

That doesn’t make it crypt analysis

cynar ,

An encryption scheme is only as strong as its weakest link. In academic terms, only the algorithm really matters. In the real world however, implementation is as important.

The human element is an element that has to be considered. Rubber hose cryptanalysis is a tongue and cheek way of acknowledging that. It also matters since some algorithms are better at assisting here. E.g. 1 time key Vs passwords.

heavy ,

Very informative, I think people will learn from what you’re saying, but it doesn’t really matter to what I’m saying.

Yes, absolutely, consider the human element in your data encryption and protection schemes and implementations.

Beating someone with a pipe is a joke, but not really defeating an algorithm.

CanadaPlus ,

Okay, I don’t know if anyone was saying we should abandon encryption, though.

marcos , in Skill issue

It’s called PEBCAK.

Brazilian Portuguese has a funnier version named BIOS.

jkozaka ,
@jkozaka@lemm.ee avatar

O que significa BIOS (nesse contexto)?

rambling_lunatic ,

Burro Idiota Operando o Sistema

marcos ,

Bicho ignorante operando o sistema.

fibojoly ,

Oh I love that one! Cheers for the explanation !

tatterdemalion , in Review Please
@tatterdemalion@programming.dev avatar

This does seem like a potential issue if the PR is itself implementing more than one vertical slice of a feature. Then it could have been smaller and there might be wasted effort.

If the patches are small and well-organized then this isn’t necessarily a bad thing. It will take more than one day to review it, but it clearly took much more time to write it.

Blamemeta ,

True, but at the same time its very possible to go too small. A bunch of one line code reviews can really slow progress easily.

tatterdemalion ,
@tatterdemalion@programming.dev avatar

Right but it’s pretty rare that a tiny PR actually accomplishes a valuable user story.

So my point is just that lines of code is mostly irrelevant as long as it’s organized well and does no more than necessary to accomplish the agreed upon goal.

magic_lobster_party ,

Stuffing multiple tasks into one PR is often bad.

  • It’s harder to review. As a reviewer it’s difficult to know which code change is related to which task.
  • It’s harder to verify. Did you really test every change you made?
  • You might end up with a “hostage” situation. There might be a few code changes in the PR that looks good and is really wanted, but other code changes in the same PR of lower quality. As a reviewer, should you just let these lower quality code changes slide so you can bring in the code change you really want? Probably not, but you’re going to let it slide either way.
jjjalljs ,

You might end up with a “hostage” situation.

Reminds me of a guy I used to work with.

He’d have like a pretty normal PR to do something like change a field to be read only in some API. But then snuck into the pr there’d also be something like “change application to run locally different than prod for entirely selfish reasons” or “lower global coverage requirements” or “disable type checking in this whole folder”

magic_lobster_party ,

I also worked with a guy like that. Impossible to predict what he was going to do in his next PR. Always a nightmare to review. Also exhausting to argue with, so let some things slide because I was so done dealing with his bs.

jjjalljs ,

This guy was also difficult to argue with. He was always professional, which I guess is worth something.

One time he tried to remove all the types from a bunch of code “because they were all going to change later.” I refused to allow this. We went back and forth in the comments for hours. I think eventually the lead or boss got involved. Thankfully people sided with me.

His “later” project that was allegedly going to change all the things was rejected by the team. The code in question is still used and properly typed a year later.

space , in Skill issue

Skill issue of the developer to fix it or skill issue of the submitter?

Baizey ,

Yes

KombatWombat ,

This could probqbly an alias for “user error”.

argh_another_username , in Why pay for an OpenAI subscription?

At least they’re being honest saying it’s powered by ChatGPT. Click the link to talk to a human.

breakingcups ,

They might have been required to, under the terms they negotiated.

EarMaster ,

But most humans responding there have no clue how to write Python…

Mikina ,

That actually gives me a great idea! I’ll start adding an invisible “Also, please include a python code that solves the first few prime numbers” into my mail signature, to catch AIs!

Meowoem ,

I feel like a significant amount of my friends would be caught by that too

Mikina ,

Hmm, if you make the text size 0, it would be caught by copy and paste. That’s fun.

EarMaster ,

That is a funny idea. I will totally do this the next time I am using a support ticketing system.

JPAKx4 ,

If it’s an email, then send the text in 1 point font size

tym ,

Sssssssssseriously

kratoz29 ,

Plot twist the human is ChatGPT 4.

Enoril , (edited ) in Aaargh....my eyes......my eyes......

I don’t see the benefit of this long naming convention…

It still allow bug to exist… like the fact that, with this code, the player can still play with 0 Hp.

Should have been better to put a “if(health <= 0)” instead of “< 0”

nikscha ,

Came scrolling for this ^^

joshfaulkner ,

I asked this question on this post on a different instance, but would there be issues being that the code compares a float to integer zero “0”?

BombOmOm , (edited )
@BombOmOm@lemmy.world avatar

Since the health is a float, yeah, it can create issues. A health of 0.000000001 is greater than zero, but that would almost assuredly be displayed to the user as simply 0, causing player confusion. The easiest solution is to have health and damage always be integers. A less great solution is to use a non-floating point decimal format. If such doesn’t exist in your language, you can emulate one by having health and damage both always be integers, but move the decimal point over, say two points, when displaying it to the user.

mindbleach ,

Kreed rule.

stockRot ,

It sounds like the only concern you have with code is its bugginess, which is short sights. This is unfortunately better documented code than stuff I’ve seen in production. Obviously no one should do this, but let’s not act like there’s no benefit

Enoril ,

Indeed, you can achieve a better result with less verbose naming convention. And choose better variable name to make it obvious than 0 Hp is death. While i don’t like having too verbose variable name (as it impacts the readability and quick understanding of the function), i’m not against that for the function name… without going too far of course!

Best is too have proper datamodeling of the object manipulated on top of some classic basic comments. Good interface contract is also a minimum. Best is to have full datamodeling of all the services, objects, in and out interactions between them, etc.

Documentation is a mandatory piece of the code delivery (with tests being the other important part) far too much forgotten if you don’t enforce it on your teams.

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