G
G
Griboks2021-10-29 19:51:19
IT education
Griboks, 2021-10-29 19:51:19

How to teach stupid students functional programming?

Greetings.
Just now they asked to teach stupid (zero level) students how to program. Well, I foolishly included functional programming in the plan, which for students looks like assembling a nuclear reactor at home.

Do you have any experience or advice on solving the problem? Or maybe it's easier to remove this section from the plan completely?

Answer the question

In order to leave comments, you need to log in

7 answer(s)
U
uvelichitel, 2021-10-30
@uvelichitel

I don't quite understand the problem. First class functions, lambda, closure are implemented and actively used in most modern mainstream languages. Many algorithms are much more convenient to express recursively, for example quicksort is classically expressed recursively. That is, individual FP techniques fit perfectly into the usual mental model, without undermining the brain)) It is not necessary to learn to code in Scheme or Haskell.

E
evgeniy_lm, 2021-10-29
@evgeniy_lm

Well, first you need to know what kind of students. If from a theater school, then they need programming in principle, but if from some kind of physics and mathematics, then those for whom the FP "looks like assembling a nuclear reactor" let them go to the theater school.
Threat I've been progamming for 40 years, but so far FP is a very incomprehensible thing for me. Once I tried to understand Haskell, but did not understand how to use it in real life and gave up.

F
Foggy Finder, 2021-10-29
@FoggyFinder

Take F# . The language is primarily functional and not purely functional. In order to teach the basics of a new approach, that's it. For 1-2 lessons, novice developers will still not be able to give more.
It will be easy to show with simple examples how you can achieve the same result with completely different approaches.
+ do not immediately demand correctly written code, let them learn gradually - step by step, abandoning the habit of using mutability wherever possible.

A
AVKor, 2021-10-30
@AVKor

First teach the stupid "teacher" how to teach.

I
Ivan Bogachev, 2021-10-30
@sfi0zy

Engineering students... how to teach FP in 1-2 lessons from scratch? What would you do?

Well, there will be no talk of a serious dive here, but it’s quite possible to give the very basics for two pairs. If engineers are good at math. They know how to decompose complex formulas with brackets into components and count. Even recursion is a familiar concept to them. If you take a conventionally good old common lisp with brackets and a simple interpreter, and start writing simple constructions with calculations for something, they will quickly pick up the idea of ​​how it works in general. And then it will be possible to show by analogy that this can be done not only with numbers, but also with other data, show some examples with strings. And at the end, you can show some simple ways to organize the code and tell something for the horizon (where did the FP come from, where is it used, that there are languages ​​without brackets, but with the same ideas inside, etc.). It is useless to upload about architecture and some patterns to people who are not familiar with programming, they have not yet seen a large amount of code to understand the meaning of the statements. But to work with some kind of applied calculations (engineers have tasks in physics for this), with some kind of abstract data analysis - it’s quite possible for a couple of pairs.

!
!, 2021-10-30
@raf_gal

I think here it is necessary to start with bare Lisp
and there to learn Zen , one
must completely abandon imperative thinking
, one must mentally visit the world of "marginal lambda" from a fairy tale about programming languages:
On the deep philosophy of programming (serious p...

M
Mikhail Potanin, 2022-03-03
@potan

I would try to give them a very simple language with a fast development cycle like Elm .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question