Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I agree :p

I don’t think it’s that big of a deal, though people do sometimes still misunderstand. Every language has warts. This isn’t a huge one.



I like the use of "unsafe" for something that you don't want to reach for first. Those who are new get a very clear warning and those who aren't have had the opportunity to understand the nuances.

React uses the term "danger" to express a similar concept. You are trusting this value to already have been sanitized / escaped.

https://reactjs.org/docs/dom-elements.html#dangerouslysetinn...

¯\_(ツ)_/¯ I don't actually feel that strongly about a keyword that is used sparingly.

Aside: Thanks for everything you do for Rust and the community!


I think "unsafe" was a good name. Rails ERB templates use the `html_safe` name for something that the author knows to be HTML-safe, which is confusingly-named, implying that using `html_safe` makes something HTML-safe.


You’re welcome!


I thought you might agree ... ;)

E.g. there is this (not yet released) language JAI especially built for game programming and if i remember correctly the author ruled out Rust because he claimed that game developers sometimes (often?) have to fiddle with memory to implement certain abstractions and that Rust makes that somehow inconvenient.

Maybe that was not his main point and he still might have ruled it out if 'unsafe' was called different, but I think the name itself carries a misleading naming. I mean who does want to do something that is unsafe?


Sort of. His point is that memory bugs just aren’t a big deal: they crash immediately, you fix them quickly, and life moves on. YMMV.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: