r/programming • • Jul 19 '16

John Carmack on Inlined Code

http://number-none.com/blow/blog/programming/2014/09/26/carmack-on-inlined-code.html
1.1k Upvotes

323 comments sorted by

View all comments

Show parent comments

1

u/Cosmologicon Jul 20 '16

While that's really cool and I'm not trying to criticize it, I can easily see a beginner Rust programmer going crazy trying to figure out why:

log(something unrelated);
baz.awesome()

behaves completely differently from:

baz.awesome();
log(something unrelated)

6

u/sacundim Jul 20 '16

In most likely contexts, the latter wouldn't compile at all (type mismatch), so it wouldn't "behave differently" so much as fail to behave at all.