Hey scope of baz in the green bucket I have a lhs reference for baz have you heard of him. No — go fish.
After a very enjoyable but tiring day I get to explore the offices. I really was unsure of where to start, the ground floor and go up or start at the top. I just randomly chose a floor thinking that it would only take a few minutes but an hour later and I was still on the same floor. I Walked around the offices and stopped at every meeting room to take photos. They were just amazing. A lego room where you just get to build things out of lego for those moments when your feeling blocked. A room with a tent, a room with a hammock, a room with sun loungers…. and many more for those moments you just want to relax.
There were rooms like an enchanted forest, a yoga room, a room with elks coming out of the walls or life size knights in shining armour. It was so impressive and I felt like I was in a museum. I then decided to skip a few floors and went to pay a visit to the roof which is a running track across the whole building incase you didn't want to go running in the trivago gym. From there I headed down to the terrace where I joined one of the teams who were having a team barbecue on the 5th floor terrace.
We then learnt how to better understand callbacks which represent work that we want to occur at a later time. They have a now part and a later part. Callbacks could be called continuations as they are when the program continues at a later stage. We went over what exactly callback hell is and how to avoid it and went over thunks and promises. I think you can easily say that we all loved Kyle's definition of a promise and for sure will remember it forever.
A promise is like an IOU from a restaurant, its a promise for a future cheeseburger. Hand in the placeholder(receipt) and you get the cheeseburger. A promise is a future cheeseburger.
After promise all, promise race and observables I went straight from trivago to a company next door called Invison for a meetup along with some others from the JS workshop. Here we got to live code along building a react app with apollo and graphQL. Really interesting meetup and so easy and nice to work with graphQL.
Day 4 we started part 1 of Funcional Light Programming. The difference between Imperative — how things are done and Declarative — Why we are doing it. We also learnt the rules of functional programming and that a function doesn't just take inputs and computes outputs it only takes inputs and computes outputs. But as always there are many sides to the rubric cube and there are always exceptions to the rules. Functional programming says no side effects. Side effects can include input, output, writing to the DOM, writing to files or databases etc. We have to do some side effects of some sort. The rule is to avoid side effects wherever possible as most bugs will come from side effects so if you know where the side effects are in your programming then you would know more or less where the bugs are. We learnt what a pure function is and how to purify it if it isn't pure. And then learnt about closures.
Functions close over free variables the ones that are outside of themselves but that they make reference to. In functional programming we are closing over state that is never changed unlike normal closures where we have changing state in the closures.
After an exhausting day I got to team up with a few others and we explored the remaining floors of the trivago offices and stopped for a while to play table tennis on the terrace, table football in the kickers room, a bit of golf in the golf room and then finished up with a massage in the massage chair of the relax room, as you do.
Day 5 we finished off Functional Light Programming by taking a look at Partial Application — takes a function with multiple parameters and returns a function with fewer parameters and Currying — the process of breaking down a function into a series of functions that each take a single argument. Currying looks less convenient, but it is more convenient than partial. We then moved on to Recursion — iterating over an operation by having a function call itself repeatedly until it arrives at a result. Describe what my problem space is — reduce the problem space either by half or by one or whatever and keep repeating that until i eventually get my answer. We then went on to work with lists with the map, reduce and filter functions. And after some challenging exercises it was time for a few well deserved beers.
It was also great to explore the trivago offices and visit their amazing rooms and many kitchens making you feel like in any moment you can just be in another part of the world, relax, be more creative or just look for some inspiration. I really do wish more companies would realise the importance of having this type of workspace where you just feel at home and at ease at every moment. But for me the highlight of my trip and what I loved about trivago was the sense of community. At any given moment you just felt welcome and part of the team. With so many people from so many countries it was really great to get to know and hangout with so many great people and really feel like you belong. Thanks Bluekiri, Kyle and Life at trivago for an amazing experience.