Skip to content

Instantly share code, notes, and snippets.

View sizovs's full-sized avatar
🌴
Mentoring software developers @ principal.dev

Eduards Sizovs sizovs

🌴
Mentoring software developers @ principal.dev
View GitHub Profile
@sizovs
sizovs / velocity.md
Last active August 24, 2022 09:11
velocity.md

❌ Velocity is not a sum of individual work hours multiplied by work days:

3x full-time engineers = 240 hours of work (40h x 3ppl x 2-week sprint).

Because Velocity must account for for meetings, interruptions, onboarding, rework, waiting, handoffs, uncertainty, productivity fluctuations, pair programming, it's impossible to calculate it in advance by just counting heads.

✅ Velocity is determined empirically, by running a number of sprints, and then seeing how much the team can actually accomplish. Comfortably, without cutting corners, on Wednesday or Thursday. Not on Friday 6pm.

💥 Velocity determined by counting individual hours is a recipe for disaster. Empiritally determined team's velocity will always be less than total work hours. And because velocity is less than sum of individual work hours, that leads to conflict, pressure, and micro-management.

@sizovs
sizovs / Principal.md
Created January 22, 2022 07:27
Principal TrueLayer Jan 20-21

Good morning, team!

Below I'll share some "the missing parts".

  • The idea of "Behind every request, there is an unsatisfied need" comes from the Nonviolent Communication book by Marshall Rosenberg. It's the best communication book ever written and it has helped me understand people better, and build the family I always dreamed of.
  • Other 5 forces of influence are:
@sizovs
sizovs / Solutions.java
Last active November 12, 2021 08:55
Solutions.java
// 1. refactor the code so it's at the same level of abstraction (SLAP).
int from = 8000;
int to = 9000;
int availablePort = IntStream
.rangeClosed(from, to)
.map(Port::new)
.filter(Port::isAvailable)
.findFirst();
class Port {
@sizovs
sizovs / Playtec Nov 11.md
Last active November 12, 2021 18:43
Playtech Nov 11-12 2021
// 1. refactor the code so it's at the same level of abstraction (SLAP).
int from = 8000;
int to = 9000;
int availablePort = IntStream
.rangeClosed(from, to)
map(Port::new)
.filter(Port::isAvailable)
.findFirst();
class Port {
@sizovs
sizovs / Playtech.java
Last active May 28, 2021 07:39
Playtech May
// 1. refactor the code so it's at the same level of abstraction (SLAP).
int from = 8000;
int to = 9000;
IntStream
.rangeClosed(from, to)
.mapToObj(Port::new)
.filter(throwingPredicate(Port::isFree)) // sneakily throws the original exception (faux-pas)
.filter(wrap().predicate(Port::isFree)) // wraps unchecked exception (noexceptions)
.findFirst();
package com.homework.services;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.homework.exceptions.CountryResolverException;
import com.homework.models.Country;
import com.homework.repositories.CountryRepo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Configurable;
  1. README.md: no information on how to run and test the app.
  2. README.md: no information on minimum runtime requirements (Java 11+).
  3. Unused code: getSurname(), getLoans(), setLoans(...) etc. Best practice: never write/generate code "just in case".
  4. Packaging: according to Common Closure Principle, classes that change together must be packaged together. So, instead of putting closely related classes in different packages (exceptions, models, enums, repositories, requests, services), put them together or split by domain (lending, client). More info here.
  5. API: the API tries to be, but is not RESTful. E.g. plurals should be used: /loans, /loans/{clientUUID}
  6. Architecture: domain model leaks to the API. Instead, we should decouple the domain model from our API/screens, because they change for different reasons. In practice, our APIs should always return DTOs, not entities.
  7. Excepti
// 1. refactor the code so it's at the same level of abstraction (SLAP).
0.
Range range = new Range(8000, 8005);
var port = Port.freeWithin(range);
1.
int from = 8000;
int to = 9000;