Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e42b7e5

Browse files
author
Adam Parkin
committed
Migrate old blogspot posts
1 parent ae48b7a commit e42b7e5

11 files changed

+546
-0
lines changed

content/book-review-clean-coder.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
Title: Book Review - The Clean Coder
2+
Date: 2014-01-20 09:07
3+
tags: bookreview,professionalism,quality
4+
5+
# Book: The Clean Coder - A Code of Conduct For Professional Programmers
6+
7+
*Authors:* "Uncle" Bob Martin
8+
9+
*Publisher:* Prentice Hall
10+
11+
*Pages Read:* all
12+
13+
*Sections:* all
14+
15+
*Thumbs up/Thumbs Down?* Up
16+
17+
*Link:* [Amazon](http://www.amazon.ca/Clean-Coder-Conduct-Professional-Programmers/dp/0137081073/ref=sr_1_1?ie=UTF8&qid=1390237049&sr=8-1&keywords=the+clean+coder)
18+
19+
## Summary of Content Read
20+
21+
This book is largely a follow-up to Martin's other very well known book
22+
[Clean Code](https://www.amazon.ca/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882/ref=pd_bxgy_14_img_2?_encoding=UTF8&psc=1&refRID=3SXJ498BQX424TCE3F4M)
23+
. Whereas that book focuses on the artifacts (code) we developers produce this book focuses on the developer
24+
his/herself. How should we as professional developers act? What is the difference between a commitment and estimate?
25+
What are our responsibilities? When can we say no & how do we do it? When are we obligated to say yes? How do we get
26+
better at what we do?
27+
28+
Martin tries to distill his nearly 40 years of experience into some hard fought lessons. While it is very much
29+
appreciated to hear "tales from the trenches", the book does have a fairly heavy-handed "do as I say" tone. Don't do
30+
TDD? Well then you're not a professional. Do you create ambitious estimates? Well then, you're not a professional.
31+
From a rhetorical point of view, the book does rely on this "proof by appeal to professionalism" approach, rather than
32+
give solid evidence and data to back up many of the arguments he makes. For example, the TDD chapter has the passage:
33+
34+
> Yes there have been lots of controversial blogs and articles written about TDD over the years and there still are.
35+
In the early days they were serious attempts at critique and understanding. Nowadays, however, they are just rants.
36+
The bottom line is that TDD works, and everybody needs to get over it.
37+
38+
I feel like the paragraph should have ended with
39+
"QED". Hardly a conclusive argument in favour of TDD, and the off-hand dismissal of any critiques of the practice
40+
really does hurt the point he's making.
41+
42+
Having said all this, it is certainly clear that much of what he offers is good advice, and represents an open challenge
43+
to developers to be better. If you put aside the "if you don't do this you're not professional" rhetoric, at its core
44+
this book is a call for developers to live up to the responsibility of the job they have been hired to do. Oftentimes
45+
we as developers like to silo ourselves off, focus on our narrowly defined technical tasks, and that is simply
46+
unrealistic. Part of the responsibility of being a developer is to understand the context of the work you do, why it's
47+
important and why it adds value to the customer/client/business/etc. And if that value isn't there, it's up to you to
48+
find it.
49+
50+
As such I found this book both refreshing and terrifying. Refreshing to hear a voice from the agile community who
51+
doesn't seem to feel that the PO is the only entity responsible for identifying value. Terrifying to think that I, as
52+
an introverted software developer, has a duty to do more than just simply write good, clean code.
53+
54+
In terms of structure, the book is divided into 14 different chapters each covering a topic of interest to professional
55+
developers. While there is some technical discussion, it is relatively rare, by in large the chapter topics focus on
56+
"soft" skills rather than technical ones.
57+
58+
All-in-all, while heavy-handed and at times "preachy", it is very much a worthwhile read for anyone considering or
59+
living a career in software development.
60+
61+
(Note: this post originally appeared on my blogspot blog at: <http://codependentcodr.blogspot.ca/2014/01/book-review-clean-coder.html>)

content/book-review-java-puzzlers.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
Title: Book Review: Java Puzzlers
2+
Date: 2014-01-20 09:07
3+
tags: bookreview,java
4+
5+
# Book: Java Puzzlers
6+
7+
*Authors:* Joshua Bloch and Neal Gafter
8+
9+
*Publisher:* Addison Wesley
10+
11+
*Pages Read:* all
12+
13+
*Sections:* all
14+
15+
*Thumbs up/Thumbs Down?* Up, slightly sideways
16+
17+
*Link:* [Amazon](http://www.amazon.ca/JavaTM-Puzzlers-Traps-Pitfalls-Corner-ebook/dp/B001U5VJVS/ref=sr_1_1?ie=UTF8&qid=1390237560&sr=8-1&keywords=java+puzzlers)
18+
19+
## Summary of Content Read
20+
21+
Java Puzzlers is not so much a book, but a collection of obscure corner cases in the Java programming language. The
22+
author (Joshua Bloch) is well known as the author of [Effective Java](http://www.amazon.ca/Effective-Java-2nd-Edition-Programming-ebook/dp/B000WJOUPA/ref=pd_sim_kinc_2)
23+
which is widely regarded as the premier text for the language, and furthermore he is one the designers and authors of
24+
the Java Collections Framework. So to say the least, he knows his stuff.
25+
26+
Each chapter of the book features a collection of "puzzlers" centered around a particular section of the language
27+
(examples include loops, strings, exceptions, classes, etc). Each "puzzler" is formulated where a puzzle (typically in
28+
the form of a code snippet) is given, and the reader is encouraged to try and predict what the output will be, or why
29+
the code is incorrect. Then an answer/explanation of the puzzler is given. All-in-all there are 95 different puzzlers
30+
across the book, and they range from the fairly common "if you thought about it a bit you'd figure it out" to the
31+
extremely obscure "unless you were a Java language designer you'd never have any hope of figuring this out". The
32+
explanations also often include commentary to language designers (ex: "the lesson for language designers here is...").
33+
34+
From an academic "curiosity" point of view the book is quite intriguing. As a fairly experienced Java developer I found
35+
myself surprised with the vast majority of the puzzlers. The programming languages guy in me found this fascinating
36+
(ex: wait, so you can have Unicode literals in comments, and those literals are interpreted by the compiler?).
37+
38+
Having said that, the book does reach a point where the puzzles and concepts hit upon by the puzzles are extremely
39+
obscure. For a typical Java developer you'll almost never run into most of the tidbits in this book. That's not to say
40+
that reading it isn't useful, you'll definitely learn a bit about the book, but if you're looking to learn "how to write
41+
good Java code" this is not the book for you (again, see Bloch's other book for that).
42+
43+
(Note: this post originally appeared on my blogspot blog at: <http://codependentcodr.blogspot.ca/2014/01/book-java-puzzlers-authors-joshua-bloch.html>)
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
Title: Book Review: The Software Craftsman
2+
Date: 2015-02-03 20:58
3+
tags: bookreview,craftsmanship,quality,tdd
4+
5+
# Book: The Software Craftsman
6+
7+
![Book Cover - The Software Craftsman](http://ecx.images-amazon.com/images/I/51gqht7qN8L._AA324_PIkin4,BottomRight,-38,22_AA346_SH20_OU15_.jpg)
8+
9+
*Author(s):* Sandro Mancuso
10+
11+
*Publisher:* Prentice Hall; 1 edition (Dec 14 2014)
12+
13+
*Pages/Sections Read:* All, cover to cover
14+
15+
*Thumbs up/Thumbs down:* Thumbs Down
16+
17+
*Link(s):* [Amazon](http://www.amazon.ca/The-Software-Craftsman-Professionalism-Pragmatism/dp/0134052501), [Author's Twitter](https://twitter.com/sandromancuso)
18+
19+
## Summary Of Content Read
20+
21+
This book frustrated me. I once had the fortune of seeing Sandro give a talk at the Software Craftsmanship North America
22+
(SCNA) conference in 2013, and found his talk uplifting, and inspirational. As a result of that, when I saw this book
23+
had been released it was an "instant buy" for me.
24+
25+
Ultimately though I was incredibly disappointed by this book.
26+
27+
I wanted to like this book. Rather I wanted to love this book. And honestly, much of what Sandro espouses in this book
28+
I agree with and believe. But, this book is poorly written and filled with anecdotal "evidence" to support his claims.
29+
This is a shame, as there is much well documented, well-researched evidence to support much of what he argues for. See,
30+
the thing is when you make empirical claims (ie - if you do TDD you will reduce bugs and therefore reduce costs, or if
31+
you pair with other developers you will create a culture of learning which will improve productivity, or if you hire
32+
craftsmen your company will be better off), you need to back that up with empirical evidence, not just "I had this job
33+
once where we did this & it worked...".
34+
35+
By in large if you've ever followed the software craftsmanship community, you'll have heard everything that you'll read
36+
in this book. TDD is great so it's an encouraged practice, but we don't hold practices in a dogmatic way. Pragmatism is
37+
key. You can't be a great developer without being passionate. Commit yourself to lifelong learning. The craftsmanship
38+
movement is about raising the bar. On and on and on, it's all the standard tropes you hear in conversations about
39+
software craftsmanship. I went into this book expecting to see something new, or some deep insights, instead I got a
40+
series of blog posts that felt very much like preaching to the choir.
41+
42+
There's also lots of heavy-handed "preachyness" in this book. Lots of defamatory comments towards managers, agile
43+
coaches, and architects (though back-pedalled in the appendix), and lots of "if you don't do this, then you're doing it
44+
wrong" type rhetoric, which I found surprising. The craftsmanship community is supposed to be about celebrating diversity
45+
and being welcoming of anyone, of any skill level so long as they're willing to better themselves and learn more.
46+
47+
There's also lots of inflammatory/adversarial commentary (ex: "QA teams are an anti-pattern", "are you good enough to
48+
work on legacy code?", "tech debt items are an excuse to justify bad code", "software craftsmen are never scared to
49+
lose their jobs", "only incompetent people fear losing their jobs", "university degrees don't mean anything", etc) that
50+
feels very elitist & arrogant. Lots of straw man commentary, painting conversations with Dilbert-esque pointy-haired
51+
bosses in a very biased light.
52+
53+
Lots of sweeping generalizations, and little in the way of new insights. There's a lack of focus or coherent theme to
54+
the book. Who is this for? Is it for "apprentice" craftsmen? For people who've heard about this software craftsmanship
55+
thing and want to know more? For the Bob Martin's of the world? It's so inconsistent, some of it feels written for an
56+
audience who's only vaguely familiar with the craftsmanship movement, and other parts feel like unless you've been
57+
writing code for decades you'll have trouble relating.
58+
59+
I'm being overly harsh, there are nuggets of really good insights in this book and he certainly knows the craftsmanship
60+
movement. The thing is though there's nothing you won't get from simply reading the blogs or books of some of the people
61+
in the craftsmanship community. If you've read Clean Coder by Bob Martin, there's no reason to read this book.
62+
63+
(Note: this post originally appeared on my blogspot blog at: <http://codependentcodr.blogspot.ca/2015/02/book-review-software-craftsman.html>)

content/embracing-change.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
Title: Embracing Change
2+
Date: 2015-03-01 22:04
3+
tags: agile
4+
5+
I recently listened to a recording of a webinar put on through the ACM titled
6+
["Agile Methods: Agile Methods: The Good, the Hype and the Ugly"](https://event.on24.com/eventRegistration/EventLobbyServlet?target=reg20.jsp&eventid=937091&sessionid=1&key=5B3C11566E06BE6564E638C6DFE0F413&sourcepage=register)
7+
where Bertrand Meyer (the Eiffel/Design by Contract guy) gave his interpretation of the agile software movement, and how
8+
we may tweak agile thinking.
9+
10+
A point in particular caught my attention. He talked about a rephrasing of some of the agile principles as stated in
11+
the manifesto, and in particular he talked about rather than "embracing" change, one should "accept" change. While this
12+
might seem like splitting hairs, I think it an important distinction, and one I completely disagree with. I'd like to
13+
elaborate why I feel the distinction matters.
14+
15+
The rationale behind Meyer's thinking was that nobody is happy when they have to throw away work. Say you built a fancy
16+
front end for a payment system and then after weeks of development the customer says "nope, that's not what I want" and
17+
you have to throw it away. You're obviously not going to be happy about that, but given the customer pays the bills
18+
(and as such your salary), you have to just roll with that punch and start over. As such, Meyer paints this picture of
19+
the developer who begrudgingly throws away his/her pristine work, all the while muttering under his/her breath about how
20+
the customer can't make up their mind and resenting the indecision.
21+
22+
I agree with this in principle (I don't like to waste my time), but it fundamentally misses the point of not only the
23+
agile philosophy, but of modern professional software development. As a developer, I don't want to build things for the
24+
sake of building things, I want to build things that solve problems. In particular, I want to build things that provide
25+
value to a user (ideally a user who will pay for such services, but the monetary unpleasantries I tend to leave to the
26+
business folk).
27+
28+
That is, if what I'm building isn't what the customer wants, I don't want to build it.
29+
30+
This is important. I'm a craftsman, so I very much care about, and put my entire energy into writing the best code I
31+
can, building the best systems I can, but I fully recognize that none of the stuff that goes into that "quality"
32+
equation matters if you're building the wrong thing. As much as I love development, it's value is instrumental, not
33+
intrinsic. If the stuff I create never gets used, then it doesn't matter how good it is.
34+
35+
With this in mind, hell yes, I embrace change. When a customer gives feedback and says "that's not quite what I want"
36+
it's music to my ears because it means I'm now that much closer to building the right thing.
37+
38+
So yeah, don't just accept change, embrace it. Wrap it around you like a warm blanket, secure in the knowledge that
39+
because of that change you're now even closer to building something truly amazing that will change people's lives.
40+
41+
(Note: this post originally appeared on my blogspot blog at: <http://codependentcodr.blogspot.ca/2015/03/embracing-change.html>)

content/git-bisect-and-nose.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
Title: Git bisect And Nose -- Or how to find out who to blame for breaking the build.
2+
Date: 2012-08-03 09:19
3+
tags: git,nose,python,testing
4+
5+
How did I not ever discover `git bisect` before today? Git bisect allows you to identify a particular commit which
6+
breaks a build, even after development has continued past that commit. So for example, say you:
7+
8+
<!-- markdownlint-disable MD013 -->
9+
10+
* Commit some code which (unknowing to you) happens to break the build
11+
* You then (not realizing things have gone sideways) continue on doing commits on stuff you're working on
12+
* You then are about to push your code up to a remote master, so you finally run all those unit tests and realize you broke the build somewhere, but you don't know which commit introduced the problem
13+
14+
<!-- markdownlint-enable MD013 -->
15+
16+
In a typical environment you'd now have a fun period of checking out a previous revision, running the tests, seeing if
17+
that was the commit that broke the build, and continue doing so until you identified the commit that introduced the
18+
failure. I have experienced this many many times and it is the complete opposite of fun.
19+
20+
If you were smart you might recognize that a binary search would be effective here. That is, if you know commit (A) is
21+
bad, and commit (B) is good, and there's 10 commits in-between (A) and (B) then you'd checkout the one halfway between
22+
the two, check for the failure, and in doing so eliminate half the possibilities (rather than trying all 10 in succession).
23+
24+
And if you were really smart you'd know that this is exactly what `git bisect` does. You tell git bisect which commit
25+
you know is good, and which commit you know is bad, then it steps you through the process of stepping through the
26+
commits in-between to identify which commit introduced the failure.
27+
28+
But wait, there's more! There's also a lesser-known option to `git bisect`. If you do a
29+
"`git bisect run <somecommand>`" then the process becomes completely automated. What happens is git runs
30+
`<somecommand>` at each iteration of the bisection, and if the command returns error code 0 it marks that commit as
31+
"good", and if it returns non-zero it marks it as "bad", and then continues the search with no human interaction whatsoever.
32+
33+
How cool is that?
34+
35+
So then the trick becomes "what's the command to use for `<somecommand>`?" Obviously this is project dependent
36+
(probably whatever command you use to run your unit tests), but for those of us who are sane Python devs we probably use
37+
[Nose](https://github.com/nose-devs/nose) to run our tests. As an example, I often organize my code as follows:
38+
39+
```shell
40+
project/
41+
+--- src/
42+
+--- module1/
43+
+--- module2/
44+
+--- test/
45+
```
46+
47+
Where "module1" contains code for a module, "module2" contains code for another module, and "test" contains my unit
48+
tests. Nose is smart enough that if you tell it to start at "src" it will search all subdirectories for tests and then
49+
run them. So lets say we know that commit `022ca08` was "bad" (ie the first commit we noticed the problem in) and
50+
commit `"`0b52f0c` was good (it doesn't contain the problem). We could then do:
51+
52+
```shell
53+
git bisect start 022ca08 0b52f0c --
54+
git bisect run nosetests -w src
55+
```
56+
57+
Then go grab a coffee, come back in a few minutes (assuming your tests don't take forever to run), and git will have
58+
identified the commit between `0b52f0c` and `022ca08` that introduced the failure. Note that we have to run `git bisect`
59+
from the top of the source tree (in my example the "project" directory) hence we need to tell `nosetests` to look in
60+
src via the `-w` parameter.

content/jtotd-equalsverifier.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Title: Java Tip of the Day - EqualsVerifier
2+
Date: 2013-11-01 11:11
3+
tags: jtotd,javaTipOfTheDay,testing
4+
5+
This looks more than a little cool for those of us (like me) who are pedantic about testing out
6+
`equals`/`hashcode`/`compareTo` methods:
7+
8+
<http://www.jqno.nl/equalsverifier/>
9+
10+
(Note: this post originally appeared on my blogspot blog at: <http://codependentcodr.blogspot.ca/2013/11/equalsverifier.html>)

0 commit comments

Comments
 (0)