The long way through Software Craftsmanship

Brown Bag Session: Clojure's Data and Code

Sep 23, 2015 - 1 minute read - Comments - brown-bagtrainingclientclojurehomoiconicityprepared-katalispcode=datadata=codefeedback

Today, at a client, I’ve facilitated the brown-bag session on Clojure, introducing Lisp’s homoiconicity.

Session Structure

The session was designed as a kata, first introducing participants in the problem, letting some time to read the initial version and to think about possible solutions.

Then, I structured the rest of the time as a prepared kata, where I was explaining in the beamer our current problems (day-to-day tasks) and possible solutions in Clojure.

Among them:

  • Configuration and extensibility: allowing for flexibility, define at configuration time new features without recompiling or modifying the system.
  • Persisting and restoring certain state: this is a problem that could easily be solved persisting data in Lisp

I explained, in private to those who asked, about Lisp and its dialects Common Lisp, Clojure and Scheme.

Feedback

  • They liked the effort of investigating new languages to solve problems we have in our current stack
  • They liked introducing the language features with a back-story to better understand the concepts
  • They suggested to improve the level of the session: as the group as a whole is still starting with Clojure, leaving them on their own with code is too much. They asked for more guidance

Navigating the GitHub repositories

Sep 8, 2015 - 1 minute read - Comments - githubrepositorykatanavigatesimple-sessionrepository-search

I’ve reorganized my github repositories, especially the katas and the simple sessions.

Katas

All of them can be found in this search

Separated by language:

To the best of my knowledge, all repositories follow a similar pattern:

  • Contain the keyword ‘kata’
  • Contain the language
  • Contain a description of the exercise

An example: palindromes-searcher-kata-haskell

Simple sessions

A simple session is a lapse of time working with the language to solve a problem, but not big enough to deserve a repository of its own. Usually, the simple sessions are performed in languages that have a REPL, tool that eases this need

They can be found in this search

A basic working environment

Sep 8, 2015 - 2 minute read - Comments

Sometimes, when working out of somebody’s else computer, I won’t have my preferred IDE installed.

In this case, what I usually do –as long as the programming session is more than 5 TDD cycles–, is to configure my own environment. It includes:

  • text editor: $EDITOR is enough
  • test runner. A simple bash script executing the tests will suffice
  • git terminal: to commit, see differences, revert, etc
  • [optional] REPL if the language has it

If the system already has it, I will use screen to cycle around the sessions.

A simple test runner

More in depth, the test runner will be similar to this:

while [ true ]; do
    clear;
    date;
    runhaskell Spec.hs;
    read i;
done

This script will:

  • clear the screen (for better readability)
  • print the date
  • execute the tests
  • read from the console, effectively waiting for the user to interact (an enter is enough)

The date is useful for both detecting the pace of the cycles and for scrolling up and down in the terminal.

If this date is much too necessary, it might indicate the presence of the TDD antipattern “El Bocazas” / “A mouthful”, present in Diseño Ágil con TDD. I use when the output of the test runner is extensive (such as runhaskell).

If the test runner output is too verbose, a possible step forward is to silence output in when every test is green (fragment):

output=$(runhaskell Spec.hs);
if [ $? = 0 ]; then
    echo "OK";
else
    echo $output;
fi

Other test runners

As a side note, other test runners are quieter than others:

  • py.test will output the name of the file and “E” for error and “.” for OK
  • clojure.test will output the name of the file and a total of tests and assertions. Here to make it quieter
  • HSpec will output one line per describe and it. Inspired by RSpec
  • Jasmine will output one line per describe and it, as HSpec, as both of them are inspired by RSpec.
  • Junit and derivatives will produce the name of the file and total of tests and assertions. Also, on demand, a file containing test results so it can be interpreted by the IDE.

Brown-bag session: eXtreme Programming

Sep 2, 2015 - 1 minute read - Comments - brown-bag-sessionextreme-programmingclientxp

At a client, today I’ve introduced the eXtreme Programmig methodology, with its values, principles, practices in a brown-bag session.

It has been an informal session, without slides, but we have used this video by the Kleer guys (in Spanish).

The video gives a high-level overview of what XP is. We also needed to cover the daily practices (e.g., TDD, pair programming, whole team)

After that, we’ve done a questions&answers round to solve the teammates' doubts

Self-Study in September 2015

Sep 1, 2015 - 9 minute read - Comments - self-study-aggregationseptember2015read195830-secondalgebraic-data-typealonzo-churchanalogyanalysisandrea-mannaanonymous-functionarm-length-recursionarticleartificial-intelligenceassumptionawsbase-casebeginnerben-whaleybig-datablue-hatbooleanboolean-parameterbootcampbrainbrowserc-plus-plusc-sharpcfa2charlie-amberclassclass-invariantclojureclojurescriptclosurecobolcodycoinductioncomparisonconnor-mendenhallcontext-free-grammarconversioncorecursioncouplingcurryingdariusz-pasciakdata-structuredata-typedesign-by-contractdeveloperdialoguedimitrios-vardoulakisdirect-recursionduck-typingeiffelelevator-testentropyeric-lippertextreme-programmingfeaturefmapformal-language-theoryfrank-rosenblattfreezerfunctorgarbage-collectiongenerative-recursiongerardo-rosselgooglehabithaskellhawk-hosthenry-bakerhigher-order-functionhiringhoare-triplethow-toideaindirect-recursioninductioninformationinstant-gratification-monkeyiterative-functionjason-friedjason-liszkajavajavascript-type-inferencejay-fieldsjeff-atwoodjim-dueyjordan-medlockjudd-keppelkleerlambda-calculuslambda-expressionlanguagelisplog4jloggingloose-couplingmachine-learningmacrostatemapmartin-fowlermartin-saliasmastermarvin-minskymaxwell-boltzmannmedian-agemethod-invariantmicroservicemicrosoft-bobmicrostatemisunderstandingmutual-recursionnbanorman-ramseyobject-orientationovenpanic-monsterpaul-grahampeceptronperlpeter-norvigpeteris-kruminsphil-calcadopostconditionpreconditionprocrastinationproductprogrammingprogramming-contestprogramming-languageprogramming-skillprologpullpushqualityqueuerational-partrecursionrecursive-caserecursive-functionrecursive-regular-expressionred-hatregular-expressionreorganizationreplretirementritika-trikharobyn-scottserviceseymour-papertshannonsimulated-annealingsix-thinking-hatssl4jsoundcloudsrpstack-overflowstacktracestandard-mlstartupstatisticsstorystrengthstrongly-typedstructural-recursionstudenttail-call-optimizationtail-recursionteam-splittech-leadthermodynamicsthinkthinking-hattim-urbantiptmuxtomasz-nurkiewicztrusttype-classtype-inferencetype-inference-algorithmtype-systemunam-mxuploadvalue-stream-mappingvideovisionweakly-typedweaknessweaponwikipediawilliam-mathesonxpyagnizen

The 30 second habit with a lifelong impact

I’ve read this article list of patterns, by Robyn Scott, in which it is explained why to compress information in a few ideas, investing 30 seconds to condense the article.

Tags: 30-second, habit, robyn-scott

The Strengths and Weaknesses of Extreme Programming

I’ve watched this video explaining the strengths and weaknesses of extreme programming. By William Matheson

Tags: extreme-programming, xp, william-matheson, video, strength, weakness

Poster de Extreme Programming

I’ve watched this video introducing eXtreme Programming. By Martín Salías

Tags: martin-salias, kleer, extreme-programming, xp

Good Tech Lead, Bad Tech Lead

I’ve read this comparison of good and bad traits in tech leads. By Jason Liszka.

Explains the differences between good and bad tech leads, even though many of these qualities are shared by plain team members

Tags: jason-liszka, tech-lead, comparison

Why Procrastinators Procrastinate

I’ve read this article by Tim Urban on procrastination: this article compares the procrastinator and the non-procrastinator brain with pictures, introducing the Rational part, the Instant Gratification Monkey and the Panic Monster. Shows some reasons why.

There is more on part 2: How to beat procrastination

Tags: tim-urban, procrastination, rational-part, instant-gratification-monkey, panic-monster, brain, comparison

Algebraic data type

I’ve read this wikipedia page, that explains what this is, a few examples and the theory behind it.

Tags: wikipedia, data-type, algebraic-data-type

Recursion

I’ve read this wikipedia page, that explains the recursion basic concepts, such as:

  • induction, coinduction
  • recursion, corecursion
  • implementation details in iterative vs recursive programs:
    • shortcutting recursion (i.e., arm-length’s recursion)
    • wrapper function
    • tail-call optimization, related to tail-recursive functions
  • recursion and its relation to data structures
  • base case / recursive case and removing the need of the base one in corecursion or in non-strict languages
  • types of recursion:
    • direct, indirect, mutual
    • generative, structural

Tags: recursion, corecursion, induction, coinduction, tail-call-optimization, tail-recursion, direct-recursion, indirect-recursion, mutual-recursion, generative-recursion, structural-recursion, arm-length-recursion, iterative-function, recursive-function, base-case, recursive-case, wikipedia, data-structure

Anonymous function

I’ve read this wikipedia page, that describes what is a lambda expression or an anonymous function. How it can be used (e.g., currying, higher-order function, closures) and gives examples in many languages.

Cites its invention (Church, 1936, lambda-calculus) and its first implementation (Lisp, 1958)

Tags: alonzo-church, anonymous-function, lambda-expression, closure, lambda-calculus, lisp, currying, higher-order-function, wikipedia

Closure

I’ve read this wikipedia page, that explains the concept of closures and the usual confusion between closure and lambda. Also some applications.

Discusses closures as a way of deferring execution and implementing object-oriented (OO) systems

Tags: wikipedia, closure, object-orientation, lambda-expression

Zen Story: The Master Archer

I’ve read this story by Charlie Ambler about perfectionism and deep study, exemplified by the general that retires to study archery and the child who draws targets around the arrows.

Tags: charlie-amber, master, student, zen, story

Loosely Coupled

I’ve read this article by Ben Whaley about how to loosely couple services introducing a queue and the difference in patterns between push and pull communication.

Tags: ben-whaley, push, pull, coupling, loose-coupling, service, queue, aws

Being good at programming competitions correlates negatively with being good on the job

I’ve watched the small video and the discussion about programmers' talent at this page. By Peteris Krumins.

The original video explains that being good at a programming contest correlates negatively with skill at a programming job, even if the company hires them.

The discussion explains the analogy with height and the NBA and concludes that this parameter should be preponderated with less importance than others.

Tags: google, peter-norvig, nba, analogy, programming-contest, programming-skill, peteris-krumins

On Functors

I’ve read this comparison by Peteris Krumins of what the functors are in different languages:

  • C++: function objects
  • Standard ML: generic implementation of interfaces. They allow to compose structures
  • Haskell: structure containing zero or more objects that can be converted to another structure containing the other objects. It’s an homomorphism between two categories.
  • Prolog: built-in predicate for self-inspection and the atom at the start of the structure

Tags: peteris-krumins, comparison, haskell, c-plus-plus, standard-ml, prolog, functor

Recursive Regular Expressions

I’ve read this article on recursive regular expressions by Peteris Krumins.

In it, he lightly describes how a regular expression relates to a Context-Free Grammar and the language support for Perl to include recursive regular expressions. Based on the examples (e.g., 0^n1^n), it really clicked to me that this could be expressed as a recursive function, with its base case and the recursive one. Also that it “depends on solutions to smaller instances of the same problem” (wikipedia)

Tags: peteris-krumins, regular-expression, recursion, recursive-regular-expression, perl, context-free-grammar, formal-language-theory

In Functional Programming, what is a functor?

I’ve read this answer, by Norman Ramsey, on what is a functor.

He explains in simple words what the concept is and how a type can belong to the class functor. Examples in haskell.

Tags: norman-ramsey, functor, stack-overflow, haskell, type-class, class, map, fmap

Functors

I’ve read this article by Jim Duey explaining functors in Clojure. He introduces a couple of notes of Haskell but all of the examples are in Clojure. Explains functors, a subset of it called applicatives, and the two libraries he has created.

Tags: jim-duey, functor, clojure, haskell

10 Tips for Proper Application Logging

I’ve read this article by Tomasz Nurkiewicz about tips on logging:

  • reduce side effects
  • use categories and levels
  • connection with external systems
  • handling exceptions
  • automatically / manually reading logging files

Tags: tomasz-nurkiewicz, logging, sl4j, log4j, tip

What is “duck typing”?

I’ve read this article by Eric Lippert about duck typing

Tags: duck-typing, eric-lippert, type-system, c-sharp

Yagni

I’ve reread this article by Martin Fowler on the cost of developing features that are not needed

Tags: martin-fowler, yagni, article, misunderstanding

Learn Haskell

I’ve seen this video by Jordan Medlock on learning haskell, explaining the basics and how to use the REPL

Tags: haskell, repl, jordan-medlock, beginner, video

Learn Haskell

I’ve seen this video by Jordan Medlock on learning haskell, explaining the basics and how to use the REPL

Tags: haskell, repl, jordan-medlock, beginner, video

TMUX - The Terminal Multiplexer

I’ve read these two parts: (one, two) of an introduction guide to tmux (the unix terminal multiplexer) by Cody from Hawk Host.

In it, he explains the basics of tmux and the main differences with screen

Tags: cody, hawk-host, tmux, how-to

Thermodynamics and Garbage Collection

I’ve read this paper by Henry G. Baker that explains the analogy of the garbage collection (“a freezer”) and thermodynamics, where the state mutator (th program, also an oven) modifies the garbage heap and introduces / extracts entropy into the system.

Comparison between entropy and lack of information, using the theories from Shannon, Maxwell-Boltzmann. There’s a reference to the knapsack problem and to simulated annealing.

There’s also a gentle introduction to thermodynamics in layman terms: heat, temperature, microstates, macrostates, reversability, etc.

In this paper it is also reflected (in macro vs micro states) that the sum all parts is simpler than the single ones (i.e., Information Hiding)

Tags: henry-baker, thermodynamics, microstate, macrostate, analogy, simulated-annealing, garbage-collection, shannon, information, maxwell-boltzmann, freezer, oven, entropy

How we ended up with microservices

I’ve read this article, by Phil Calçado, where he talks about his stay at SoundCloud:

  • the value stream map: from X days to Y
  • reorganizing teams into service teams
  • conway’s law and teams being responsible for support. Also, being given full authority

Tags: phil-calcado, soundcloud, microservice, team-split, value-stream-mapping, conversion, reorganization

Lisp is still a secret weapon

I’ve read this article by Judd Keppel where he explains it is a good idea that Clojure / ClojureScript continues to be a secret, not known among developers. Cites the article ‘Beating the averages’ by Paul Graham and the amount of available packages in npm, maven central, etc

Tags: paul-graham, judd-keppel, clojure, clojurescript, weapon, developer

Perceptron

I’ve read this wikipedia article that explains the single-layer and multi-layer perceptron. First designed to be a machine (hardware), but later an algorithm for supervised machine learning. Worked by Minsky & Papert and invented by Frank Rosenblatt in 1958.

Tags: peceptron, artificial-intelligence, machine-learning, frank-rosenblatt, 1958, marvin-minsky, seymour-papert

Is C# a strongly typed or a weakly typed language?

I’ve read this article, in the form of a dialogue between Eric Lippert and himself about the C# language and its type system.

Tags: type-system, c-sharp, eric-lippert, dialogue, strongly-typed, weakly-typed, language

Diseño por contratos: construyendo software confiable

I’ve read this paper that explains design by contract, based on the Hoare triplet, pre-post condition, method and class invariant. With examples in Eiffel, Java about a package sender company. Also explains pre/post with inheritance. By Gerardo Rossel and Andrea Manna. In Spanish.

Tags: gerardo-rossel, andrea-manna, design-by-contract, unam-mx, eiffel, java, precondition, postcondition, trust, quality, hoare-triplet, method-invariant, class-invariant

The Inevitable Return of COBOL

I’ve read this article that explains the current state of COBOL in programming and systems. Written by Ritika Trikha

Tags: ritika-trikha, cobol, programming-language, retirement, median-age

The Risky Eclipse of Statisticians

I’ve read this article where Ritika Trikha explains the current situation regarding Big Data and the statiscian jobs. How Big Data is in demand but the latter are not and what effects this might have.

Tags: ritika-trikha, bootcamp, programming, hiring, big-data, analysis, statistics

Give it five minutes

I’ve read this article by Jason Fried where he explains why we should give ideas time to sink in and marinate, before dismissing them. Ideas are so fragile that it is better to let them live for a while before dismissing them. This also applies for thoughts (other people’s or your own).

Tags: jason-fried, idea, think, startup, blue-hat, thinking-hat, six-thinking-hats, red-hat

Reading Clojure Stacktraces

I’ve read this article by Jay Fields on reading clojure stacktraces. Very similar to “Clojure Stack Traces for the Uninitiated”

Tags: jay-fields, clojure, stacktrace

Clojure Stack Traces for the Uninitiated

I’ve read this article on how to interpret clojure stacktraces. Written by Connor Mendenhall

Tags: connor-mendenhall, clojure, stacktrace

JavaScript type inference

I’ve found (and played) with this JavaScript type inference engine. Written in Javascript (and available online). Written by Dimitrios Vardoulakis.

Tags: javascript-type-inference, type-inference, type-inference-algorithm, dimitrios-vardoulakis, cfa2

Alternatives to boolean parameters

I’ve read this article explaining alternatives to sending a boolean parameter to decide on the contents of the function. Written by Dariusz Pasciak

As I heard some time ago, if a function receives a boolean to decide on what to do, it will for sure have more than one responsibility: one for the false value and one for the true value.

Tags: dariusz-pasciak, boolean, srp, boolean-parameter

Why Are Web Uploads So Painful?

I’ve read this article on web uploads being painful. By Jeff Atwood. The screenshots feel old (2007) and some of the problems have already been solved.

Tags: jeff-atwood, article, upload, browser

Can Your Team Pass The Elevator Test?

I’ve read this article on the elevator test by Jeff Atwood.

Tags: jeff-atwood, article, elevator-test, assumption, microsoft-bob, vision, product, feature