Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

C vs Rust

Name: Anonymous 2015-02-13 1:07

C:
int main(int argc, char **argv) {
int r;
if(argc > 1) {
r = atoi(argv[1]);
} else {
usage();
exit(EXIT_FAILURE);
}
}


Rust:
fn main() {
let argv: Vec<Result<String,OsString>> = std::env::args()
.map(|x| x.into_string())
.collect();

let r = match argv.get(1) {
Some(x) => match x.parse::<i32>() {
Ok(v) => v,
Err(_) => {
show_usage();
panic!()
},
},
None => {
show_usage();
panic!()
}
}
}


Type explosion is to be expected. Do notation could have been used to keep the control logic as clean as C, but Rust is not HASKAL and never will be anything like HASKAL and you're an asshole for wanting to write readable code you filthy shit fuck.

Name: Anonymous 2015-02-13 1:22

>>1
The rust program handles malformed integers while the c program does not.

Name: Anonymous 2015-02-13 1:45

who the fuck thought std::herpes:::::::::this or <Nigger,<DoubleNigger,Nigger<<<<<<<This>>>>>>>> was a good idea

Name: Anonymous 2015-02-13 1:52

>>2
And it could do that in a way as clean as the C version by using do notation.

Name: Anonymous 2015-02-13 2:23

Name: Anonymous 2015-02-13 3:26

>>2
Maybe the programmer shouldn't make the integers malformed? Programmer school, did you flunk?

Name: Anonymous 2015-02-13 3:32

HAHAAHHAHAAHHAHAHDAHASDHUAEGRYAHOINGRHUITRJOEAGHOIHUIOWHAWAHGUIHAAGHRAWEGRHU RUST RUST RUST THE NEW HIP LANGUAGE RUST, I CANT WAIT TIL THE COMPILE RIS MORE MATURE. IM SO EXCITED ABOUT LEARNING RUST. MAYBE TRY RUST? LOOLLOLLOLOLOLOASDFLOASKOASHOKAHFJIOAFOIJ.

Name: Anonymous 2015-02-13 7:02

>>3
Bjarne Stroustrup.

Name: Cudder !MhMRSATORI 2015-02-13 15:05

For even more WTF, look at the code the compiler generates.

Name: Anonymous 2015-02-13 15:38

>>9
We're programmers, not toilet code scrubbers.

Name: Anonymous 2015-02-13 17:22

>>10
A good programmer knows the entire spectrum from machine code to high level abstractions.

Name: Anonymous 2015-02-13 17:35

>>11
No, a good programmer never wastes time on low-level machine bullshit.

Name: Anonymous 2015-02-13 17:50

>>12
Go the fuck back to your gay Javashit apping brocrowd

Name: Anonymous 2015-02-13 18:18

Cudder is all talk and one fizzbuzz.

Name: Anonymous 2015-02-13 19:16

>>12
This is how we get cargo cults.

Name: Anonymous 2015-02-14 4:00

>>15
Low level programming is a cargo cult for most. Parroting conventional wisdom from decades past is easy; measurement is hard.

Name: Anonymous 2015-02-14 8:39

>>16
This is how we get cargo pants.

Name: Anonymous 2015-02-14 10:02

>>16
dumbass

Name: Anonymous 2015-02-14 10:20

>>13
Dumbass.

Name: Anonymous 2015-02-14 13:55

>>22
dubass

Name: Anonymous 2015-02-14 20:11

I'll never use an SJW language. Fuck Rust.

Name: Anonymous 2015-02-14 20:32

>>21
SJW language
lol check 'em

Name: Anonymous 2015-02-14 20:58

Soft Jewish Woman

Name: Anonymous 2015-02-14 21:27

Smoke Jazzy Weed

Name: Anonymous 2015-02-14 21:45

Sniff Jealous Wood

Name: Anonymous 2015-02-14 21:56

Sussman's Juvenile Wife

Name: Anonymous 2015-02-14 22:19

Shitposting Jizz Waltzers

Name: Anonymous 2015-02-14 23:25

Snide Jamaican Wildlife

Name: Anonymous 2015-02-14 23:30

Selfish Judgmental Wankers

Name: Anonymous 2015-02-15 3:34

Stop Judging Wankers

Name: Anonymous 2015-02-15 7:34

>>15
Low level programming is a cargo cult for most. Parroting conventional wisdom from decades past is easy; measurement is hard.

Name: Cudder !MhMRSATORI 2015-02-15 13:36

>>31
measurement is hard.
As hard as typing dir or ls -l?

Name: Anonymous 2015-02-15 14:11

exit(EXIT_FAILURE);
AYFKM

Name: Anonymous 2015-02-15 21:30

Cudder is all talk and one fizzbuzz.

Name: Anonymous 2015-02-16 0:15

>>32
As hard as choosing benchmarks that repeatably measure the impact of an optimization on the entire system in which it is used, and nothing more (such as the impact of the benchmarking method itself).

Name: Anonymous 2015-02-16 2:48

Is Rust the future?

Or will it simply corrode as a language ha ha ha

There are two possibilities:

1. Rust will become a true Systems Language, and will be able to surpass c / c++ in areas where they are truly necessary ( device drivers, embedded etc )

2 It will die, because there are better alternatives available if you want abstractions.

I personally hope the first case will become reality.

Name: Cudder !MhMRSATORI 2015-02-16 2:54

Rust has the potential to be the best language since FORTRAN 77.
Too bad it doesn't have GC, which is ESSENTIAL for us 21st Century Programmers.

Name: Anonymous 2015-02-16 3:02

D > Rust > JS > Go > Haskell > OCaml > C > Python > Ruby > Lua > Perl > Bash > HTML > Java > C++ > C# > .NET

Name: Anonymous 2015-02-16 3:14

>>36,37,38
go back to reddit/hackerniggers//g/

Name: rindolf the stdfish 2015-02-16 3:19

>>39
dont 4get ##programming on irc.freenode.net :)

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List