Ideal Learning - hauskin tapa oppia
Vaihda navigointi
  • Ajankohtaista
  • Blogi
  • Kurssit
  • Opettajasi
  • Facebook
  • Pieni ohjelmointikirja
  • Programming Book

Ajankohtaista

Functional programming matters to JS programmers, too

Kirjoittanut Juuso Vuorinen
Julkaistu: 12.01.2021

The ongoing 4 month training course on the fundamentals of software development is soon coming to an end. The bunch of 15 students have been working 24/7 to learn the basics of modern web development. As the teacher of the course I have put quite an effort to emphasize the importance of functional programming. Learning the basics of fp even with a language like JavaScript pays off. React library has proven an invaluable tool to demonstrate the usefulness of the paradigm.

React is a well-known JavaScript library for implementing user interface components for single page Web applications. Current functional incarnation of React, which first appeared in 2019 leverages the idea of functions as a key building block to construct software. The appearance of any component is based on the parameters of a function instead of relying on the properties of an object. The library was functional from day one, but its latest versions are even more so.

The very idea of React is a sequence of function calls to manipulate a tree-like data structure called the DOM tree (i.e., a Web page). Functions are being called one after another and the result is a new representation of the DOM tree finally reflected in the user interface. The user interface is a pure function and therefore it is also called the "referentially transparent UI" by the creators of React.

According to the creators of React "React essentially manages to abstract away the DOM, thus simplifying the programming model while also in a somewhat surprising turn improving performance." The resulting code has somewhat functional look and feel. Manipulating the DOM tree is hidden and classes are replaced by functions. The concepts introduced by the library not only highlight the power of pure functions but also guide the developer to keep one's concerns separate and solutions composable.

Whereas React is a tool for managing the DOM tree without visible side-effects, Underscore.js, Ramda and lodash are well established JavaScript libraries for manipulating data in functional style. Rather than building software with the help of objects and methods, Underscore.js favors the ideas of pipelining and composing. Lodash follows the suite with similar concepts.

The utilities have become less useful over the last few years. The argument draws on the fact that the concepts introduced by the libraries have been adopted in ECMAScript version 6. 

Ramda's is a useful tool for dealing with data, but also for learning functional programming. A glimpse on Ramda documentation reveals a real world attempt to provide a generic functional programming library instead of a functional programming toolkit. The following citation from Ramda documentation reveals the goal of being positioned as a generic FP JS library - "There are already several excellent libraries with a functional flavor. Typically, they are meant to be general-purpose toolkits, suitable for working in multiple paradigms. Ramda has a more focused goal. We wanted a library designed specifically for a functional programming style, one that makes it easy to create functional pipelines, one that never mutates user data". Ramda's functions are automatically curried, which is useful for learning to design partially applied and reusable functions.

Many software developers start their careers in Web development. The JavaScript code that runs in the context of a web browser with the help of a library such as React, provides a learning laboratory for students and prepares them for future multi-paradigm challenges. A functional programming library such as Ramda can add a great deal of functional look and feel to showcase algorithm design in a more declarative and functional way. Ramda is suitable for demonstrating side-effect free algorithm design with pure and curried functions.

JavaScript can be a good tool for learning and teaching the ideas of functional programming. Once the teaching of the language constructs is combined with teaching practices that are not only motivating, but also conceptually rewarding, we may be able to hit the sweet spot of designing learning solutions.

If JavaScript were taught along with libraries, such as React and Ramda, this might help the students to grasp the skills required by employers and make the learning curve for functional programming easier. The React library is moderately easy to learn and is suitable for teaching. Both libraries promote side-effect free style for writing software.

With this summary of how well React supports learning of functional programming our two men training team is gradually saying farewell to our students as they start their company internships in mid February 2021. We are grateful for all students for their hard work and persistent efforts during the theory period of the training course.

Also, we are happy to announce that some of the companies who have provided the internships for our students have shown interest in having their software development staff being introduced to functional programming.

Let's spread the "F" word and keep warm!

Selma the dog and the rest of the team

PS. It was fun to have a former student of the University of Nottingham on our training course. She recalled Graham Hutton's interest in functional programming and was certainly delighted to see that our training course included fp topics, too. 

 

Dogs need to keep war, too!

 

Kommentoi
  1. Opi React - ilmaiset oppimisvideot
  2. Kippistellään valmistuneille ja valmistaudutaan syksyn uuteen kurssiin
  3. useEffect-hookin käyttötilanteita ja yleisiä ratkaisuja sivuvaikutusten eristämiseen sovelluksessa
  4. Livekoodataan yhdessä koiramainen muistipeli Reactilla
  5. Koiramaisen ohjelmointikilpailun tulokset
  6. llmainen Koodiklinikka - Funktionaalinen React
  7. Chicken Jerky Flavoured Introduction to Functional Programming is out in English
  8. Ilmainen työpaja - funktionaalisen React-ohjelmoinnin jatkojen jatkot - useReducer hook ja Context API
  9. Ilmainen työpaja - funktionaalisen React-ohjelmoinnin jatkot - sivuvaikutusten käsittely effect-hookilla esimerkkinä HTTP-pyynnöt Axios-kirjastolla
  10. Ilmainen React-työpaja - rakennetaan nelilaskin funktionaalisin React-komponentein
  11. A free training event - Integrating minimax algorithm to a simple React-based tictactoe game (NP-complete -like problem)
  12. Ilmainen React-kurssi uusitaan
  13. Ilmainen React-kurssi käynnistyy
  14. Lähde mukaan opiskelemaan funktionaalista ohjelmointia - maksaa vain vaivan

Full stack -kehittäjä 2020 kurssin esittely

Suomenkielistä lukemista ja videoita ohjelmoinnin perusteista

Functional Dogs (in English)

Koiramaista juttua ohjelmoinnin opetuksesta Dimensio-lehdessä

 

Blog

  • 2021
    • Functional programming matters to JS programmers, too 12-01-2021

      Lue lisää: Functional...

  • 2020
    • Opi React - ilmaiset oppimisvideot 02-10-2020

      Lue lisää: Opi React -...

    • On teaching functional programming concepts with less functional languages 14-08-2020

      Lue lisää: On teaching...

    • Miten ohjelmistosuunnittelijan uran alkuun pääsee, miten töissä pysytään ja miten kehitytään eläkeelle asti ja vielä sen jälkeenkin? 25-07-2020

      Lue lisää: Miten...

    • Lisäinfoa mallisovelluksesta ja harjoittelupaikan hakemisesta 2020 full stack -koulutuksen hakijakandidaateille 24-07-2020

      Lue lisää: Lisäinfoa...

    • Näytä hampaasi ohjelmistokehittäjänä ja tule mukaan full stack -koulutukseen 23-07-2020

      Lue lisää: Näytä...

    • Kippistellään valmistuneille ja valmistaudutaan syksyn uuteen kurssiin 25-06-2020

      Lue lisää: Kippistellään...

    • Opiskeluvinkit ja lisätietoa syksyn 2020 full stack -koulutukseen hakevalle 25-06-2020

      Lue lisää: ...

    • useEffect-hookin käyttötilanteita ja yleisiä ratkaisuja sivuvaikutusten eristämiseen sovelluksessa 22-05-2020

      Lue lisää: ...

    • Livekoodataan yhdessä koiramainen muistipeli Reactilla 30-04-2020

      Lue lisää: Livekoodataan...

    • Koiramaisen ohjelmointikilpailun tulokset 24-04-2020

      Lue lisää: Koiramaisen...

    • llmainen Koodiklinikka - Funktionaalinen React 23-04-2020

      Lue lisää: llmainen...

    • Chicken Jerky Flavoured Introduction to Functional Programming 15-04-2020

      Lue lisää: Chicken...

    • Chicken Jerky Flavoured Introduction to Functional Programming is out in English 13-04-2020

      Lue lisää: Chicken Jerky...

    • Ilmainen työpaja - funktionaalisen React-ohjelmoinnin jatkojen jatkot - useReducer hook ja Context API 09-04-2020

      Lue lisää: Ilmainen...

    • Ilmainen työpaja - funktionaalisen React-ohjelmoinnin jatkot - sivuvaikutusten käsittely effect-hookilla esimerkkinä HTTP-pyynnöt Axios-kirjastolla 03-04-2020

      Lue lisää: Ilmainen...

    • Ilmainen React-työpaja - rakennetaan nelilaskin funktionaalisin React-komponentein 01-04-2020

      Lue lisää: Ilmainen...

    • A free training event - Integrating minimax algorithm to a simple React-based tictactoe game (NP-complete -like problem) 28-03-2020

      Lue lisää: A free...

    • Ilmainen React-kurssi uusitaan 26-03-2020

      Lue lisää: Ilmainen...

    • Ilmainen React-kurssi käynnistyy 23-03-2020

      Lue lisää: Ilmainen...

    • Lähde mukaan opiskelemaan funktionaalista ohjelmointia - maksaa vain vaivan 16-03-2020

      Lue lisää: Lähde mukaan...

    • Osallistu koiramaiseen ohjelmointikisaan ja voita ohjelmointikirja! 13-03-2020

      Lue lisää: Osallistu...

    • Pieni ohjelmointikirja 17-02-2020

      Lue lisää: Pieni...

    • Miksi kannattaa opetella rakenteinen kyselykieli? 05-01-2020

      Lue lisää: Miksi...

  • 2019
    • Hauskaa joulua ja kanaherkun tuoksuisia lukuhetkiä! 21-12-2019

      Lue lisää: Hauskaa...

    • Apua funktionaalisen ohjelmoinnin opiskeluun 07-11-2019

      Lue lisää: Apua...

    • Lisäinfoa mallisovelluksesta ja harjoittelupaikan hakemisesta 2019 full stack -koulutuksen hakijakandidaateille 02-09-2019

      Lue lisää: Lisäinfoa...

    • Selma-koiran ohjelmointipähkinät nyt youtubessa! 28-08-2019

      Lue lisää: Selma-koiran...

    • Koodaamisesta automaattiseen tietojenkäsittelyyn – kuka ostaisi "vähän" käytetyn sijoitusoperaattorin? 23-08-2019

      Lue lisää: Koodaamisesta...

    • Opiskeluvinkit ja lisätietoa syksyn 2019 full stack -koulutukseen hakevalle 28-06-2019

      Lue lisää: ...

    • Sofia Digital sai erinomaisen työntekijän ja Rami erinomaisen työpaikan 26-06-2019

      Lue lisää: Sofia Digital...

    • React on tänä vuonna funktionaalisempi kuin koskaan ennen 25-06-2019

      Lue lisää: React on tänä...

    • Kanaherkun tuoksuinen johdatus funktionaaliseen ohjelmointiin - ilmainen kirja! 19-06-2019

      Lue lisää: Kanaherkun...

    • Työpaikka syntyy osaamisesta ja erinomaisesta ryhmähengestä - palautetta 2018 alkaneelta full stack -kehittäjä kurssiltamme 26-05-2019

      Lue lisää: Työpaikka...

    • Full stack -kehittäjäksi React, JavaScript/TypeScript ja node.js teknologioilla ja funktionaalisella otteella 21.10.2019 alkaen 26-05-2019

      Lue lisää: Full stack...

    • Funktionaaliseen ohjelmointiparadigmaan tukeutuva React-kirjasto on päivä päivältä funktionaalisempi 15-05-2019

      Lue lisää: ...

    • Maailman ensimmäinen Haskell-kieltä koodaava koira laittaa koiranherkkupussin sisällön järjestykseen 01-04-2019

      Lue lisää: Maailman...

    • Ideal Learningin opit kantavat vielä vuosienkin päästä 31-01-2019

      Lue lisää: Ideal...

    • Miksi Haskell-kielen perusteet kannattaa ottaa vuoden 2019 oppimistavoitteeksi? 02-01-2019

      Lue lisää: Miksi...

  • 2018
    • Selma-koiran jouluhaukut oppilaille ja yhteistyökumppaneille! 23-12-2018

      Lue lisää: Selma-koiran...

    • Funktionaalinen ohjelmointimalli on yhä suositumpi – Chalmersin yliopisto palkkaa lisää tutkijoita aiheen pariin 07-10-2018

      Lue lisää: ...

    • Ohjelmointia ilman härpäkkeitä - funktio-käsitteen oppiminen rapujuhlilla 25-08-2018

      Lue lisää: Ohjelmointia...

    • Mennäänkö ohjelmoinnin opetuksessa sivuraiteelle? 22-08-2018

      Lue lisää: Mennäänkö...

    • Funktionaalista ohjelmointia hauskasti Haskellilla - Pitkyn asiallinen iltapala 26.9.2018 17-08-2018

      Lue lisää: ...

    • Voisiko ohjelmointia oppia ilman tietokonetta? 13-08-2018

      Lue lisää: Voisiko...

    • Voisinko oppia ohjelmoimaan? 10-08-2018

      Lue lisää: Voisinko...

    • Ohjelmoinnista ei voi kiinnostua, ellei sen eteen tee töitä 01-08-2018

      Lue lisää: ...

    • Python - paras ensimmäinen ohjelmointikieli? 27-07-2018

      Lue lisää: Python -...

    • Uusille urille - opiskele front-end, back-end tai full-stack -kehittäjäksi 24-07-2018

      Lue lisää: Uusille...

    • Selma-koiran kesäloma-ajatukset funktionaalisesta ohjelmoinnista 13-06-2018

      Lue lisää: Selma-koiran...

    • Koodailu on toisinaan ihan turhaa hommaa 19-03-2018

      Lue lisää: Koodailu on...

    • Morgan Stanley palkkaa Scala-taitoisia 28-01-2018

      Lue lisää: Morgan...

    • Funktionaalinen ohjelmointi keskustelutti 24.1.2018 25-01-2018

      Lue lisää: ...

    • "The data indicates that functional languages are better than procedural languages" 10-01-2018

      Lue lisää: "The data...

  • 2017
    • Ideal Learning Oy:n kouluttajille mentaalivalmentaja ja personal trainer 02-12-2017

      Lue lisää: Ideal...


Takaisin ylös

© 2021 Ideal Learning - hauskin tapa oppia