Войти в систему

Home
    - Создать дневник
    - Написать в дневник
       - Подробный режим

LJ.Rossia.org
    - Новости сайта
    - Общие настройки
    - Sitemap
    - Оплата
    - ljr-fif

Редактировать...
    - Настройки
    - Список друзей
    - Дневник
    - Картинки
    - Пароль
    - Вид дневника

Сообщества

Настроить S2

Помощь
    - Забыли пароль?
    - FAQ
    - Тех. поддержка



Пишет Journal de Chaource ([info]lj_chaource)
@ 2017-10-26 03:12:00


Previous Entry  Add to memories!  Tell a Friend!  Next Entry
Functional programming is doomed. Long live functional programming
Imperative programming looks like this (Python):
i = 0
while i < 10:
   a[i] = cos(i)
   i = i + 1


Functional programming looks like this (Scala):
val a = (0 until 10).map { x => math.cos(x) }


To write programs in the imperative style, the programmer needs to think in terms of step-by-step actions and control flow commands ("first do this, then do that; if doing that succeeded then repeat from step 2"). The entire program needs to be formulated as a long list of action steps and control flow commands.

To write programs in the functional style, the programmer needs to think in terms of mathematical expressions. The entire program needs to be formulated as (conceptually) a single mathematical expression. This approach is superior to step-by-step actions in a large number of cases, especially if the data has a recursive structure and the processing logic is too complicated to be grasped at once without several layers of abstraction.

Most people will never be able to learn to think systematically in terms of mathematical expressions. Many more people are able to learn to think systematically in terms of step-by-step actions. For this reason, even though the majority of all people will never learn to be effective programmers, the effective functional programmers are always going to be a minority within all programmers. Knowing this, it is a highly risky proposition for a large software company to adopt a strictly FP development tool.

FP will remain a secret weapon of mathematically thinking people, their professional advantage over all others.


(Читать комментарии) (Добавить комментарий)