...

moefh

760

Karma

2011-06-08

Created

Recent Activity

  • > Special Relativity (non-accelerating frames of reference, i.e. moving at a constant speed)

    Sorry, but this is a pet peeve of mine: special relativity works perfectly well in accelerating frames of reference, as long as the spacetime remains flat (a Minkowski space[1]), for example when any curvature caused by gravity is small enough that you can ignore it.

    [1] https://en.wikipedia.org/wiki/Minkowski_space

  • That's not great context: China and India have huge populations, it's expected that they should be at the top.

    Better context can be found here[1] (countries by emission per capita). It's still not great because it shows a lot of small countries at the top. For example: Palau is the first, but it has a population of a few thousand people, so their emissions are a rounding error when compared to other countries.

    [1] https://en.wikipedia.org/wiki/List_of_countries_by_carbon_di...

  • > In C, sloppy programmers will [...]

    > In Rust, sloppy programmers will [...]

    You're comparing apples to oranges.

    Inexperienced people who don't know better will make safe, bloated code in Rust.

    Experienced people who simply ignore C warnings because they're "confident they know better" (as the other poster said) will write unsafe Rust code regardless of all the care in the world put in choosing sensible defaults or adding a borrow checker to the language. They will use `unsafe` and call it a day -- I've seen it happen more than once.

    To fix this you have to change the process being used to write software -- you need to make sure people can't simply (for example) ignore C warnings or use Rust's `unsafe` at will.

  • It seems like you're trying to fix a social problem (programmers don't care about doing a good job) with a technical solution (change the programming languages). This simply doesn't work.

    People who write C code ignoring warnings are the same people who in Rust will resort to writing unsafe with raw pointers as soon as they hit the first borrow check error. If you can't force them to care about C warnings, how are you going to force them to care about Rust safety?

    I've seen this happen; it's not seen at large because the vast majority of people writing Rust code in public do it because they want to, not because they're forced.

  • > Another respect is that C allows omitting curly braces after an if-statement, which makes bugs like https://www.codecentric.de/en/knowledge-hub/blog/curly-brace... possible.

    This is a silly thing to point to, and the very article you linked to argues that the lack of curly braces is not the actual problem in that situation.

    In any case, both gcc and clang will give a warning about code like that[1] with just "-Wall" (gcc since 2016 and clang since 2020). Complaining about this in 2025 smells of cargo cult programming, much like people who still use Yoda conditions[2] in C and C++.

    C does have problems that make it hard to write safe code with it, but this is not one of them.

    [1] https://godbolt.org/z/W74TsoGhr

    [2] https://en.wikipedia.org/wiki/Yoda_conditions

HackerNews