[rust-dev] "let mut" <-> "var"

Jason Fager jfager at gmail.com
Thu Jan 30 09:18:52 PST 2014

3 extra characters isn't doing anything to stop consenting adults.
 Nobody's saying get rid of mutable variables, just that it seems like a
waste of limited resources to figure out how to streamline them when in
general their use should be limited to where necessary.

Python isn't busy trying to figure out how to make 'look before you leap'
easier.  They have a culture of discouraging it and favoring 'forgiveness
over permission'.  Consenting adults can do all the looking they like, but that
doesn't mean Python is going to bend over backwards to make it pleasant for

On Thursday, January 30, 2014, Donaldo Fastoso <donquestion at rocketmail.com>

> I like python's rational of "consenting adults": Give people the tools
> to do the right thing, if they still want to hurt themselves, they may
> have a good reason, or they are better of dead! ;-)
> I would argue, that people choosing Rust over C/C++ are choosing it
> BECAUSE of safety measures like immutability and wouldn't need
> overbearing lectures.
> In all honesty it's not the TYPING of three additional chars "let mut",
> but the READING. It interrupts the flow of reading, or better: it's
> a bump in the flow of scanning. Source-Code is not prosa, you have to
> actively follow the train of thought and guess the intentions of the
> author. So improving READABILITY would really be nice, especially
> for people coming from other languages. They would probably try to
> learn by reading the source from experienced programmers.
> In this case i would also advice against the use of "var", instead
> of "let mut", but omitting "let" and leave it to "mut" would be much
> easier to read and understand.
> so
> "let mut x, y;"
> would become:
> "mut x;"
> "let y;"
> which would take a possible interpretation-ambiguity away from the
> single "let mut x, y", which can be read either as "let mut" for x
> and y, or "let mut x" and "let y"!
> So imho "let mut" has at least two pitfalls:
>         1) read-bump
>         2) ambiguity.
> AFAIK you did a remarkable good job so far, and i have all the faith
> you are considering all arguments before coming to a decision.
> Even if some thoughts of the thoughts come form the bad smelling
> "lurker"-fraction, which do nothing but making comments about things they
> possible can't understand! ;-)
> Regards,
> Don
> _______________________________________________
> Rust-dev mailing list
> Rust-dev at mozilla.org
> https://mail.mozilla.org/listinfo/rust-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/rust-dev/attachments/20140130/f00867be/attachment-0001.html>

More information about the Rust-dev mailing list