3 ms·
And how did that work? I'm just trying to imagine those first year students staring at those segmentation faults or trying to decipher some other non-intuitive
by YZF 13y ago
And how did that work? I'm just trying to imagine those first year students staring at those segmentation faults or trying to decipher some other non-intuitive C behaviour (promotion rules, = vs. ==, pointer arithmetics, various implicit rules). Talk about being thrown into the deep end of the pool to swim...
When a language like Pascal is taught as a first language students can focus on the mechanics of their algorithms rather than struggling with language oddities and machine architecture. I think that's important for new programmers to be able to focus on the flow and mechanics without worrying about other details. Once you get that you can "advance" to things that leak more of the underlying architecture into your program. There are probably many other languages that fit that bill.
EDIT (replying to jkrems): E.g. in C if(a=1) assigns 1 to a. I think some modern compilers at least warn on this but they didn't use to and it's perfectly legal. You can't do this in Pascal. You can still make a mistake but you'll get a compiler error. This is a very common mistake for beginners...
- jkrems 13y agoCan you elaborate what you mean by "= vs. =="? Since you mention Pascal I'm guessing that you'd say ":=" and "=" would be better, but since the general model of math is different from procedural code, I'm not sure that's an uncontested truth. I learned Pascal in high school and ":=" was confusing to more people than "==", even among first time programmers.
- deleted 13y ago[deleted]
- elclanrs 13y agoI find this paper [1] very interesting and elaborates on this issue -- "From experience it appears that there are three major semantic hurdles which trip up novice imperative programmers. In order they are: assignment and sequence, recursion/iteration and concurrency". [1] http://www.eis.mdx.ac.uk/research/PhDArea/saeed/paper1.pdf http://www.eis.mdx.ac.uk/research/PhDArea/saeed/paper1.pdf
- amagumori 13y agothat was exactly my experience as a first-year CS student. i had no prior programming experience and CS 101 started with implementing several programs in C. for help i was told "use valgrind" and that was about it. the CS tutors were constantly busy and the class was so big that i couldn't get one on one help, so i had to just spend hours on my own trying to decipher how to dynamically allocate memory without fucking myself. we ended up having a final involving implementing a trivial program in C in front of a TA. my program wouldn't work, yet after trying and trying i couldn't figure out what was wrong with it, so i resigned myself to failing the class and said "i'm done" with a program that didn't run. i had a single syntax error but the implementation was otherwise correct..the professor took pity on me and passed me. had i failed that class i would've said "fuck this" and left CS forever.