4 ms·
I shifted it to C because I am intimately familiar with C's drawbacks. I don't have the same understanding of Python's drawbacks. And it's always about explain
by Espressosaurus 2y ago
I shifted it to C because I am intimately familiar with C's drawbacks. I don't have the same understanding of Python's drawbacks.
And it's always about explaining to the target person's level of understanding. A layman isn't going to know the difference between languages and why pick one vs. another. That's a long digression. Explaining why to use Rust to a Python expert is a very different discussion.
An expert can switch between explanations as required for the audience. Non-experts, in my experience, cannot tailor the explanation for the audience. They typically bottom out at a level that leaves them unable to meet the questioner in the middle.
Hell, I've been the non-expert, especially when it comes to something like why a particular material was acting like a diode instead of not passing the signal or passing the signal intact. I can regurgitate that the half-rectified signal from the aggressor is bleeding into the signal of interest, but I can't tell you why. That's when I'll tell you to talk to the EE team for specifics on why, as well as what they plan to do to fix it.
- mjburgess 2y agoThe purpose of my choosing python is that the comparison is essentially a category error. Python's semantics, and that of all GC'd interpreted languages, make memory safety irrelevant.. there is no manual allocation of memory in the language. I chose this example as I assumed it would be clear and non-controversial enough to make my point, ie., I assumed most HN readers would appreciate that a person claiming Rust's memory safety model made it safter than an interpreted language would be a person clearly deeply confused about the meaning of any of these terms.
- kenjackson 2y agoThere are still unsafe constructs possible in GC’ed languages. I think we’re conflating GC with memory safety.
- mjburgess 2y agoWell some GC'd languages can take pointers to memory (eg., C#) -- even actually CPython can since it has the cffi/etc. stuff to do so. In general though, GC means automatic memory management which is effectively a kind of dynamic memory safety.
- advael 2y agoThis is a great example of a common problem, which I've taken to calling "intent-solution conflation". Garbage collection is intended as a way to improve memory safety in a programming language. It doesn't fully accomplish this, and that's an important distinction This is often more apparent (though a rampant problem nonetheless!) in policy decisions. Like how KOSA is supposed to "protect kids online" but what it mostly does as written is train people to get their identities stolen while making websites even more cumbersome than they already are. If I think it's a dumb bill, someone might say "What, you don't want kids to be safe?", as that's actually a lot of the point of calling it that
- kstenerud 2y agoGoing on your original example "I heard rust was better than python because its safe", this would be a case where you ask: "What did the person who told you this say was safer in rust than in python?" If they don't know anything specific, then it's pretty safe to say "Well, there are some differences in the languages, and you might choose one over the other for performance or ecosystem reasons, but they're both pretty safe overall. You probably don't need to worry too much about it, TBH."
- wruza 2y agoYou and the commenter above are confusing expertise with ability to determine and speak someone’s language. It’s just a distinct skill. You may not understand their level, and may be unable to negotiate it due to vocabular barrier (people invent non-standard vocab all the time). Your oversimplifications may bear unintended consequences, etc. You must take that into account and create a plan to make it clear. And when you have that skill without any expertise, they call you politician. Only a politician may answer “easy” on a hard question and tell something unrelated for few paragraphs cause he doesn’t know anything on the original one.
- johnny22 2y ago> You may not understand their level, and may be unable to negotiate it due to vocabular barrier (people invent non-standard vocab all the time). Your oversimplifications may bear unintended consequences, etc. You must take that into account and create a plan to make it clear. This isn't actually bad in all cases though. It's like learning about science in primary school. You're gonna get some things simplified in a way that might be considered incorrect by those who are experts, but without some base layer of understanding to bootstrap from, you won't be able to become an expert.