4 ms·
That's a good point, and one reason I enjoyed BASIC and its dialects so much. Which is easier to explain to a new programmer: For i = 1 to 10 Or For (i = 1;
by mysterydip 9y ago
That's a good point, and one reason I enjoyed BASIC and its dialects so much. Which is easier to explain to a new programmer:
For i = 1 to 10
Or
For (i = 1; i <= 10; i++)
Once you understand how things work, translating that knowledge to another language and adding on concepts is relatively easy.
- vidarh 9y agoI still to this day, after about 30 years of exposure to C, 22 years of professional development, and many years of using C professionally, avoid the for() look in C because I struggle to remember which position the comparison vs. increment goes. I prefer to use while() loops. But I still remember the BASIC syntax you demonstrate above, 30+ years after I last programmed BASIC.
- DiThi 9y ago> because I struggle to remember which position the comparison vs. increment goes Tip: they're in the same order they're used: comparison is always run at the beginning of each iteration, and increment is always done at the end. for(init; cond; last) ... init; while(cond) { ... ; last;} But I also dislike it and love "for ... in" constructs.
- vidarh 9y agoTried many ways of remembering it, gave up and decided a more reliable workaround. I don't know why I find it so hard to remember. Then again I've found an even more reliably workaround by not writing much C these days.
- captainmuon 9y agoThis is an interesting example, because back then when I learned BASIC (around age 7 on a Vtech Precomputer 1000 [1]), I couldn't understand why the for loop was called "for". Why am I doing this "for i"? How does "i" benefit from this? I didn't know the mathematical idiom "blabla for a value of i equals 10". I was also strangely afraid of the word INTEGER, which I read as INTER-EGER. "Integer" has no meaning to a kid, it's just called a number (as opposed to a dot-number or a fraction). On the other hand, I never had problems with the fact that is was using text. [1]: http://www.vintagecomputing.com/index.php/archives/324/324 http://www.vintagecomputing.com/index.php/archives/324/324
- jbverschoor 9y agoHaha. I read utilities as "ultilities".
- jgamman 9y agoi read all the Asterix comics pronouncing Julus Kazar ;-) Then repeated at post-grad chemistry when first asking a question out loud about Orger Electrons (Auger - more like Aubergine, prior to lectures introducing them) - prof was non-plussed... Reading and talking huh ;-)