Book Review: Thinking Fast and Slow
Finishing this book took me some time, because I've heard it in audio-book format and commuting to my previous job was noisy and distracting to focus on hearing, but with my recent change I now can perfectly listen to voice audios.
Title: Thinking Fast and Slow
Author: Daniel Kahneman
How we think is managed by two systems/fragments/"selfs" of the brain: One is impulsive and quick-thinking but prone to biases and errors in judgement, the other is slower, recalls memories and experience, but is "lazy" and tends to delegate to the "System one". Along this book we're taught how we commit lots of mistakes, misjudgements, wrong decisions, and in general kind of get tricked by ourselves. But also, we learn valuable leasons to become better at handling this situations (spoiler: take your time and think).
There are many chapters, focusing on different aspects, fears, biases, mistakes, choice-making... Full of examples, studies and tips to learn to avoid them. They are useful in most areas, from personal life, well-being and relations to business-related decisions.
To mention something not great, there are quite a few military-related remarks, for example examples of loss adversion with "selling missiles", when there are infinite less belicist examples. I understand that for the author (Hebrew and with a military past) it might be normal, but for me it strikes as a sad way of exemplification. Also, some chapters are a bit of an artificial separation. For example, gambling-related topics take multiple chapters.
Despite my small critics, this book is a must read. The best way to combat biases is to know them, and with so many examples becomes clear we're a bit flawed and should not rush on our decision taking actions.
Sadly I didn't noted everything as sometimes is hard to take notes and I cannot highlight as with Kindle books, but I think I wrote most of the important topics (for me at least).
- Two systems that drive the way we think. System 1 is fast, intuitive, and emotional; System 2 is slower, deliberative, logical
- Most important mistake our brain takes as the common truth: what you see is all there is
- Law of small numbers
- Law of averages: belief that the statistical distribution of outcomes among members of a small sample must reflect the distribution of outcomes across the population as a whole
- Most of what happens in life is random (most facts in the world are random). causal explanations are dangerous and many times wrong
- Anchoring effect
- Availability heuristic
- Statistics' [base rate])https://en.wikipedia.org/wiki/Base_rate_
- Conjunction fallacy: The probability that two events will both occur can never be greater than the probability that each will occur individually
success = skill + luck .
greater sucess = more skill + lot more luck
- Regression to the mean
- Intensity matching
- When we change our view of the world, we lose or weaken our hability to recall the old view. it is a weakness of our mind
- Hindsight bias
- Errors of prediction are inevitable because the world is umpredictable
- Subjective confidence shouldn't be treated as competence. low confidence can be more confident
- Intuition adds but after disciplined objective recollection
- Outcomes are gains and loses (utility of wealth): changes of wealth instead of states of wealth
- Theory-induced blindness
- Human brain gives priority to bad news
- Good relations involve more avoiding bad moments than having good moments
- Cuantification is much more powerful than mere numbers or percentages. eg.
4 out of 101 ... vs
- Narrow framing vs broad framing
- Sunk cost fallacy
- Losses evoke stronger feelings than costs
On Elastic Beanstalk, Docker and CircleCI
I joined ticketea's engineering team last month, and apart from learning how things work and doing some bugfixing weeks (to get comfortable with the code and peek at some of the projects), I also got assigned to one of the new projects. There are three projects that we have started from scratch, allowing us to decide if to keep or change the current platform (which could be more automated). In order to take decisions, we did some research and proofs of concept.
The main goal of the research was to setup a basic AWS Elastic Beanstalk orchestation system, to allow us to perform deploys, local runs, etc. without needing to manually handle EC2 instances and build the corresponding toolset, as we don't have any systems team.
Our results are mixed but still subject to change as we haven't yet discarded or decided for a certain route, we keep exploring multiple paths with the projects to decide later. Despite that, I'll leave here some notes and references.
Don't expect great notes as this is more of a cleanup of a worklog/checklist (actually, it was a simple Github issue).
Update: I wrote this blog post which might be of interest as shows how to access an EC2 service from a docker container running with Elastic Beanstalk: Securely access AWS Parameter Store from your Elastic Beanstalk Docker containers
We'll stick with CircleCI as our test runner, builder and probably continuous deployment tool for staging. Version 2.0 works nicely with containers and, despite being heavily modified from v1.0, modifications were quick to perform.
- Some caching resources:
- Automatic deploys of
dev branch was easy to implement
- If you plant ot use Docker, forget about 1.0, it implements and old version that gives headaches. With 2.0 you can install latest one in the "Virtual Machine" configuration and have no issues.
EB has been relegated to staging/production deployment. For that, the cluster features (load balancing, rolling deploys, etcetera) are great and very easy to use. Instead, for local development it is between painful and directly impossible without hacks to work decently. The reasons are multiple, primarly being:
- You cannot use docker-compose as EB internally uses it and forces you to use their YML config files or rely on fully manual Makefiles + raw Docker
eb local works only on pretty much factory-default scenarios. As soon as you start working on real services, it just doesn't works
- EB works using environments, but it is configured so one "folder" is the equivalent to one environment. So having
production etc. means one of the two following hacks:
- Have a single root
dockerrun.aws.json with placeholder variables that you replace by the appropiate enviroment values
- Have multiple
dockerrun.aws.json at subfolders (one per environment) and move them via Makefile or similar to the root depending on where you run it
- We've become more proficient on using "raw" docker, but in the end we decided to still use docker-compose, even if only for development. It saves you a lot of command line writing and is quick to change.
EB Configuration files
Alternatives to EB
One of the teams, after asking for some feedback to friends and colleages is testing Terraform. It looks promising and is working fine for them but also needs maintenance, so there is no firm decision yet regarding if to use it or stick to Elastic Beanstalk and Makefiles (at least for now).
ECS + ECR
We setup a registry and pushed both development and production images after successful builds. It works quite nicely and the only reason we are not using them actively is to try to avoid the permissions hell you enter once you want to share images between different Amazon accounts (not just IAM users on the same account, but fully separate ones).
We are using Redis for our project, a docker image for development and Elasticache for staging and production.
Tools/extensions to check and add if interesting
Pelican Publisher Script
When kartones.net was a blogging community and not my current personal minimalistic landing page, one of the blogs that my friend Lobo666 and I maintained was Uncut. With the change to BlogEngine.Net it kept working easily, with a combination of a WYSIWYG editor (or Windows Live Writer) and uploading post images via FTP (minor manual step). But when I recently moved everything to static sites, as Pelican not only doesn't provides any editor but forces you to build the site to preview the changes, my friend was quite impeded to keep posting at the blog.
On the other hand, I already had some post-processing scripts, to cleanup some files that were always copied to the output folder (and thus, uploaded to the site) and to do other tiny tasks like duplicating files (I want to maintain backwards compatibility with the original RSS feed addresses of the old blogs). They were ad-hoc, but after showing them to my friend he just asked me "if I could just make those scripts also upload automatically the modified files". And indeed, making some changes to pass by command line optionally some post identifier (I decided to use the slug) would help. As would too ease things just removing all the "full indexed pages" that Pelican builds (
index<zero-to-almost-infinite>.html pages), and just leaving 10 pages and a link to the full archives page:
This way, and removing the tags, categories and authors subfolders as I don't use them, the number of modified files to upload on a mere new blog post action is around a dozen, making it blazing fast to "deploy" with some Python code. In the end, generalizing the script for the three blogs that I still write and/or maintain, by specifying a few configuration parameters you can specify folders to create or delete, files to copy, remove, duplicate, truncating the index files... and of course upload a post or just build without uploading.
I don't want to extend myself much more as the utility of this tool is limited and very specific, getting to the point, I uploaded the script files to my Python assorted GitHub repo. The direct url of the publisher files is: https://github.com/Kartones/PythonAssorted/tree/master/pelican/publisher.
Usage is quite simple:
python3 publisher.py your-great-post-slug
And to only build:
And that's all. Until next time :)
Recommended Articles - 2017/04/01
As I recently switched job and took a few days of vacations in between, not much relevant to write about on the personal side, so another bunch of relevant articles I've read recently.
- Why Gitlab is not leaving the cloud: Interesting summary of feedback received, seems that predominant point is hidden costs and maintenance requirements that you have with a datacenter and not with the cloud.
- Another chapter in Uber's evil march to hell: This time a tool to evade authorities. Good summary of incidents at Wired
- The Uber Bombshell About to Drop: And continuing with Uber (I'll stop after this because I dislike them but don't wish to spend "bad energies"), good and detailed timeline of the Otto now apparently fake subcompany scandal.
- Wikileaks publishes CIA Hacking Tools: Scary stuff inside, like lots of unknown zero day exploits, malware for remote control and "covert microphones"...
- Firefox 52 released: I mention it because is the latest release with support for Windows XP and Windows Vista, and old plugins (using NPAPI). In exchange, is the first version to come with WebAssembly.
- @_ericelliott: How to speed up developers:
- Give them one task at a time to focus on
- Avoid context switches
- Cut meetings
- Avoid interruptions
- Helpful(?) coding tips from the CIA’s school of hacks: Some obvious, others interesting. And mostly it showcases how their it folks are just humans like everyone else.
- Microsoft is putting OneDrive ads in Windows 10’s File Explorer: It's their operating system but... this is ugly and paves a road to darker destinations.
- Living without expectations: Good advice, but hard to accomplish, at least in the short term.
- Seneca on The Shortness of Time: Of course, with the mandatory mention of not wasting time on useless meetings, but in general advice of making your time count.
- A Software Developer’s Guide to Dealing With Coworkers: Really good advices inside.
- Google, Facebook, Twitter must comply with EU consumer law—or face fines: Good but slow advancements. It is ironic that justice now acknowledges "the growing importance of online social networks" When since around 10 years they boomed and this unilateral power and privacy violations have always happened.
- A Career Retrospective—10 years working in tech: Equal parts sad and great, a tale about sexism and harassment, but also about following your dreams and being creative.
- Forget Feature Requests: Small article but quikcly summarized as:
- Let your customers remind you what's important
- How do you manage them [requests]? You don't. Just read them and then throw them away
- What happened to tablet sales?: Interesting because around me I felt exactly the same that article points out: once you have a tablet, you stick with it as long as possible, like with a computer and unlike with an smartphone.
- Should I stay or should I go? How to decide when it’s time to switch jobs: Great article summarizing main reasons. Identified myself in some of them.
- For sale (in the US): Your private browsing history: USA, "the nation of freedom" (although we could discuss it), but definetly not "the nation of privacy". Another step in losing our rights to our "data" and habits.
- @rbranson: [...] Production software tends to be ugly because production is ugly. The ugliness outpaces our ability to abstract it.
- @codemanship: Don't explain code quality to execs. Explain high cost of change. Explain slowing down of innovation. Explain longer cycle times
- @KentBeck: First you learn the value of abstraction, then you learn the cost of abstraction, then you are ready to engineer
- lobster_johnson: Interesting advice from a company having used microservices for 6+ years: Different services yes, but with a centralized data store to avoid synchronization issues (of local "data silos").
Recommended Articles - 2017/03/05
Had a bunch of links pending but past weeks have been quite busy. It's so sad that unethical and directly wrong company behaviours have been dominating the news ecosystem lately...
- Understanding the GitHub Flow: A quite simple and intuitive way of working with branches with GitHub (but applicable everywhere).
- Trunk Based Development: And the opposite to the previous point, how to work directly with trunk, not using branches. While it requires training, more care and probably some experience, I've been working in the previous step (only
dev branch and then merge to
master) and it speeds up a lot the flow, especially if you do TDD or pair programming.
- Adding Community & Safety checks to new features: Really interesting post from GitHub about non-functional requirements related to community and user safety. Must read as we usually don't take this points into account.
- Trump may sign executive order re-vamping USA’s foreign worker visas: Going to work at USA is getting uglier and harder... If this order passes, H-1B visas could cost way more and be harder to obtain.
- GitLab.com Database Incident + Postmortem of database outage of January 31: Transparency first. A GitLab engineer made a mistake and production data was lost (and in the end couldn't recover around 6h of gitlab.com data), but the exercise of a public incident report, streaming of the ongoing fix and sincere communication is what I really like. After all, we're human and everybody makes mistakes.
- Announcing GVFS (Git Virtual File System): Microsoft is changing so much that is now even working on a special Git version that allows them to work with huge repos (million files and hundreds of GigaBytes). Interesting although only seems to work with the latest Windows 10 builds.
- The Dark Standup: Good example of why forcing working your 40 weekly hours and not more makes you more efficient.
- Getting out of the startup rat race: Couldn't agree more with the article, but it's such a common scenario...
- Report: Pokémon Go has now crossed $1 billion in revenue: It's curious that media was quick to forget it and label it a failure when the growth decelerated, but the income numbers are still great.
- A future without browsers, February 2017: Nice slides about how in a few years the concept of web browser will probably dissapear. Also a quick but nice recap of how we came to the present regarding internet browsing.
- How to be an effective early stage employee. Hint: be helpful: Hint #2: Try to follow the advice whenever early stage employee or "late" one ;)
- The Power of Big Data and Psychographics: "4,000-5,000: collected data points per adult in the US". 12 minutes long talk about big data applied to US elections a few weeks before they ended. Interesting and scary once more.
- Reflecting on one very, very strange year at Uber: Sad story, good advice from DHH (hint: delete your uber account then delete the app).
- Culture is the Behavior You Reward and Punish: Another article about company culture, what you say it is versus what actions actually define it as.
- The 100% correct way to validate email addresses: Great way of explaining that sometimes taking the simple path saves you effort and works almost as good as the perfect path.
- Exponential growth devours and corrupts: DHH is on fire these days attacking the unicorn world of startups! Long essay of how corrupted the ecosystem of startups becomes when all that matters is money made and the final goal is to sell the company.
- The mythical 10x programmer: Redis creator opinion on the subject. Quick read but good lessons inside.
- Summary of the Amazon S3 Service Disruption in the Northern Virginia (US-EAST-1) Region: Interesting because, as happened recently with Gitlab's Database deletion, a small human mistake caused a big problem. We all make mistakes, but this events demonstrate how in an age of automation and complex tooling, we have to be as careful as ever doing any dangerous operation.
- The Story of Firefox OS: Long but worthwile tale of this great idea that didn't worked well.