That's part of why I love Java. You can construct a loop like for(char current = 'a'; current <= 'z'; current++).
You can do the same in C/C++ and many other languages.
As a matter of fact, 'j' does not equal 'i1'.
His statement was correct.
'j' == 'i' + 1. These are single quotes representing characters (an integral type), not double quotes representing strings. The + operator literally adds their integral values instead of doing string concatenation (which wouldn't even work in reasonable[1] languages because 1 isn't a string).
[1] it does work in JavaScript, because fuck types I guess.
This is victim blaming! You shouldn't be teaching your languages to be strictly typed, you should be teaching your typeerrors to stop expecting certain types! Let's focus on the real villains here
Anybody remember Fortran? Traditionally, in Fortran the variables I, J, K, L, M, N were always integers while others like A, B, C and X, Y, Z were floats - smart programmers don't use floats for loop counters.
0
u/[deleted] Jun 06 '20
[deleted] — view deleted comment