Skip to content

Just a little TypeScript example with a more functional approach

Notifications You must be signed in to change notification settings

david-gi/typescript-square-cipher-demo

Repository files navigation

Square cipher

An implementation of a classic method for composing secret messages called a square code. From a pre-work vetting task.

Note on style

I realize the functional programming approach and style used can often be a point of contention depending on the team's experience. I had to fit the functions to the pre-written test, so the style is also a bit mixed.

However, I would like to at least make a case for such a, seemingly dense, style.

  • Composure: Function names become more descriptive, code flow stays comprehensible, architecture more composable.
  • Easier test writing: Straightforward functions return a single value with less 'side effects'.
  • Less bugs: It kinda forces you to write working code, line-by-line, while coding.
  • More obvious abstractions: Less code, less redundant code and exponentially faster coding.
  • Maintainable: Succinctness means less to read, less to change and less to go wrong.

About

Just a little TypeScript example with a more functional approach

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published