Wanted: Advice from CS teachers
-
@raganwald
The best, most succinct, explanation of the difference here came from @pluralistic:
Coding makes things run well, software engineering makes things fail well.
All meaningful software fails over time as it interacts with the real world and the real world changes., so handling failure cases well is important.
Handling these cases involves expanding one's context window to take into account a lot of different factors.
For LLMs, a linear increase in the context window results in a quadratic increase in processing. And the unit economics of LLMs sucks already without squaring the costs.
Which is why AI, in its current incarnation, is fundamentally not capable of creating good software.(I've heavily paraphrased, so apologies if he reads this).
-
Example of the problem:
Me: "OK everyone. Next we'll make this into a function so we can simply call it each time-"
Student 1: "It won't work." (student who wouldn't interrupt like this normally)
Student 2: "Mine's broken too!"
Student 3: "It says error. I have the EXACT same thing as you but it's not working."
This makes me feel overloaded and grouchy. Too many questions at once. What I want them to do is wait until the explanation is done and ask when I'm walking around. #CSEdu
@futurebird Wait until you teach them the "let it crash" philosophy of software engineering.
-
Example of the problem:
Me: "OK everyone. Next we'll make this into a function so we can simply call it each time-"
Student 1: "It won't work." (student who wouldn't interrupt like this normally)
Student 2: "Mine's broken too!"
Student 3: "It says error. I have the EXACT same thing as you but it's not working."
This makes me feel overloaded and grouchy. Too many questions at once. What I want them to do is wait until the explanation is done and ask when I'm walking around. #CSEdu
@futurebird one recommendation - one rule that worked when I was learning programming and my teacher didn't like when I interrupted her - if you've got an issue because you're ahead or behind others, wait till the teacher is available. Till then, muck around, debug, try random things.
-
So Your Code Won't Run
1. There *is* an error in your code. It's probably just a typo. You can find it by looking for it in a calm, systematic way.
2. The error will make sense. It's not random. The computer does not "just hate you"
3. Read the error message. The error message *tries* to help you, but it's just a computer so YOUR HUMAN INTELLIGENCE may be needed to find the real source of error.
4. Every programmer makes errors. Great programmers can find and fix them.
1/
@futurebird
> 2. The error will make sense. It's not random. The computer does not "just hate you"
learning to have a constant faith in this has gotten me through so much shit that might otherwise have caused me to physically break something and give up forever
psychologically it's like "if you keep the spear pointed at the horse you will be safer than if you broke rank and ran" - you know logically that is what it is but every second of it is screaming at you to ignore that understanding and in the end what you train for will win out -
Yeah...
what I'm trying to convey is that there is a *reason* why the code isn't working and it will make sense in the context of the rules the got dang computer is trying to follow.
It might be annoying or silly, but it will "make sense"
@futurebird @mansr constantly grumbling the whole time you're fixing the problem about the idiots who design $THING like that can be a helpful coping mechanism for some -
@futurebird @mansr constantly grumbling the whole time you're fixing the problem about the idiots who design $THING like that can be a helpful coping mechanism for some@futurebird @mansr ...this just goes back to my whole thing about if maybe younger people have more learned helplessness about everything because more of their lives is dictated by arbitrary rules imposed on them by [EDIT: the invisible, untouchable people in some office somewhere who dictate] their cultural environment rather than the non-arbitrary rules of the physical world
no matter how dumb the rules of a sportball game get, the ball *must* move in certain ways in response to certain actions
that's not the case in a video game -
@raganwald @futurebird @EricLawton @david_chisnall I suppose there's something to be said for figuring out which parts of the received wisdom (built up by years of collective experience) are still valid....but there are better ways to do that than throwing it all out! (And I doubt that's their motivation anyway.)
-
@futurebird assigning code broken in specific ways & having a rubric for teaching the troubleshooting sounds like it should be SOP for coding courses, is this not normally part of the curriculum?
(def not dumping on you, asking as an Old who is a self-taught potato coder who never did a CS degree & feels like the way I learned basically anything that I do know was: type it in from a magazine or other source / modify working code that’s similar to what I need -> make mistakes in transcription / tweaks -> code doesn’t run or runs with errors -> troubleshoot the mistakes -> learn stuff
)@itgrrl @futurebird i never saw that in high school in the 90s... -
At the university we had this maybe once.
But then, to quote a professor: "You are learning 'computer science' here. 'Programming' is something that you should either already know or learn in your free time."
@wakame @voltagex @itgrrl @futurebird [vague memory of a passage in solzhenitsyn about "engineers" and people who've never had to lay a brick] -
@futurebird
I know this from people I taught programming.And I think the main problem is that the computer is judging you. In a way.
This can come in two forms:
a) The program fails to run, shows you an error, etc.
b) The IDE adds an error or warning to a line saying: This is wrong.So there is "objective proof" right there on the screen that you "are a failure". This is not some other person saying it, this is a piece of technology.
This is also something I hate from a usability/user experience perspective.
The computer doesn't say: "Sorry, I don't understand what you mean with that line."
It says: "This line can not be processed because the user is dumb."(Not quite, overemphasizing.)
When taking about critique or blame, there is this typical antipattern: "Everybody uses a fork."
No, they don't. I use a fork, I want you to use a fork, but instead of saying that, I invoke a mystical "everybody".
@wakame @futurebird my immediate instinct is to object that these error messages are about the input, not the person sending the input, but making it not personal / not making it personal is also one of those important skills that everyone used to assume everyone had and no one taught and now no one has -
@futurebird
I totally cried when I was 14 and I tought in my naivety that I knew almost everything and then a simple program failed.
[Edit: And seriously: I think it is hard to understand if the voice from god tells your that there is an error line 32, that this could be somehow wrong.
I mean, this is a computer, right? It doesn't make mistakes.
Maybe emphasizing that the IDE and the compiler and everything else was written by humans and that they discover bugs in those programs all the time could help.]
@wakame @futurebird
> the voice from god
i rarely had this problem and i also could never understand what people at church and elsewhere were talking about when they talked about feeling the presence of god or whatever
i just thought of it as pure cause and effect, like
you're rolling a toy car down a track
the track has a snag in it you can't see
the toy gets derailed and hits the floor
you don't look at the floor for the snag -
@wakame @futurebird
> the voice from god
i rarely had this problem and i also could never understand what people at church and elsewhere were talking about when they talked about feeling the presence of god or whatever
i just thought of it as pure cause and effect, like
you're rolling a toy car down a track
the track has a snag in it you can't see
the toy gets derailed and hits the floor
you don't look at the floor for the snag@wakame @futurebird (not that i don't make the mistake of checking everything from lines 8 through 64 after an error on line 32 without looking up to line 4, but that's more just lazily assuming that past me must've gotten "the basic stuff" right and any error must've been further down) -
@raganwald
The best, most succinct, explanation of the difference here came from @pluralistic:
Coding makes things run well, software engineering makes things fail well.
All meaningful software fails over time as it interacts with the real world and the real world changes., so handling failure cases well is important.
Handling these cases involves expanding one's context window to take into account a lot of different factors.
For LLMs, a linear increase in the context window results in a quadratic increase in processing. And the unit economics of LLMs sucks already without squaring the costs.
Which is why AI, in its current incarnation, is fundamentally not capable of creating good software.(I've heavily paraphrased, so apologies if he reads this).
@flipper @raganwald @pluralistic @futurebird @EricLawton @david_chisnall I really hope it's a) true and b) stays like that
-
@wakame @futurebird my immediate instinct is to object that these error messages are about the input, not the person sending the input, but making it not personal / not making it personal is also one of those important skills that everyone used to assume everyone had and no one taught and now no one has@wakame @futurebird so far this thread it seems to teach someone how to program a computer they must first learn
- conflict management and de-escalation skills
- theory of mind
- rationalist epistemiology
- emotional self-discipline
- scientific method (controlled testing)
- the art of doing things one thing at a time (and figuring out what "one" "thing" is when it might not be self-evident)
... -
@wakame @futurebird so far this thread it seems to teach someone how to program a computer they must first learn
- conflict management and de-escalation skills
- theory of mind
- rationalist epistemiology
- emotional self-discipline
- scientific method (controlled testing)
- the art of doing things one thing at a time (and figuring out what "one" "thing" is when it might not be self-evident)
...@futurebird @wakame conclusion: programming is a martial art -
"I have the exact same thing as you but it's not working"
99 times out of 100 no, no you do not have the "exact same thing" you've made a typo.
Because the whole point of it being a computer is that if you have the exact same code it always does the exact same things.
@futurebird @freequaybuoy though sometimes the problem is that a language requires spaces rather than tabs, or prohibits a mix of them... or the student was trained for decades on languages where whitespace didn't matter... -
@wakame @futurebird (not that i don't make the mistake of checking everything from lines 8 through 64 after an error on line 32 without looking up to line 4, but that's more just lazily assuming that past me must've gotten "the basic stuff" right and any error must've been further down)
I intended to capture that doing computer stuff doesn't happen in a social vacuum.
But this is an interesting topic. I think it might also be a question of personality.
If a world-renowned professor for mathematics comes into a classroom, points at kid and says: "What you are writing there is wrong.", I can imagine three types of reactions:
a) The kid might see this as "neutral" input, looking for a mistake in what it just wrote.
b) They might see it as a personal attack or even invalidation and might consider themselves a failure.
c) They might question that figure of prestige and authority.I am more of a "category c)", but I would assume that most people are "category b)".
-
I intended to capture that doing computer stuff doesn't happen in a social vacuum.
But this is an interesting topic. I think it might also be a question of personality.
If a world-renowned professor for mathematics comes into a classroom, points at kid and says: "What you are writing there is wrong.", I can imagine three types of reactions:
a) The kid might see this as "neutral" input, looking for a mistake in what it just wrote.
b) They might see it as a personal attack or even invalidation and might consider themselves a failure.
c) They might question that figure of prestige and authority.I am more of a "category c)", but I would assume that most people are "category b)".
@wakame @futurebird (b) in response to my grade 10 science teacher's response to a fundamental misunderstanding of how salt solutions work is why i have a BA and work in a notoriously innumerate-liberal-arts-major-infested profession today... -
My students aren't lazy, but they *can* be a little perfectionist: scared to take risks or sit with not having the answer right away.
They are really upset when their code won't run... but staying calm and *systematically* looking for the cause of the problem, knowing that if you just work through the tree of possible causes you will find it is not something they are good at.
I think I need to teach this.
Maybe I will give them some broken code and we will find the errors together.
@futurebird yes, do that. i'm not a coder, nor a CS teacher, but teaching debugging is crucial to learning how to program. it's necessary to understand why anything works at all, instead of just copying code and not understanding why it doesn't work.
-
@cubeofcheese @futurebird all of the above, but particularly #4. Model the behaviour you want. Cold call what the error that you just made is. Let it become a thing to audit your code.
Another thing that works is pair programming. Building that culture and trust can take a little while, but both parties learn a lot.
@MrBerard mihjt have ideas?
@grant_h @futurebird @MrBerard I haven't tried pair programming because I don't know how to create accountability for both parties