Re:Generative models and programming talent
by noonespecial on Tuesday July 22, 2008 @03:05PM
(#253539)
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.
[ Parent
| on HN ]
Re:Generative models and programming talent
by silentbicycle on Tuesday July 22, 2008 @06:50PM
(#253724)
I 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).