4 ms·
"if (x=0 || -10<y<10)"... it just feels so right, but nope: smackdown. Your first lesson in how programming languages will conspire against you and your logical
by SavantIdiot 5y ago
"if (x=0 || -10<y<10)"... it just feels so right, but nope: smackdown. Your first lesson in how programming languages will conspire against you and your logical thought processes. I think this paper is a great attempt to shake off the curse of knowledge, and I'd gladly read another dozen things that show the language getting in the way of the process. Is there a name for this kind of higher level analysis of programming language?
- DeathArrow 5y agoI presume that if you are learning something, you follow an instructor, a textbook or some kind of tutorial. Before learning conditions you should already know that = means attribution, not testing for equality. I'd rather blame the quality of learning resources or student lack of attention here than the language design if someone mistakes = for equality operator.
- goto11 5y agoBad language design is not the fault of the student. After all, languages exist which doesn't have that problem.
- dunefox 5y ago> Before learning conditions you should already know that = means attribution, not testing for equality. Depends on the language. F# and CL, for example, would like a word.
- SavantIdiot 5y ago> I'd rather blame the quality of learning resources or student lack of attention here than the language design if someone mistakes = for equality operator. I see you don't have much experience with other programming languages, or you would have known that "=" is the equality operator in BASIC, Pascal, SQL and Excel... just to name a few of the most common occurrences where beginners -or- large-scale deployments would encounter this. That is the entire point of this paper, it uses C as an example, but the concepts are the same.
- ModernMech 5y agoMaybe if it were a single student, but this is a problem that has persisted across generations of students. I'm a fan of blaming tools for being poorly designed rather than the sad student who has to suffer using them. All their lives these students are told that "=" means that the left hand side and right hand side are equivalent. Then we give them a tool that throws the well-understood semantic meaning of the symbol out the window (for no good reason, mind you), and then you say we are to blame the student for being confused?
- iudqnolq 5y agoThe other symbol is also behaving in an unexpected way here. I can't think of any language that allows 10 < y < 20.