The long way through Software Craftsmanship

Books read in 2016Q4

Dec 31, 2016 - 1 minute read - Comments - bookreading2016Q4self-studycodurance

Books I’ve read this quarter1:

Books started, not yet finished (WIP):

Books I want to finish. Usually come from another quarter:

Books that have entered the queue:

Non-technical that have entered the queue:

  • La psicología del dinero, Hammond
  • Invirtiendo a largo plazo, García Paramés
  • Quién domina el mundo, Chomsky
  • Homenaje a Cataluña, Orwell
  • El camino al 18J, Payne
  • Cartas desde la revolución bolchevique, Sadoul
  • Shogun: The Life of Tokugawa Ieyasu, Sadler
  • Els jueus i Catalunya, Villatoro
  • Russell en 90 minutos, Strathern
  • El problema de los tres cuerpos, Liu

  1. The ending date of the quarter is the same as the publication date ↩︎

A common misunderstanding about `reduce`

Dec 14, 2016 - 2 minute read - Comments - functional-programmingclojurehaskelljavascriptmisunderstandingreducefoldhigher-order-functionquotemozilla-developer-network

Misconception

I’ve read in several places that reduce reduces an array1 of values to a single one. The main characteristic of this function is not to reduce to a ‘smaller element’ / ‘single element’, but to have access to the accumulated results and the elements, one by one. Quoting Mozilla Developer Network’s (MDN) Javascript reference:

The reduce() method applies a function against an accumulator and each value of the array (from left-to-right) to reduce it to a single value.

Array.prototype.reduce() at MDN

Examples

Note: the examples in this article are in Javascript.

This is a simple example of such function:

> let sum = function (a, b) { return a + b; };
undefined
> [1,2,3].reduce(sum)
6

reduce can reduce a collection of elements to a single one. But this is not its defining characteristic. Let’s see another example:

> let append = function (element, accumulator) { accumulator.push(element); return accumulator };
undefined
> [1,2,3].reduce(append, [])
[ 1, 2, 3 ]

Note: this is a special case, where the elements are not altered by the reduce. Can be seen as the identity element for reduce.

This same behaviour can be reproduced with a map:

> let identity = function (x) { return x; };
undefined
> [1,2,3].map(identity)
[ 1, 2, 3 ]

An example that requires a reduce (and not a map) is frequencies. This function calculates the frequency of the elements in the collection:

> frequencies([3,3,2,1,-1])
{ '1': 1, '2': 1, '3': 2, '-1': 1 }

Why not a map? Because you need to cumulate the results.

> let frequency = function (accumulator, element) { 
  if (!accumulator[element]) {
    accumulator[element] = 0;
  } 
  accumulator[element]++;
  return accumulator; 
} 
undefined
> let frequencies = function (arr) {
  return arr.reduce(frequency, {});
}
undefined

Identity element: https://en.wikipedia.org/wiki/Identity_element


  1. In fact, any type in the Foldable class in Haskell. The reduce function in Javascript is in the Array prototype (only). In Clojure, a set, a map, an array, a list can be reduced. ↩︎

Self-Study in December 2016

Dec 1, 2016 - 5 minute read - Comments - self-study-aggregationdecember2016readalex-williamsanalogyautomationautopilotbob-wisebull-in-a-china-shopbytecode-generationcobra-effectcompanycompany-practicecomplacencycontainercopy-pastecppcurious-geordedebugdecoratordevopsdisable-pastedockerdocker-swarmeurekaflat-hierarchyfunctional-programminghackerhaskellimmutabilityinternet-of-thingsiotjames-sinclairjavajavascriptjoab-jacksonkuberneteslearninglearning-programming-languagemanagementmaria-konnikovamario-brosmatthew-garrettmetaprogrammingmonadmonad-explanationmonitoringnpmnpm-linkobi-wan-kenobiociodeopen-salarypassword-fieldpastepawel-brodzinskiphilippa-warrprogramming-languagepromisepythonreal-worldrequestrubysalarysecuritysimeon-simeonovsinging-in-the-rainsource-codetealteal-organizationtoby-retallicktooltroy-huntusabilityuxvalvewatch-expression

A Docker Fork: Talk of a Split Is Now on the Table

I’ve read this article by Alex Williams and Joab Jackson about the possible split in the Docker environment following Docker’s and other providers' product roadmaps. Each own has their policies and priorities and they collide in this case

Tags: docker, alex-williams, joab-jackson, container, oci, kubernetes, devops, tool

An Ode to Boring: Creating Open and Stable Container World

I’ve read this article by Bob Wise, in which he describes the state of the Docker tool and the Docker Engine. Asks for some kind of Docker long-time support (LTS - like Ubuntu does, for example) and to create a boring environment so applications on top of the containers itself can thrive.

The difference here is that application creators want some boring infrastructure because their product is the application on top, not the container themselves. Docker’s product, on the other hand, is the containers and the Engine.

Tags: ode, bob-wise, devops, tool, request, kubernetes, docker-swarm

I’ve read this article by Toby Retallick about using npm link.

Tags: npm, tool, npm-link, toby-retallick

Valve’s flat management structure ‘like high school’

I’ve read this article by Philippa Warr on the flat management hierarchy at Valve (a company cited as having some Teal practices) and its shortcomings.

Tags: philippa-warr, teal, teal-organization, valve, management, flat-hierarchy

The hazards of going on autopilot

I’ve read this article by Maria Konnikova on how pilots get distracted (their minds drift off) when not stimulated.

The article introduces the idea of human-centric automation and letting the computer check what the human is doing (to tell when it is wrong), rather than the human what the computer is doing wrong.

Tags: maria-konnikova, automation, autopilot, complacency

The “Cobra Effect” that is disabling paste on password fields

I’ve read this article on disabling paste on password fields, how that forces using a weaker password. Also names the ‘Cobra Effect’. By Troy Hunt

Tags: troy-hunt, copy-paste, paste, password-field, cobra-effect, disable-paste, usability, ux

Of course smart homes are targets for hackers

I’ve read this article by Matthew Garrett on how the security of Internet of Things devices is as important as traditional devices and what rules should a consumer follow to decide whether a device is secure or not.

Tags: matthew-garrett, security, internet-of-things, iot, hacker

Open Salaries: Outcomes

I’ve read this article by Paweł Brodziński on how the open salaries has affected them in their company (Lunar Logic):

  • removing the bottleneck for salary reviews
  • making more often and better the feedback process
  • people more involved in running the company

Tags: teal, company, salary, teal-organization, company-practice, open-salary, pawel-brodzinski

One more vote for functional languages

I’ve read this article by Simeon Simeonov in which he describes how setting a watch expression can cause a side effect (e.g. VBA, Ruby).

Tags: immutability, simeon-simeonov, watch-expression

The fastest way to learn a new programming language

I’ve read this article the ways the author (Simeon Simeonov) goes while learning a new language:

  • Curious George. During this phase, which usually lasts only a few hours and involves semi-random exploration of tutorials, reference manuals, blog posts and StackOverflow posts, I get my bearings straight, find analogies between the new language and ones I’m more familiar with and choose my initial tooling.
  • Mario Bros. -> Super Mario Bros. In this phase, which usually lasts several days, I try to bring the meta-patterns I’m comfortable working with from familiar environments (the sewers of New York) to the new environment (the Mushroom Kingdom). It involves diving head first into advanced language features and building various utilities that I find lacking in the environment, e.g., debugging tools, all in the context of early prototypes of whatever it is that I need to work on.
  • Bull in a china shop. This is the phase where my noble goal of bending the language to the way I solve problems meets the harsh reality of me being a neophyte in its intricacies. The observable attributes of this phase are lower velocity, increased use of expletives and more time on StackOverflow. The amount of time in this phase varies. The “Eureka!” moments are fun but overall it’s a dip in the experience curve.
  • Singin’ in the Rain. With newly acquired knowledge and improved language-specific testing/debugging skills, the bull gently transforms into Fred Astaire. Coding is a lot of fun again. It’s time to go to production.
  • Obi-Wan Kenobi. Over time, the interaction with the new language improves the meta-patterns I use for problem solving. I tend to use less and simpler code using natural language idioms as opposed to generalized utilities & abstractions. It’s like changing from using the Force to allowing the Force to do things through you. It takes a long time to get here. More often than not, I never do.

He also describes several (advanced) techniques that helped him better understand programming:

  • In C++ template, meta-programming […]
  • In Java, dynamic bytecode generation […]
  • In Python […] stateful decorators […]
  • In Ruby, metaprogramming […]

Tags: simeon-simeonov, metaprogramming, ruby, decorator, python, bytecode-generation, java, cpp, learning-programming-language, programming-language, curious-georde, mario-bros, bull-in-a-china-shop, singing-in-the-rain, obi-wan-kenobi, eureka, learning

The marvellously mysterious javascript Maybe monad

I’ve read this article by James Sinclair in which he tries to explain monads in javascript, explaining how promises work, then establishing the parallellism between a promise and a type of monad.

Tags: monad, javascript, promise, james-sinclair, analogy, functional-programming, monad-explanation

Debug.Trace

I’ve read both the documentation and the source code for Debug.Trace, a haskell module that contains functions to trace a program execution. It is interesting to see how a function performs side effects and its signature seems to be pure.

The main trick is to use unsafePerformIO, which points to unsafeDupablePerformIO, which performs a side effect on the Real World (runRW#).

Tags: haskell, debug, monitoring, source-code, real-world

Self-Study in November 2016

Nov 1, 2016 - 2 minute read - Comments - self-study-aggregationnovember2016readadvicebartosz-milewskicate-hustoncommitcommit-messagedavid-heinemeier-hanssondhhfeaturefunctional-iofunctional-programminghaskelliojohn-cutlermanagementmicrosoftmonadone-on-oneproduct-developmentproduct-managementpsychologyrantrunar-bjarnasonscalaschool-of-haskelltalktaotao-te-chingtim-popetoolvaluevideo

Advice for white men

I’ve read this article by Cate Huston about how advice affects different people.

But here are some things to consider:

  • Advice on failure is different for people who are judged on performance rather than potential.
  • Advice on saying no is different for people who aren’t appreciated for doing work for the collective… but who are punished if they don’t.
  • Advice on negotiation is different for people who are perceived negatively when they do negotiate.
  • Advice on choosing a new job is different for people who disproportionately experience harassment (it’s another factor to consider).
  • Advice on raising your profile is different for people who are recognized for their advocacy more than their work.

Tags: cate-huston, management, advice, psychology

On 1:1s

I’ve read this article by Cate Huston about one-on-ones (1:1s), that includes how she handles and the purpose of them.

For me, 1:1s were about active relationship building, with a focus on the important-but-not urgent. But having built a relationships where we talked regularly and I listened, that created space for conversations to happen outside of the 1:1

Tags: cate-huston, management, psychology, one-on-one

Microsoft, I forgive you!

I’ve read this article by David Heinemeier Hansson (DHH) on why Microsoft has changed and why the author has forgiven past beefs.

Tags: dhh, david-heinemeier-hansson, microsoft

Stop writing rambling commit messages

I’ve read this rant by Tim Pope on commit messages

Tags: rant, commit-message, tim-pope, commit

A Note About Git Commit Messages

I’ve read this article by Tim Pope on git commits and tools to normalize the text and apply the rules he describes

Tags: commit-message, tim-pope, commit, tool

Purely Functional I/O

I’ve watched this talk by Runar Bjarnason on purely functional IO. In the first part, he introduces functional programming, referential transparency and functional IO. In the second part, he explains the types for IO and both the implementation in haskell and in scala.

Tags: runar-bjarnason, haskell, scala, talk, video, functional-programming, functional-io, io

12 Signs You’re Working in a Feature Factory

I’ve read this listicle by John Cutler on signs that a company is very centered in features rather than value.

Tags: john-cutler, feature, value, product-management, product-development

3.a The Tao of Monad

I’ve read this article by Bartosz Milewski explaining the Monad under another lens.

He draws some inspiration from Lao Tzu, in Tao Te Ching: TE as virtue, laziness.

Tags: bartosz-milewski, monad, haskell, school-of-haskell, tao-te-ching, tao

Self-Study in October 2016

Oct 1, 2016 - 3 minute read - Comments - self-study-aggregationoctober2016read.netagileappleargumentattackcap-watkinscareer-changecarlos-blecodesaicomparisoncompilationcompiled-javascriptcompiled-languagecompiled-to-javascriptcomputer-scienceconvincingcross-functionaldan-billingdavid-hataniandecision-makingdesigndestructuringdiscussionexampleexchangefeedbackfunctional-programminghaskellhonestyhoneypotinheritancejavascriptjeremy-ashkenasjohn-de-goeslawlessons-learnedliskovlspmacmdnmeetingmodesto-san-juanmonoidnewtype-clasesowen-williamspeoplepost-mortemprecogprocessryan-hewittscrumsecuritysigilsliding-scalesolidstartupstrategythree-amigosticket-magpietype-classesuiuxwikipedia

Should Engineers Design?

I’ve read this article by Cap Watkins where he explains the relationship between designers and programmers and how to get the latter involved in the design / UX / UI process.

Tags: cap-watkins, design, ux, ui, exchange, cross-functional

The Sliding Scale of Giving a Fuck

I’ve read this article by Cap Watkins where he explains that different topics have a different importance to each one of us: this topic might be very important for someone else, ergo, it makes mores sense to evaluate their option more carefully. When your importance level is not so high, you can take the other option easily.

Tags: cap-watkins, sliding-scale, decision-making, discussion, argument, convincing, people

Nuevos retos

I’ve read this article by Modesto San Juan about him leaving Codesai and joining a new adventure. In Spanish.

Tags: career-change, modesto-san-juan, codesai, carlos-ble, .net

Muchas gracias Modesto

I’ve read this article, by Carlos Blé and the rest of the Codesai team, saying goodbye to Modesto San Juan, commenting on their experiences working with him.

Tags: career-change, modesto-san-juan, codesai, carlos-ble, .net

Introducing…Ticket Magpie

I’ve read this article by Dan Billing about the a honeypot application he has to teach about security and attacks.

Tags: david-hatanian, dan-billing, ticket-magpie, honeypot, security, attack

Destructuring assignment

I’ve read the destructuring assignment page at MDN

Tags: javascript, destructuring, mdn

10 Lessons I Learned from Doing My First Real Startup

I’ve read this article, a post-mortem analysis of his company, precog, with 10 items that he learned from it.

Tags: john-de-goes, precog, post-mortem, startup, lessons-learned

Stop Being “Nice” and Just Tell the Fucking Truth Already

I’ve read this article about giving honest feedback vs being a nice guy. The author concludes that the former is, in fact, the latter.

Tags: feedback, honesty, comparison, john-de-goes

Haskell’s Type Classes: We Can Do Better

I’ve read this article about the abuse of newtype classes in haskell to overcome some language limitations.

This article has helped me understand better inheritance, in the sections orphans and laws.

Also suggests that the compiler could check at compile time that the children impose more restrictive (more specific) laws than the parent, given that any children must comply with the inherited rules (liskov substitution principle)

Tags: inheritance, liskov, lsp, solid, john-de-goes, functional-programming, haskell, type-classes, newtype-clases, monoid, law

Introducing the Three Amigos

I’ve read this article by Ryan Thomas Hewitt about the Three Amigos meeting, to better define a feature

Tags: ryan-hewitt, three-amigos, agile, meeting, process, scrum

Apple just told the world it has no idea who the Mac is for

I’ve read this article by Owen Williams on the latest presentation by Apple.

Tags: owen-williams, mac, apple, strategy

Sigil

I’ve read this page for the sigil, or the symbol attached to the variable. An example is the $ in Perl or the earmuffs in Clojure (*out*).

Tags: sigil, wikipedia, example, computer-science

List of languages that compile to JS

I’ve read this list of programming languages that compile to JS. By Jeremy Ashkenas and the community

Tags: jeremy-ashkenas, compilation, compiled-language, compiled-to-javascript, compiled-javascript, javascript

Being accountable for delivering value

I’ve read this article by Nik Silver on how the team should be accountable for delivering value, not accountable for delivering artifacts that produce value.

Tags: agile, management, nik-silver, accountability, team, value

Getting partial value from partial delivery

I’ve read this article by Nik Silver on how it is possible to be agile in an environment where the business is not agile.

Also, introduces the concept of ‘partial delivery’, meaning incomplete delivery from development to business.

Tags: delivery, partial-delivery, management, value, partial-value, change, walkawayability, change, nik-silver

Hierarchy of opinion

I’ve read this article by Mashooq Badar on what are opinions, how important they are and how them impact others.

Tags: mashooq-badar, opinion, critical-thinking

Books read in 2016Q3

Sep 30, 2016 - 1 minute read - Comments - bookreading2016Q3self-study

Books I’ve read this quarter1:

Non-technical:

Books started, not yet finished (WIP):

Books I want to finish. Usually come from another quarter:

Books that have entered the queue:


  1. The ending date of the quarter is the same as the publication date ↩︎