Has anyone heard of Rust? What are your thoughts on this new programming language?
Ain’t sure but it isn’t new, yes ? Go is more recent AFAIK.
Anyway, never tried to use it, but based on the small, unrepresentative amount of line i’ve seen, seems kinda messy. Just my 2 cents though.
Oh I see.
their for loops are completely fucking retarded.
C-like syntax for loop:
for (int i = 10; i < 0; i -= 2)
{
// Does something
}
How the hell do you do something like that for Rust when it is more like
for 0..10
{
// Does something
}
??
The documentation seems quite good:
https://doc.rust-lang.org/1.1.0/book/for-loops.html
Anyway I prefer the Rust version although C’s syntax is just like Plan9’s rc shell:
; for(i in one two three) echo $i
one
two
three
;
I like that because it’s quicker to type than the Bourne-style shell loops
THat looks confusing to be honest lol.
I guess it’s just like any other programming language, once you get used to it… ¯\(ツ)/¯
I remember when I started programming in Perl, I couldn’t get use to the 3 types variables only, with dedicated pointer on each. It just took me some time to make it become natural, now I don’t feel like it’s hard anymore.
Oh I see mate.
One way to do it is like this:
for element in (0..=10).rev().step_by(2) {
// Do something
}
I’ll admit that it does look weird, with ..=
(which denotes an inclusive range) and having to reverse the range and all that.
THanks for that