You Don't Need to Code - Upscale 3.0
"If the solution requires no code, don't code at all." - Iqbal Farabi, coach of Upscale 3.0
Today, I will write about Upscale 3.0, a workshop / mini-bootcamp held by Go-Jek. Unfortunately, this year, they couldn't held the event at Go-Jek office at Pasaraya Blok M due to deep cleaning because of Covid-19.
Okay, I will make this short, so you can get a glimpse of what's happening. But, if you want to experience this first hand, challenge yourself and apply Upscale 4.0.
Day 1: Behavior Driven-Development
So, the first day in the morning, I didn't recognize anyone. In fact, the first friend I made from Upscale is Aldi.
The design of the seating is for pair programming. They want to make sure that each of us got a pair. And then... Miss Aida (from Go-Academy) told us, the participants, to switch places, so that our pair is not from same university. Oops ITB students :-) Well, I got lucky (but kinda sad as well), because I'm the only one from Binus University. (Prior to this event, I asked my friends whether they applied / not. They applied, but failed. I asked Aldi how much score did he get, and he replied "Well, if you don't get 100, I don't think you got called.") So, who's my partner? My partner is a student from ITB, Kevin.
The coach is Mas Iqbal Farabi, system engineer of Go-Pay. The course is about Behavior Driven Development (BDD). First, he tells us about 3 rules in this bootcamp:
- If the solution requires adding code, then add minimum code to pass the test.
- If the solution requires removing code, then remove your code.
- If the solution requires no code, don't code at all.
These are actually rules for Test Driven Development (TDD) and BDD. The difference between those two is TDD focus on unit tests (per method), but BDD focus on "what is possible" (a.k.a. client behavior).
Then, he tells us about Non-negotiable Etiquette (NNE). There are several points need to be fulfilled when programmers code. I list here some of the most memorable points:
- No comments allowed.
- End your code with a blank line.
- Spaces, no tabs.
- Follow the programming language's convention (use lint to guide you. Ruby has Robocop, which we use in Upscale. TypeScript has ts-lint. Golang has golint).
- Use README.md for documentation.
- Use module.
Well, of course, these are just theories. Until we have to practice it in this problem:
Given points in cartesian coordinate, calculate the distance.
Simple, right? But instead, he asked us to ask. We should ask about this problem. Why? Because we cannot assume about the problem. We have to make everything clear. These are the clarifications:
- there are 2 points;
- the x and y coordinate isn't decimal;
- ... and many more.
It turns out, fulfilling NNE is damn hard. Several pairs failed. Well, my pair (with Kevin) is the first pair to fulfill NNE :-)
As stated in this post by another participant, in BDD, you really write minimum code to pass the test, even when the code is non-intuitive.
This is the sample when you have 2 points at the same coordinate...
def get_length(a, b) 0 end
This is when you add test case for 2 horizontally co-linear points...
def get_length(a, b) (a.x - b.x).abs end
This is when you add test case for 2 vertically co-linear points...
def get_length(a, b)
if a.x == b.x
(a.y - b.y).abs
end
(a.x - b.x).abs
end
... And so on. Of course, the above method is not finished yet, but at least you get the idea.
Mas Iqbal also mentioned about Three Virtues of A Programmer, Demeter Law, Tell Don't Ask principle, Cynefin framework, Blameless Postmortem, Root Cause Analysis, FIRST Principles of Testing, 60/60 Rule, and The Principle of Least Astonishment.
NOTE: This is my repository when trying BDD myself: https://github.com/iamdejan/rust-convex-hull
Day 2: Dev-Ops
Today, the topic is about Dev-Ops, one that I'm curious. The coach is Mas Faris and Mas Giovanni.
The first principle of Dev-Ops is not about tools at all, but rather about culture. They explain about the book called The Phoenix Project that is good for Dev-Ops knowledge. They also explain about The Three Ways:
- The First Way: Systems Thinking. Make sure we deliver our values faster. There are ways to do this, including BDD and CI/CD. Combine them, and you can deliver values very fast.
- The Second Way: Amplify Feedback Loop. Make sure we got feedback as soon as possible. We don't need to wait for our users to complain, right?
- The Third Way: Culture of Continual Experimentation and Learning. Make sure we have infrastructures for experiment, so that if we breaks something, we don't destroy our values.
The course is taught with Travis CI and Docker. I'm new to both of these, so I'm struggling :-) Nevertheless, I tried Travis CI for my personal projects, and it went quite well. I'm still learning Docker, though.
NOTE: This is my Travis CI build when trying myself: https://travis-ci.org/github/iamdejan/rust-convex-hull
Epilogue
JUST TRY IT! You will not regret!
Also, thank you to Go-Academy for the opportunity!
Notes
- My personal Gist: https://gist.github.com/iamdejan/c258bea1a0f3c22365d9a15a7f870099
- Articles from other participants: Zahrah (https://medium.com/@zahrahayuafifahfebriani/whats-on-gojek-upscale-3-0-a2de4202ec92), Ridwan (https://medium.com/@rid1hady/go-jek-upscale-3-0-a-review-fef67004d381), and Kevin (https://medium.com/@kevin.nw/an-unexpected-mini-bootcamp-4627a35ce2de)