[–] 16 points 8 months ago

It's incredibly disingenuous to call this average Rust code and further erodes your credibility. I may as well point to hundreds of lines of preprocessor macros in a C++ header and call it average C++ code.

This is not what an average Rust developer is writing 99% of the time. If someone on my team submitted a PR with an implementation of sum that uses macro_rules! I would almost certainly reject it.

  • source
  • parent
  • context
  • [–] 17 points 8 months ago (12 children)

    Types are not implicit, they're inferred by the compiler when there is no ambiguity about what the type needs to be. This is a huge benefit for refactoring code and reducing maintenance. I acknowledge that sometimes you might care to know the exact type of the variable, and sometimes that's not as easy for a human to infer as it is for the compiler, but every decent IDE will provide inline type hints for you. Interpreting code by reading it in plaintext is an exercise in masochism.

    Python is actually the opposite on this, and it's one of Python's worst characteristics. The type is unknown until runtime unless you annotate it, and then the annotation isn't really enforced. It's the worst of every dimension.

    C++11 introduced auto, and now the community is split between "almost always auto" and "never auto".

    JavaScript needed a whole new compiled language (Typescript) to fix its type system problems, and Typescript is only an incremental improvement at best.

    Rust has the best type system of any modern language by far. If you're tripped up by not always seeing the type declarations then you're either focusing on the wrong details in the code or you just need a little more practice. The key thing that needs to sink in for new Rust users is that the compiler is always providing safety rails. That means it's no longer your job to verify that every aspect of the code is correct. You can relax a little and actually have something akin to duck typing without all the pitfalls that usually come with it.

  • source
  • parent
  • context
  • [–] 11 points 8 months ago

    It's hilarious to me that people talk about "ugly" as if their opinions are objective.

    I found Rust unpleasant to look at for the first two weeks of learning it, and now that I've been using it professionally for three years I loathe when I need to read code in other languages.

    No other language can rival Rust in showing the exact information needed to understand the code


    never too much and never too little


    while being concise, correct, and handling all edge cases.

    You can be more concise in other languages, but it will come the loss of handling every little possible bug. You can be prettier in other languages, but it will come at the price of adding a lot of useless boilerplate.

    Of course there are cases where Rust can be verbose or confusing, but that's when you're doing very esoteric things that would be just as confusing in other languages.

    Like any opinion on aesthetics, how someone feels about the prettiness of a language will have far more to do with familiarity than with any objective metrics.

  • source
  • parent
  • context
  • [–] 96 points 10 months ago (2 children)

    They want to place all the blame for the problems in America on the shoulders of this one hapless clown because it spares them from reckoning with the deep systemic problems that led to us having this syphilis petri dish in the highest seat of power of the nation with the most powerful military in human history.

  • source
  • parent
  • context
  • [–] 7 points 11 months ago

    I assume you're referring to the technicality that the thirteenth amendment allows unpaid labor to be legally compelled out of prisoners, and that's a valid thing to be outraged about, but your statement is wildly misleading to anyone who isn't already aware of that technicality.

    The existence of the loophole is terrible and should be amended, but it's nowhere near the humanitarian crisis that widespread chattel slavery was. Ironically that will probably make it that much harder to be fixed since it's more difficult to draw pubic outage towards it.

  • source
  • parent
  • context
  • [–] 4 points 11 months ago (2 children)

    Your description actually illustrates how terribly inaccurate the metaphor was. If enslaved people imitated the people who enslaved them, they'd be sitting in a rocking chair on a porch sipping lemonade.

    The US has a unique and relatively recent relationship with chattel slavery so people are more sensitive to it now.

    The earliest record of the master/slave terminology being used in engineering is 1904 by which point slavery was already outlawed in almost every country, including the US. You're right to say that chattel slavery in the US was a uniquely grotesque form of slavery, but there is no system of slavery in history where slaves are primarily imitating their masters. No matter what anyone's sensitivity to the topic is, it's a bad fit for what's being described.

  • source
  • parent
  • context
  • view more: ‹ prev next ›