My Coding Bootcamp Odyssey - 1 week to go ๐Ÿ˜…

Regex and Functional Programming

ยท

2 min read

My highlight of the week was taking part in the OS Map & Hack hackathon (my first). I wrote up my experience here, good and bad.

Other than that it was a short reading list, introducing regular expressions and functional programming

Regular Expressions

This, I was not looking forward to. From what I had seen it was like a foreign language so I was a bit apprehensive.

It actually turned out kinda OK. Like all programming languages (I know it's not a language) there is rules, structure and logic and the tutorial and tools like regexr demystified it a lot and I now feel ready to embrace it and learn more. It certainly looks to be very useful in some circumstances.

Functional Programming

Why?

  • Less bugs - easier to read
  • Less time - re-use code

Functions are values

So can be assigned to variables

function triple(x) {
  return x * 3;
}

or

let triple = function(x){ return x * 3; }

triple(3) // gives 9

Higher Order Functions

Are functions that take other functions as arguments or return functions. Gives composition - bundling smaller functions into a larger function. Easier to debug smaller functions and less code. e.g.

This is all good stuff and looking forward to PRE-3 next week before the bootcamp gets underway.