Skip to content

Commit 9c332c8

Browse files
committed
docs: simplify and update README
1 parent d672bfd commit 9c332c8

File tree

1 file changed

+20
-124
lines changed

1 file changed

+20
-124
lines changed

README.md

Lines changed: 20 additions & 124 deletions
Original file line numberDiff line numberDiff line change
@@ -1,137 +1,33 @@
11
# Practicing Functional TypeScript
22

3-
Why bother?
3+
## Purpose
44

5-
> The biggest problem in the maintenance of large-scale software systems is complexity—large systems are hard to understand.
5+
Simplify software complexity by practicing functional programming in TypeScript. Functional programming with pure functions helps reduce complexity, making code easier to understand, test, and maintain.
66

7-
—[_Out of the Tar Pit_](http://curtclifton.net/papers/MoseleyMarks06a.pdf)
7+
## Approach
88

9-
Functions are simple. They are the simplest building blocks we have for making useful software. Simplicity matters because building software is hard. It is also easy to make building software more complex than necessary to solve the essential user problem. This [accidental complexity](https://en.wikipedia.org/wiki/No_Silver_Bullet#Summary) makes software harder to understand, harder to test, harder to maintain, more expensive, and ultimately not very fun to work with. But it doesn’t have to be that way!
10-
11-
The difference between [simple](https://en.wiktionary.org/wiki/simple#English) and [complex](https://en.wiktionary.org/wiki/complex#Etymology) is not just that complex things have more parts but that those parts are folded together—entwined. Working with [pure](https://github.com/hemanth/functional-programming-jargon#purity) functions and [composing](#function-composition) them to solve problems are essential functional programming skills that can be used to untwine and simplify this type of complexity.
12-
13-
Note: [Simple does not mean easy](https://www.youtube.com/watch?v=oytL881p-nQ&t=25s). Hard problems are still hard. Simplicity only makes a hard problem easier to think about by breaking it into independent subproblems. These subproblems are easier to understand and solve in isolation and can be composed to form the larger solution.
14-
15-
## Contents
16-
17-
- [Usage](#usage)
18-
- [Exercises](#exercises)
19-
- [Questions](#questions)
20-
- [Resources](#resources)
21-
22-
## Start
23-
24-
- Clone this repository: `git clone git@github.com:yosevu/practicing-functional-javascript.git`.
25-
- Change to the exercises directory: `cd practicing-functional-javascript/src/exercises`.
26-
- Run tests: `npm test hello-world`.
27-
- Run tests in watch mode: `npm watch hello-world`.
28-
- Lint exercises: `npm run lint`.
9+
- **Functional TypeScript:** Solve problems using core JavaScript and TypeScript features with a focus on functional programming.
10+
- **Built-in Methods:** Prioritize using JavaScript's built-in functions and TypeScript's type system to implement solutions without relying on external libraries.
2911

3012
## Exercises
3113

32-
This is an index of the the exercises.
33-
34-
1. [Hello World](https://github.com/yosevu/practicing-functional-javascript/blob/master/src/exercises/hello-world)
35-
1. [Two Fer](https://github.com/yosevu/practicing-functional-javascript/blob/master/src/exercises/two-fer)
36-
1. [Resistor Color](https://github.com/yosevu/practicing-functional-javascript/blob/master/src/exercises/resistor-color)
37-
1. [Resistor Color Duo](https://github.com/yosevu/practicing-functional-javascript/blob/master/src/exercises/resistor-color-duo)
38-
1. [Gigasecond](https://github.com/yosevu/practicing-functional-javascript/blob/master/src/exercises/gigasecond)
39-
1. [RNA Transcription](https://github.com/yosevu/practicing-functional-javascript/blob/master/src/exercises/rna-transcription)
40-
1. [Space Age](https://github.com/yosevu/practicing-functional-javascript/blob/master/src/exercises/space-age)
41-
42-
## Questions
43-
44-
- [What is this?](#what-is-this)
45-
- [Why does this exist?](#why-does-this-exist)
46-
- [Who is this for?](#who-is-this-for)
47-
- [What is the approach?](#what-is-the-approach)
48-
49-
### What is this?
50-
51-
Practicing Functional JavaScript is a collection of [exercises](#what-is-the-approach) that help you level up your functional programming skills with JavaScript. These exercises emphasize experience and building patterns through exposure to many examples. Understanding concepts like function composition and referential transparency is more useful when you can recognize them through repeated exposure to the patterns in specific examples.
52-
53-
The exercises focus on the functional part of functional programming and the techniques that are available when working with [pure functions](#reference). Working with functions is the best practical place to get started with functional programming and a great way to practice patterns that can be used in any code base.
54-
55-
_Note: This is not intended to cover the equally important (but more advanced topics) of structuring data and managing state and side effects._
56-
57-
### Why does this exist?
58-
59-
The purpose of Practicing Functional JavaScript is to create an example-based resource of exercises for practicing functional patterns in JavaScript, bridging the gap between imperative and functional thinking.
60-
61-
There are some great [functional programming resources](#resources) that use JavaScript. They give a good overview of functional programming and explain core concepts through thoughtful and engaging discussions with pertinent examples. The focus of Practicing Functional JavaScript is practice—practice to gain exposure to functional patterns and functional thinking, practice refactoring imperative to functional code, and examples to anchor functional concepts to.
62-
63-
### Who is this for?
64-
65-
Practicing Functional JavaScript is for anyone who wants to practice functional programming patterns and functional thinking in JavaScript.
66-
67-
This is not intended to be used on its own, especially for people who are learning to code. Functional programming is a great introduction to programming, but Practicing Functional JavaScript doesn’t try to teach the concepts, it simply provides a resource of examples for mapping those concepts to. For some great introductory resources, see [resources](#resources).
68-
69-
### What is the approach?
70-
71-
Solve each exercises in two ways.
72-
73-
1. Use core JavaScript functional functions, methods, and other features.
74-
1. Use Ramda utility functions and functional programming patterns.
75-
76-
#### Exercism
77-
78-
> Code Practice and Mentorship for Everyone.
79-
80-
[Exercism](https://exercism.io/) is a great platform to practice programming and is the
81-
foundation for Practicing Functional JavaScript for three main reasons:
82-
83-
1. 101 open source JavaScript exercises
84-
1. Test-driven
85-
1. Modern JavaScript development environment and tooling
86-
87-
#### ESLint and eslint-plugin-functional
88-
89-
> A pluggable and configurable linter tool for identifying and reporting on
90-
> patterns in JavaScript.
91-
92-
> ESLint rules to disable mutation and promote fp in JavaScript and TypeScript.
93-
94-
Linting is great for learning because it can help you begin to notice patterns
95-
and think about concepts that you may not have been aware of. In a
96-
multi-paradigm language as flexible as JavaScript, linting is
97-
essential for writing understandable and maintainable code. [ESLint](https://eslint.org/) is great
98-
because it is configurable and customizable with plugins like
99-
[eslint-plugin-functional](https://github.com/jonaskello/eslint-plugin-functional).
100-
This plugin enforces functional patterns and is also a great source of
101-
practical information about functional programming.
102-
103-
#### Ramda
104-
105-
> A practical functional library for JavaScript programmers.
106-
107-
Ramda is a popular JavaScript functional programming library. It is practical, easy to get started with, and it provides a flexible set of utilities to start using the functional
108-
concepts and patterns that you don’t get out of the box with JavaScript. It also
109-
has great documentation and a great community. There is a wealth of information
110-
to learn from and understand functional programming.
14+
This repository contains several exercises focused on functional TypeScript:
11115

112-
#### Hindley Milner Types
16+
1. Hello World
17+
2. Two Fer
18+
3. Resistor Color
19+
4. Resistor Color Duo
20+
5. Resistor Color Trio
21+
6. Gigasecond
22+
7. RNA Transcription
23+
8. Space Age
11324

114-
> A classical type system for the lambda calculus with parametric polymorphism.
25+
## Why Functional Programming?
11526

116-
Type systems are not strictly required for functional programming since the Lambda Calculus foundation that Functional Programming is based on can be typed or untyped. Whether strongly typed or dynamic like JavaScript, thinking about the type signatures of functions is a useful skill. We will use the standard [Hindley-Milner type system](https://en.wikipedia.org/wiki/Hindley%E2%80%93Milner_type_system) and annotate our functions in comments. See [Chapter 7: Hindley-Milner and Me](https://drboolean.gitbooks.io/mostly-adequate-guide-old/content/ch7.html) of Professor Frisby's Mostly Adequate Guide to Functional Programming for a fun and accessible introduction.
27+
Functional programming is about simplifying complexity by breaking down problems into pure, composable functions. This repository is designed to help you practice functional programming concepts in TypeScript by solving real-world problems.
11728

118-
## Resources
29+
## How to Solve Exercises
11930

120-
- [Awesome FP JS](https://github.com/stoeffel/awesome-fp-js)
121-
- [Awesome Functional Programming](https://github.com/xgrommx/awesome-functional-programming)
122-
- [Clean Coders Functional Programming](https://cleancoders.com/videos?series=clean-code&subseries=functional-programming) by Robert Martin
123-
- [Composing Software](https://medium.com/javascript-scene/composing-software-the-book-f31c77fc3ddc) by Eric Elliot
124-
- [Functional-Light JS](https://github.com/getify/Functional-Light-JS) by Kyle Simpson (Great for beginners)
125-
- [Functional Programming Jargon](https://github.com/hemanth/functional-programming-jargon)
126-
- [Grokking Simplicity: Taming complex software with functional thinking](https://www.manning.com/books/grokking-simplicity) by
127-
Eric Normand (Great for beginners)
128-
- James Sinclair [blog](https://jrsinclair.com/web-development/)
129-
- [JavaScript Allongé, the "Six" Edition](https://leanpub.com/javascriptallongesix/read) by Reginald Braithwaite
130-
- Jessica Kerr [talks](http://jessitron.com/talks.html) and [blog](https://blog.jessitron.com/)
131-
- [Out of the Tar Pit](http://curtclifton.net/papers/MoseleyMarks06a.pdf) - Ben Mosely and Peter Marks
132-
- [Professor Frisby’s Mostly Adequate Guide to Functional Programming](https://github.com/MostlyAdequate/mostly-adequate-guide) by Brian Lonsdorf (Great for beginners)
133-
- [The Structure and Interpretation of Computer
134-
Programs](https://mitpress.mit.edu/sites/default/files/sicp/full-text/book/book.html)
135-
(The Wizard Book and [lectures](https://www.youtube.com/playlist?list=PLE18841CABEA24090)) by Gerald Jay Sussman and Hal Abelson
136-
- [Thinking in Ramda](http://randycoulman.com/blog/categories/thinking-in-ramda/) by Randy Coulman (Great for beginners)
137-
- [Why Ramda](https://fr.umio.us/why-ramda/) by Scott Sauyet
31+
- **Use Built-in Methods:** Leverage JavaScript's and TypeScript's built-in methods for functional programming.
32+
- **Emphasize Purity:** Focus on creating pure functions that are easy to test and reason about.
33+
- **Ensure Immutability:** Write code that avoids mutating data, preferring immutable data structures and operations.

0 commit comments

Comments
 (0)