Call sorry.next().value as many times as you need to baby, hell you can even use it in a for-of loop because Generator functions are Iterable. I fucking love JavaScript
I think it’s equal zero in this case. I’d have to look up the IEEE specification to make sure. AFAIK it’s just not guaranteed for any numbers and depends on the floating point implementation. A general rule of thumb for programmers is not to use ‘equal’ with floating point numbers.
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.
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.
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.
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”
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.
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.
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).
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.
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.
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.
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.
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
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.
Totally agree with this. I was trying to do CSS theming on my personal website on SDF to try and make it look nicer but I gave up and just went without it because it never worked right. It’s a crappy website anyway with a lot of problems (doesn’t have correct margins so on anything outside specific resolutions it looks wonky).
Yeah, it’s weird to me as an engineer that when I’m on Lemmy people use that word to mean programmer. Nah, I work in a factory and had to learn thermodynamics
In my mind, the line is that an engineer is someone that can commit a crime by doing their job incompetently. If the only things at risk are your job and your pride, that’s a different thing.
“I program all day, so there’s a lot of trial and error. My friend is a negligent civil engineer, so there’s a lot of error and trial.”
If you’re an electrical engineer who works in a nuclear power plant and your incompetence leads to a meltdown, you’re going to go on trial. Possibly also if you’re doing software engineering for the control systems of that power plant.
If you’re a software engineer who works on Lemmy, not so much.
It’s always been weird to me as someone who isn’t an engineer in degree or title why those with degrees in engineering think people shouldn’t use an accurately descriptive word like engineer when it’s perfectly appropriate just because it’s a little to close to the title of their licensed profession.
Engineer is a verb, to devise or contrive something. Simply, to design a construct. A programmer by definition engineers a program and is therefore by the rules of the English language, an engineer.
They may not be a Licensed Professional Engineer, but an Engineer they remain.
But, we’re not talking about formal titles. We’re talking about job titles. I’ve never heard of someone called “Engineer Jones”, just “Mr. Jones who is an Engineer”.
If you’re a doctor of musical theory but you work in human resources as a clerk and someone asks you for your job title, you don’t say “Doctor Clerk”, you say “Clerk”.
So, if you’re trained as a Civil Engineer but you changed careers and are now writing javascript, are you a Software Engineer, whereas someone with a Computer Science degree can’t claim that title?
I draw the line at using just “Engineer”. The word Engineer has baggage, it means something pretty specific already. If you engineer something other than physical structures you should list what that something is, like Software Engineer or Network Engineer.
Train Engineer is a bit confusing because they also have historical claim to “Engineer” but no longer have the same electrical and mechanical education afaik. Correct me if I’m wrong!
programmer_humor
Top
This magazine is from a federated server and may be incomplete. Browse more on the original instance.