r/ProgrammerHumor • • 13d ago

Meme cppythRusGoSharp

Post image
309 Upvotes

36 comments sorted by

View all comments

15

u/Wojtek1250XD 13d ago

NGL out of everything here the most cursed to me is the fact that there are no parenthesis after range, and the argument it recieves... is a range.

3

u/redlaWw 12d ago

It used to be that you could just do for int i = 1..5, but old ranges were inefficient and confusing due to the fact that they were iterators themselves, rather than having a separate iterator type. In order to resolve this, a new range type was introduced, and a traditional range can be converted into a new range using the newly-introduced range keyword. Using old ranges for anything except constructing a new range has been deprecated, but they remain in the language for backwards-compatibility reasons.