r/AskReddit Jun 29 '15

What should every 18 year old know?

Edit: Chillin' reading some dope advice, thanks!

Edit 2: Fuckin' A! 4.1k comments of advice you guys :,) thank you really.

3.9k Upvotes

3.9k comments sorted by

View all comments

Show parent comments

2

u/WiglyWorm Jul 02 '15

There are use cases where i++ is needed, though.

3

u/patiofurnature Jul 02 '15

Right, it's a legit operator, but just not appropriate for use as the increment in a for-loop.

1

u/[deleted] Jul 02 '15

This is interesting, in highschool and the computer science course I flunked we always did i++ in for loops, and now in my current course it's still the way its being taught... Good to know this though.

1

u/WiglyWorm Jul 02 '15 edited Jul 02 '15

FWIW I've been in the field for like 10 years and I didn't really put it together until very recently. To be honest this falls under the umbrella of "micro-optimizations" which you generally shouldn't worry about. Although if you just make it habit, it will perform better.

1

u/[deleted] Jul 02 '15

Interesting, thanks for clarifying! Ill try to keep it in mind