Ok, weird day. Eventually I got the command to get into prod db. And started with
And Devon wrote that it's better to use another db server, a read-only copy, with a slightly different name.
Okay. It turned out we have 15M users. Now what, Do a join with a couple of other tables (I checked, one has 15M records, and another has 1M records). But then... then I simplified it, and we have just 47 users to delete. From an institution that has 850 users. Oh, whatever.
Went to the right db server - ha, I'm not allowed to do any changes.
Eventually it turned out that all I can do is send a pull request with a new file containing that query. Cool! What a life.
Meanwhile, Devon sent us, me and Esteban, a pull request to review. 156 files.
But the PR was good. Lots of improvements. Except some funny pieces that I suggested to sanitize.
One typical thing is:
Another typical thing is this:
What, inheritance is forgotten? We are past OOP, and FP is learned just by the Red Book? Runar forgot to mention inheritance in his book? Hmm.
select count(1) from users;
. After 10 minutes I asked the colleagues: what's up with the database. And Mike writes:"it's a very bad query". What's bad in it? He did not answer, except a remark that users table is often blocked by queries.And Devon wrote that it's better to use another db server, a read-only copy, with a slightly different name.
Okay. It turned out we have 15M users. Now what, Do a join with a couple of other tables (I checked, one has 15M records, and another has 1M records). But then... then I simplified it, and we have just 47 users to delete. From an institution that has 850 users. Oh, whatever.
Went to the right db server - ha, I'm not allowed to do any changes.
Eventually it turned out that all I can do is send a pull request with a new file containing that query. Cool! What a life.
Meanwhile, Devon sent us, me and Esteban, a pull request to review. 156 files.
But the PR was good. Lots of improvements. Except some funny pieces that I suggested to sanitize.
One typical thing is:
someProcessor.someProcessing(params).flatMap(Ok(_))
- I suggested to extract this .flatMap(Ok(_))
, being a typical pattern, to a method.Another typical thing is this:
trait SomeCommonThing {
val x:X;
def y(a:A): B;
def doSomething(params: Params) =
this match {
case ia: ImplementationA => ia.dothisandthat(params)
case ib: ImplementationB => ib.dosomethingelse(params)
...
}
}
What, inheritance is forgotten? We are past OOP, and FP is learned just by the Red Book? Runar forgot to mention inheritance in his book? Hmm.