News for hackers. Stuff that matters.
Re:Ask HN: Why did you quit learning programming? by AnimalMuppet on Tuesday July 12, 2022 @05:52PM (#32076170)
Imperative functions are something people can't grasp? I... um... <boggle>

In math, we introduce functions all the time. I define f(x) to be whatever is handy for a particular problem, and then I work with f.

By any chance, do these people have much of a math background?

Re:Ask HN: Why did you quit learning programming? by dc-programmer on Tuesday July 12, 2022 @06:04PM (#32076275)
Nothing past calc I I’d reckon. I think one of the issues was how function calls can seem arbitrary at first (esp in python). You have imported functions, user defined functions, built in functions, etc. so when students see a function call, they aren’t confident in knowing where it came from, causing distress.

Most students really dislike anything that appears arbitrary which I think plays into this. One pre-med student I knew despised math after being taught 0!=1 because it seemed seemed completely made up to him and broke established rules.

Part of the onus falls on instructor to clear up areas like this (e.g. explain the cardinality of the set containing just the empty set is 1, 0!=1 allows for many formulas to be expressed tersely, etc). The other component of this is that the students who dislike ambiguity self select out of the program.

Re:Ask HN: Why did you quit learning programming? by JonChesterfield on Tuesday July 12, 2022 @06:27PM (#32076526)
What do you mean by 0!=1 here? It reads as the integers zero and one are not equal, which is true. I'm struggling to guess what established rules that could break.
Re:Ask HN: Why did you quit learning programming? by rafamaddd on Tuesday July 12, 2022 @07:15PM (#32077023)
> It reads as the integers zero and one are not equal, which is true

That's not what 0!=1 means in math, the ! means factorial, which is to multiply by decreasing positive integers. Here's the definition:

n! = n x (n -1) x (n - 2) x . . . x 2 x 1

So, for people starting to learn calculus/math, being told that 0!=1 makes no sense

Re:Ask HN: Why did you quit learning programming? by 3836293648 on Tuesday July 12, 2022 @08:44PM (#32077693)
And that's why we need spacing. 0 != 1 is very different from 0! = 1
Re:Ask HN: Why did you quit learning programming? by dc-programmer on Wednesday July 13, 2022 @12:27AM (#32079047)
Right I forgot my audience
Re:Ask HN: Why did you quit learning programming? by JonChesterfield on Tuesday July 19, 2022 @05:30PM (#32158246)
Ah. ! for factorial was not an obvious parse. I suspect it has alternative meanings in mathematics as well.