The long way through Software Craftsmanship

The language was prepared for that

Aug 10, 2015 - 2 minute read - Comments - clojurehaskelljavalanguage-comparisonprefix-notationoperatoroverloading

Many times I’ve written this function: public boolean between(int lowerBound, int n, int upperBound){ return lowerBound <= n && n <= upperBound; } It may depend on the case, whether it is [], [), (] or (), to use mathematical terms. When the two comparisons are the same ([] and ()), there is duplication in the comparisons. Investigating a little bit on this in clojure, I’ve found this function:

Recognizing dependencies

Aug 8, 2015 - 1 minute read - Comments - chapterpoodrsandi-metzrubydependencyobjectquote

From the Chapter 3, Managing Dependencies, from the book Practical Object-Oriented Design in Ruby, by Sandi Metz: An object has a dependency when it knows: The name of another class. […] The name of a message that it intends to send to someone other than self. […] The arguments that a message requires. […] The order of those arguments. […] If an object knows any of these facts about another object, it has dependencies to the other.

Multiple return values in a Mockito Stub

Aug 7, 2015 - 1 minute read - Comments - mockitotipstubjava

I’ve been asked today how to return multiple return values from a Mockito Spy, effectively using the spy as a Stub, as well. package com.example.spike; import static org.hamcrest.MatcherAssert.assertThat; import static; import static org.mockito.Mockito.spy; import static org.mockito.Mockito.when; import org.junit.Test; import org.mockito.Spy; public class DifferentReturnValues { @Spy private Spike1 spike1 = new Spike1(); @Test public void spike1() { spike1 = spy(spike1); when(spike1.getBool()).thenReturn(false, true); assertThat(spike1.getBool(), is(false)); assertThat(spike1.getBool(), is(true)); assertThat(spike1.getBool(), is(true)); assertThat(spike1.getBool(), is(true)); } private class Spike1 { public boolean getBool() { return true; } } } The key line is:

Brown-bag session and Dojo: Beginning Clojure

Aug 5, 2015 - 1 minute read - Comments - clientbrown-bag-sessiondojoclojurefacilitatorfacilitationclojure-for-java-developerreplguiderepository

At a client, today I’ve facilitated a brown-bag session introducing the Clojure language to a group of java programmers. I’ve started hands-on, live coding on a REPL. To make things easier, I’ve created a maven project that imports the clojure jar and lets you obtain dependencies from clojars. The repo is here. This repo wouldn’t have been possible without the clojure maven plugin, written by Mark Derricutt. I’ve more or less followed this guide

Resources for Java 9 (beta)

Aug 3, 2015 - 1 minute read - Comments - java-9resourcerepltutorial

I’ve found this list of links for Java 9, while in beta, useful: Contents of the new version Java REPL workshop, with useful commands and questions & answers for installing the REPL REPL tutorial PDF Another getting started guide, by JClarity Yet another getting started guide, by Arun Gupta Information on the REPL project, (codenamed Kulla)

Self-Study in August 2015

Aug 2, 2015 - 12 minute read - Comments - 200720142015absence-of-bugsadvicealejandro-marcuanalysisanders-janmyrandraz-bajtarrayarticleaugustautobiographyawsbackground-mindblogbookbounded-contextbrett-wooldridgebroadcastby-examplebytecodecareercareer-changecarlos-blecarlos-villuendascheatsheetchristopher-maierclientclojureclojurescriptcmscompanycomparisoncompilercompletable-futurecompojurecomputer-scienceconcurrencyconsultancyconsultingcontinuous-deploymentcraig-larmandan-grossmandaniel-whittakerdatadave-ellimanddddesigndevopsdijkstraecuadoredoficedsger-dijkstraeric-normanderin-swenson-healeyessayewdexhaustive-testingexperience-samplingfeedbackffifixfizzbuzzflowframeworkfregefrungykingfunctorfuturegeorge-polyagerard-meszarosghcgistgithubgithub-pagesgoogle-developersguidehakyllhammock-driven-developmenthaskellhastehistory-of-programming-languages-conferencehotspothow-tohumble-programmerhypothesisihinfographicinformation-hidinginlineintroductionjaelle-scheuermanjames-cooperjan-stepienjava-8javascriptjeff-atwoodjoe-nelsonjoel-kaasinenjoey-hessjohn-cheejoseph-grennyjoy-of-clojurejustjustin-leitgebjustin-perryjvmkatakathy-phamkerodonlambdalambda-dayslatin-squarelazy-evaluationlearninglein-fregeclessonlightning-talklink-shortenerlisplong-waylovemacromanagementmanchestermaybemetametaprogrammingmicroservicemigrationmihaly-csikszentmihalyimonad-readermoocmooc-programming-languagesnamespacenate-wildermuthnear-exhaustive-testingnebojsa-stricevicnegative-feedbackneil-brownnietzschenon-blockingnon-strictnessnothingobjective-cocpopen-closedprincipleoptimizationoptionoptionalosconparallelismpassionpatternpaul-grahamperfectionismperformancephilosophyphppragmatic-programmerpreprocessorprivate-functionprivate-variableprofessionalprogrammingproject-managerprologprotected-variationpvquantificationquasi-quoterquotereactive-programmingreadreadingreplrereadrestrich-hickeyrobert-c-martinrobert-mandlroman-numeralrubyruby-on-railsrustryan-trinklesandro-mancusosantiago-valdarramascreencastsean-corfieldself-study-aggregationsharingsimon-peyton-jonessimonmarsimplicityslidesnapsocial-mediasolve-problemstack-buildersstrange-looptalktddtechnical-debttestingthoreauthoughtworkstime-lapsetomasz-nurkiewicztravis-ciubiquitous-languageuku-tahtvideowaking-mindweb-developmentweb-frameworkwebappwrite-onlywrocloverb

Humble Object I’ve read the Humble Object list of patterns, by Gerard Meszaros, including: humble dialog humble executable humble transaction controller humble container adapter Tags: pattern, gerard-meszaros How you know I’ve reread this small essay by Paul Graham on storing information in our heads, based on the context. On the importance of rereading, to add more contexts to the initial one. Tags: paul-graham, reread, read Protected Variation: The Importance of Being Closed I’ve read this article by Craig Larman in the magazine IEEE Software > Design.