[-] FizzyOrange@programming.dev 17 points 2 weeks ago

Its definitely best to try and avoid raw pointers, but even if you try really hard I found it's not really possible to get a Rust-like experience with no UB.

Even something as simple as std::optional - you can easily forget to check it has a value and then boom, UB.

The C++ committee still have the attitude that programmers are capable of avoiding UB if they simply document it, and therefore they can omit all sanity checks. std::optional could easily have thrown an exception rather than UB but they think programmers are perfect and will never make that mistake. There are similar wild decisions with more recent features like coroutines.

They somehow haven't even learnt the very old lesson "safe by default".

If I wanted memory unsafety I think I would consider Zig instead of C++ at this point.

[-] FizzyOrange@programming.dev 20 points 3 weeks ago
def foo(x):
  return x.whatevr

No linter is going to catch that.

[-] FizzyOrange@programming.dev 16 points 1 month ago

TOML is not a very good format IMO. It's fine for very simple config structures, but as soon as you have any level of nesting at all it becomes an unobvious mess. Worse than YAML even.

What is this even?

[[fruits]]
name = "apple"

[fruits.physical]
color = "red"
shape = "round"

[[fruits.varieties]]
name = "red delicious"

[[fruits.varieties]]
name = "granny smith"

[[fruits]]
name = "banana"

[[fruits.varieties]]
name = "plantain"

That's an example from the docs, and I have literally no idea what structure it makes. Compare to the JSON which is far more obvious:

{
  "fruits": [
    {
      "name": "apple",
      "physical": {
        "color": "red",
        "shape": "round"
      },
      "varieties": [
        { "name": "red delicious" },
        { "name": "granny smith" }
      ]
    },
    {
      "name": "banana",
      "varieties": [
        { "name": "plantain" }
      ]
    }
  ]
}

The fact that they have to explain the structure by showing you the corresponding JSON says a lot.

JSON5 is much better IMO. Unfortunately it isn't as popular and doesn't have as much ecosystem support.

[-] FizzyOrange@programming.dev 19 points 1 month ago

Good. I had a couple of answers to one of my questions that just wasted my time before I realised they were AI. The authors didn't get banned annoyingly.

[-] FizzyOrange@programming.dev 16 points 1 month ago

I use this big expensive simulator called Questa, and if there's an error during the simulation it prints Errors: 1, Warnings: 0 and then exits with EXIT_SUCCESS (0)! I tried to convince them that this is wrong but they're like "but it successfully simulated the error". 🤦🏻‍♂️

We end up parsing the output which is very dumb but also seems to be industry standard in the silicon industry unfortunately (hardware people are not very good at software engineering).

[-] FizzyOrange@programming.dev 18 points 1 month ago

valid criticism of his own defense

To be clear that post makes a valid point (don't defend people just because they seem nice or dedicated or whatever), but it isn't a valid criticism of Chris's post because he didn't do that.

He did say Tim is nice and dedicated etc. etc. but he also went through the specific crimes that Tim was supposed to have committed and refuted them.

I read a load of Tim's comments and this was definitely a case of the CoC people getting annoyed with someone who disagreed with them and wouldn't give up. There wasn't anything remotely ban-worthy.

[-] FizzyOrange@programming.dev 16 points 5 months ago

Yeah I kind of agree but I also think when it gets to that point we'll have much bigger problems than programmers losing their jobs. Like, most of society losing their jobs.

[-] FizzyOrange@programming.dev 18 points 5 months ago

This sounds like a great improvement. I have read the sudo source code and anyone that seriously thinks there's no problem with it being SUID is crazy.

That said the whole security model of sudo makes no sense. As soon as you can access a sudoers' account you can trivially steal their password by MitMing sudo and waiting.

[-] FizzyOrange@programming.dev 17 points 6 months ago

Yeah IIRC it deletes them, which is as mad as you would expect. Maybe they've fixed that since I used it last which was some years ago.

[-] FizzyOrange@programming.dev 16 points 6 months ago

Yeah I think it's trauma due to C/C++'s awful warning system, where you need a gazillion warnings for all the flaws in the language but because there are a gazillion of them and some are quite noisy and false positives prone, it's extremely common to ignore them. Even worse, even the deadly no-brainer ones (e.g. not returning something from a function that says it will) tend to be off by default, which means it is common to release code that triggers some warnings.

Finally C/C++ doesn't have a good packaging story so you'll pretty much always see warnings from third party code in your compilations, leading you to ignore warnings even more.

Based on that, it's very easy to see why the Go people said "no warnings!". An unused variable should definitely be at least a warning so they have no choice but to make it an error.

I think Rust has proven that it was the wrong decision though. When you have proper packaging support (as Go does), it's trivial to suppress warnings in third party code, and so people don't ignore warnings. Also it's a modern language so you don't need to warn for the mistakes the language made (like case fall through, octal literals) because hopefully you didn't make any (or at least as many).

[-] FizzyOrange@programming.dev 17 points 6 months ago

Are there any videos of this sort of editing, because honestly every single person I've watched use Vim has just been like "oh wait that's the wrong thing.. hold on." constantly. You're going to say "they aren't competent" but that's kind of the point - approximately nobody is competent in Vim because it isn't worth learning.

Even so, I'd be interested if there are any videos of pros doing real editing (not "look what I can do") on YouTube. Anyone know of any?

[-] FizzyOrange@programming.dev 19 points 6 months ago

Yeah this is one of the main reasons why Stackoverflow's question closing policies are bullshit. We're going to close the question so nobody can answer it... but they can still upvote it and it will still be ranked highly on Google!

Bunch of idiots.

You know the SO Devs actually tried to improve this a while ago - I think you would be able to reopen your question once or something. Of course the power-hungry mods hated that idea and the abandoned it.

At this point it's unfixable. They depend on their unpaid mods and they've already attracted the sort of people you absolutely don't want to moderate a site.

The only hack I've found is that if your question gets downvoted/closed you are allowed to delete it, wait half an hour and ask it again. Much better odds of success than editing the question.

view more: ‹ prev next ›

FizzyOrange

joined 1 year ago