3 ms·
I had a professor in a beginning CS class who was a fortran/pascal programmer (and it showed mightily) but had one very good habit of re-enforcing good cognitiv
by noonespecial 18y ago
I had a professor in a beginning CS class who was a fortran/pascal programmer (and it showed mightily) but had one very good habit of re-enforcing good cognitive models with english language. Instead of saying a equals b for a = b, he would say a becomes the same as b or if it was a pointer operation a points to what b points to. I still use his method when reading code today.
- silentbicycle 18y agoI think that's a great convention. Using = for assignment introduces quite a bit of ambiguity, especially the common typo of "if (x = y)" when "x == y" was the intention. If I ever get around to making a real language (ahem), I will probably use either "<-" for infix assignment (left arrow) or "set" for pre/postfix; "=" will be a value comparison, and "is" will be a pointer comparison (i.e., symbol equality, capable of comparing non-terminating data structures, etc).