2 ms·
This is the right mindset. Language and idioms are important to teaching and learning. I see people using python to teach/learn something like array iteration
by theelous3 6y ago
This is the right mindset. Language and idioms are important to teaching and learning.
I see people using python to teach/learn something like array iteration and do
for i in range(len(my_list)):
print(my_list[i])
What they have done, is conflated the implementation they think is computer sciencey from learning C, and the essence of list iteration.
Python is a great language for learning about iteration:
for item in my_list:
print(item)
Here it's much closer to the essence of the lesson.
C is good for teaching about array indexing in the loop and exposing how the loop variable is reused:
for ( int i = 0; i < myArraySize; i += 1 ) {
printf("%d\n", myArray[i]);
}
If you're trying to understand something in programming or through programming, there are right languages for the job, and it's a tricky affair.