This wasn't a dispute though. This was clearly fraud, and I think it becomes criminal due to wire fraud (fraud crossing state or national borders).
To me, this falls under the category of white collar crime. I'm OK with white collar criminals serving time. It's not like this case is in a gray area. It's clearly a conspiracy to commit fraud on a large scale.
I get where you're coming from. It's not stealing. But, setting up fake accounts in order to trick Spotify into sending him money is clearly fraud.
I think you can look at relative impact and decide this. Did the “white collar” crime wreck people’s lives, leaving them destitute? Jail. Did it kill people through negligence, lowering safety standards, or similar? Jail. Did it hurt the bottom line of a large company by 1% or less with no other obvious impact? Maybe they just have to pay it back plus a large, punitive penalty. Maybe they have to do some public service too. But jail doesn’t really make sense. If anything, jail just prevents them from compensating the victim.
Less than 1/10 of restitution is ever paid out. When you send someone to jail, especially for a long time, you’re basically guaranteeing that they aren’t going to make good on any victim compensation.
>Did it hurt the bottom line of a large company by 1% or less with no other obvious impact? Maybe they just have to pay it back plus a large, punitive penalty. Maybe they have to do some public service too. But jail doesn’t really make sense. If anything, jail just prevents them from compensating the victim.
So what does it mean for the movie trope where a hacker steals fractions of cents from everyone's bank account, leading him to get millions in loot? By any meaningful measure that didn't hurt anyone's bottom line, so that ought to be fine, right? Even if you think this is somehow okay, what about the "death by a thousands cuts" problem, where a trillion dollar company gets scammed 1000 times, which becomes a deleterious amount? Do you have to prosecute people at some point? How would that work?
That doesn't sound like something that should cause someone to be locked away either. Prison should be reserved for people who are too dangerous to be living among the rest of us, along with short jail times when needed to prevent people from fleeing prior to their day in court when the risk of that happening is high enough.
Most of the time, no. Branchless code is harder to read and easier to get wrong. Besides, compilers know a lot of tricks and already do a lot of this work for us.
Only when a profiler points at a hot loop, and the loop contains a branch on unpredictable data this technique can pay off big.
I rather think the opposite. People who share tips and hacks are genuinely trying to help others, while people who hoard information are competing on an individual basis without regard for team.
Please take this in good faith, as I hope your own post is, but I interpret the thread you're replying to as focusing on the "everyday' part.
Share knowledge? I don't think anyone here is arguing against that in any way (or conversely arguing for hoarding knowledge).
The concern, one I share, is where the sharing has to happen publicly "every day" - so no matter how trivial, useless, niche, overly-specific the tip is (whatever, the list isn't exclusive), someone shares it.
That's the part that's not sharing knowledge for the benefit of others, but rather self-serving. I might even go so far as to say self-serving doesn't even need to be selfish; the person might genuinely believe they're doing good, but even there, self-serving.
TLDR: Share your knowledge, don't make sharing something every day, even when you don't have something valuable to share, your target.
PS - if this note irks anyone (are routine maxxers a thing?), make the goal to learn something every day, then share where appropriate.
> Treating a public channel like ye olde facebok wall? Mildly annoying.
Every team/department/org/whatever should have channels everyone should subscribe to, and channels individuals set up that are optional for everyone. The appropriate way to handle this is for the OP to write a few tips once in a while in the public channel, and if people seem to like it, announce that all future tips will be in that channel.
Yeah, I don't buy the premise that branchless code is intrinsically easier to understand. Maybe OP's point is that adding unnecessary branches makes code harder to read? But that's generally the case for any unnecessary code.
and skipping the if just makes the function shorter and simpler, while also not involving the CPU branch prediction. Another one that doesn't necessarily skip all branching but at least drops one - and more importantly makes the code simpler and easy to verify, is removing the if statement in code like
if (count == 0) {
return;
}
for (int i = 0; i != count; i++) {
puts("hello");
}
Both of your examples are optimized by the compiler (gcc 16.1 -O3).
In the first case, the compiler removes the first if/return
In the second case, if you don't have the first if/return the compiler will add it. That's because it will actually convert your loop into a do/while, with the test in the end, because it is more efficient. But it has to handle the count == 0 special case first, so it will do that early return even if it is not explicitly there.
That's the kind of optimization modern compilers are good at.
v = setup()
if v == 1:
side_effect_1()
elif v > 1:
side_effect_1()
side_effect_2(v)
else:
raise Exception()
then we can "refactor"
v = setup()
if v < 1:
raise Exception()
side_effect_1()
if v > 1:
side_effect_2(v)
i know that this might seem "dumb" that the code was ever setup the first way but code can grow into that shape pretty easily. this refactor "removes" the v==1 branch. this new code also follows the "early return" pattern, which improves readability.
No, because the point is that the branch version does not touch "total" when the branch is taken, but the non-branch version will always multiply "total" by something.
To me, this falls under the category of white collar crime. I'm OK with white collar criminals serving time. It's not like this case is in a gray area. It's clearly a conspiracy to commit fraud on a large scale.
I get where you're coming from. It's not stealing. But, setting up fake accounts in order to trick Spotify into sending him money is clearly fraud.
reply