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.

sukhmel , in "No way to prevent this" say users of only language where this regularly happens - 07/01/2024

Also, I like how this problem had a really simple solution all along

There really isn’t anything we can do to prevent memory safety vulnerabilities from happening if the programmer doesn’t want to write their code in a robust manner.

Yeah, totally, it’s all those faulty programmers fault. They should’ve written good programmes instead of the bad ones, but they just refuse to listen

onlinepersona OP , (edited )

Right, those devs with 20+ years C experience don’t know shit about the language and are just lazy. They don’t want to catch up with the times and write safe C. It’s me, the dude with 5 years of university experience who will set it straight. Look at my hello world program, not a single line of vulnerable code.

Anti Commercial-AI license

sukhmel ,

This is not completely wrong, though

onlinepersona OP , (edited )

Yeah, for sure. Human error is involved in C and inertia too. New coding practices and libraries aren’t used, tests aren’t written, code quality sucks (variable names in C are notoriously cryptic), there’s little documentation, many things are rewritten (seems like everybody has rewritten memory allocation at least once), one’s casual void * is another’s absolute nono, and so on.

C just makes it really easy to make mistakes.

Anti Commercial-AI license

Corbin ,

It has nothing to do with knowing the language and everything to do with what’s outside of the language. C hasn’t resembled CPUs for decades and can’t be reasonably retrofitted for safety.

asyncrosaurus ,

Well yeah, 100% of programming errors are programmers fault.

rushaction , in "No way to prevent this" say users of only language where this regularly happens - 07/01/2024

… the only language where 90% of the world’s memory safety vulnerabilities have occurred in the last 50 years

Yeah… That’s a shit post alright.

I’m not a C developer myself, but that’s just a low blow. Also, uncited ;).

5C5C5C ,

Yeah the only way it would be that high is if it lumps C and C++ together. But at that point it may be an underestimate.

verstra , (edited )

This is an overstatement, definitely. C is one of the few (mainstream) languages where memory safety vulnerabilities are even possible. So if you batch C and C++ together, they probably cover more than 90% of all the memory unsafe cove written in last 50 years, which is a strong implication that they will contribute to 90% of memory vulnerabilities.

All that said, memory vulnerabilities are about 65% of all high implact vulnerabilities on Chromium project^1 and about 70% of vulnerabilities at Microsoft ^2.

calcopiritus ,

So we’d only fix 70% of vulnerabilities by switching to rust? Not enough! Better keep writing C/C++!

refalo , in "No way to prevent this" say users of only language where this regularly happens - 07/01/2024

lol this same post got flagged and taken down from HN

verstra ,

Well, lemmy is a place for much more cultured audience. We can appreciate a good shitpost (that does also hold some water).

yum13241 , in Please stop

Yes. I love this meme template.

This comment was brought to you by the EndeavourOS gang.

jamietanna , in Trying to understand JSON…
@jamietanna@programming.dev avatar

Had to solve this with Go recently, which was not as straightforward as I’d hoped! www.jvt.me/posts/2024/01/09/go-json-nullable/

0x0 , in "No way to prevent this" say users of only language where this regularly happens - 07/01/2024

The “C is bad trope” is getting way too old. I’m surprised the author didn’t plug Rust.

the only programming language in the world where these vulnerabilities regularly happen

Maybe because it’s one of the most widely used languages in the world…

sukhmel ,

Well, one of the most widely used that allows to do low-level stuff. The most widely used one is by far JavaScript but good luck making an OS or a device driver with it

fuzzzerd ,

I’m sure there are projects covering those areas written in JavaScript.

echindod ,

Oh gawd. That would be so horrible! Is there a project o compile JavaScript to bytecode? With like LLVM? There must be, but I haven’t heard of it. I shouldn’t even say anything because I will be better off pretending it doesn’t exist.

calcopiritus ,

Just bundle a JavaScript interpreter with the JavaScript code. No need to compile JavaScript.

OutsideNo1877 ,

Just because you can doesn’t mean you should and i hope that is not a thing

BatmanAoD ,

The trope will be “old” once the mainstream view is no longer that C-style memory management is “good enough”.

That said, this particular vulnerability was primarily due to how signals work, which I understand to be kind of unavoidably terrible in any language.

5C5C5C ,

A better language wouldn’t have any need to use POSIX signals in this way.

BatmanAoD ,

I’m not totally clear on why signals are used here in the first place. Arguably most C code doesn’t “need” to use signals in complex ways, either.

Bonje , in Looks good to me 👍
@Bonje@lemmy.world avatar

The trick is that 10 lines of code usually pull in thousands as they are likely function calls.

JackbyDev , in Trying to understand JSON…

Just what every programming language needs, not one, but two types of null! Because nobody ever said one type was difficult enough.

If I see any of you make this distinction matter for anything other than “PUT vs. PATCH” semantics I’m going to be very angry.

bleistift2 OP ,

I do this constantly. undefined: not retrieved yet. null: Error when retrieving. Makes it easy to reason about what the current state of the data is without the need for additional status flags.

magic_lobster_party , in Looks good to me 👍

I’m the opposite. If there’s 500 lines I will look closer for issues. If there’s only 10 lines it’s LGTM. I’m not going to reward such behavior.

TheSlad , in Looks good to me 👍

In my first programming job, I would actually do code reviews by pausing my own work, pulling their branch and building it locally, then using debug mode to step through every changed or added line of code looking for bugs, unaccounted for edge cases, and code quality issues.

…I dont do that anymore, I now go “looks good to me” even on 10 line reviews.

silasmariner ,

Yeah but I bet you do it sometimes on your own pull requests even after you’ve opened them don’t you?

ID411 , in Looks good to me 👍

Perhaps unknowingly, this is a rehash of an age old comic, where a boss needs to get his secretary to type up a massive report.

MonkderDritte , in Looks good to me 👍

Pycharms warns me about cognitive complexity of functions. Other IDEs too i assume?

gnutrino , in Looks good to me 👍

This is why I always rename all the variables in the project on each PR.

jol ,

I know this is a joke, but it you did that I would reject the pr with the reason of too many things at once. Reopen separate PR to refactor variable names. I actually constaly get people doing this and it’s dangerous exactly for the reason you’re joking about. Makes it easier for errors to slip in.

Lifter ,

This will lead to change fatigue. People will rather not cleanup as they go anymore and just get the work done, with worse and worse code quality as a result.

jol ,

I prefer that than to sneak defects in huge PRs.

silasmariner ,

I know you’re playing the straight man to a joke, but actually you can apply a linter, then tell GitHub to ignore the implied ownership history for the purposes of blame from that reclining pr. All such prs are massive and yet by virtue of the replayability of the linter it’s also very easy to ensure errors didn’t slip in when reviewing.

I know the original comment was about renaming all the variables, but that’s obviously deliberately absurd, so I’m using here a completely realistic example instead.

brrt , in Looks good to me 👍

Just give them 10 lines at a time from the 500 lines one. Is this how micromanagement was born?

ID411 ,

It’s how elephants are eaten

LeFantome ,

If you do that, you will never get through the toenails. Been there.

neonred , in Junior dev VS FAANMG dev

and CI/CD goes “f*ck you, no deployment today, Linter is unhappy”

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