swcarpentry / python-novice-inflammation

Programming with Python
http://swcarpentry.github.io/python-novice-inflammation/
Other
300 stars 780 forks source link

alternative to using fahrenheit and celcius for teaching functions? #1000

Open raynamharris opened 2 years ago

raynamharris commented 2 years ago

I've seen this lesson taught numerous times, and I always have a few issues with the section on creating functions.

  1. fahrenheit and celcius are hard to pronouce and hard to spell, especially if english is a second language
  2. the math is unfamiliar and easy to mis type ((temp - 32) * (5/9))
  3. who can remember that K = 273.15?

I feel like the points listed above add to the cognitive load unnecessarily.

Could we replace this motivating example with something used in previous episodes, such as the weight (lb and kg) or something related to the inflammation dataset?

PaulHancock commented 2 years ago

I agree with the spelling here, even as a native English speaker Fahrenheit is an awkward word to type/spell (even more so in countries that use SI untis).

For parts 2/3, I believe that part of the point of creating these functions is that you don't have to remember the math/numbers, just look it up once, write the function, and then forget about it. However, I do really agree with your point on cognitive load and relating this work to previous parts of the lesson. Having the functions that we create at this point in the lesson refer back to things that were being done earlier in the lesson is a great way to reinforce prior learning.

For the most part the theme of temperature conversion could be replaced with mass conversion as suggested. The temperature conversion relies on three temperature scales in order to demonstrate function composition. I would suggest that a third measure of mass be used so that we can still incorporate function composition - the stone (st) would be useful here.

The changes required would be mostly along the following lines:

Currently Suggested
Fahrenheit st
Celsius lb
Kelvin kg
Compose F->C->K Compose st->lb->kg
PaulHancock commented 2 years ago

The previous submission is for instructor checkout.

bittremieux commented 2 years ago

I don't think that that would be a very good change. Barely any people have heard of stone as measurement, and pound is also unfamiliar to the majority of people around the world. Whereas those measurements of temperature should at least sound vaguely familiar from high school physics/chemistry classes.

chillenzer commented 2 years ago

Adding some personal experience here:

In conclusion, to me personally there was no significant cognitive load there. But I agree that the details of the problem probably feel much more natural to some people (Americans, physicists, ...) than to others. Currencies could be quite inclusive or at least approachable in that respect but would not refer to previous lecture material (and the exchange rates fluctuate all the time). From the simplicity perspective, one could use simpler weight relations, e.g. kilograms, grams, and tons. Or maybe switch gears and just do something that isn't related to units (which from my personal experience everybody hated in school). =)

senderrr commented 1 year ago

One of the the benefits of doing a temperature conversion exercise is that it is generally useful practice in day to day activities. Software Carpentry and academia has a lot of connection between countries (countries that use different standards), so an exercise covering this topic has real value to our attendees because this exercise could be applied in their own research, which will keep them engaged in our demonstration. There is a true negative in that these words can be difficult to spell, leading to coding mistakes. However, if we are cognizant of that fact, while teaching then it can be something we think about if people are receiving errors in our demonstrations. Hence, I would be hesitant to change this exercise because the flaws can be mitigated and it can be readably useful to our audience.

edbennett commented 1 year ago

I'd be happier with the temperature example if the conversion were reversed. The current layout has an implicit assumption that the learner should know that the melting and boiling points of water are 32°K and 212°K, which I suspect nobody outside of North America does.

I think 0°C and 100°C are much more well-known internationally, and suspect they may even be known relatively well in North America.

(The composition of functions could then be done from kelvins to Fahrenheit.)