Sunday, December 23, 2012

Worktime music

Awesome acoustic Metallica covers

Thursday, December 20, 2012

Doomsday JetBrains discounts

Hurry up - crazy discounts from JetBrains - up to 75% off. Sale will last for 20 hours (counting from 10:00 am EST)

ReSharper - $50 (regular - $199)
dotCover - $25 (regular - $99)
dotTrace - $75 (regular - $299)
RubyMine - $17 (regular - $69)
IntelliJidea - $50 (regular – $199)

Even if the world will end tomorrow, it is still a great bargain, - you won't need money in the post-apocalyptic world anyway. If you pay for these licenses with credit card  then your cash will still be available for food, water and ammo supplies :)

And I went for this - sweet price!

Monday, December 10, 2012

Global Code Retreat Day 2012

Couldn't just miss it - and the event was awesome. It surprises me every time that the practice which doesn't really sound impressive ends up to be a lot of fun and insight. And a spark and an inspiration and interesting people.
I was looking for helpful tips to run my own corporate session and wasn't disappointed. My biggest take-out is a concept of the "ping-pong round" when pair of developers are writing one test each and just enough code to make the test pass. It quickly becomes a "competitive ping-pong" as soon as your test misses some corner or null case and revenge follows with another failing tests. This simple, simple technique forces adoption of TDD in an unobtrusive way and eventually results in a better code. The difficult part is to write the very first test - and helpful advice was "just create a REALLY simple one - like collection has length greater than zero". And from there it went.
The activities used the usual "Conway Game of Life" although I would really like to find similarly interesting and intuitive problem - just to keep my corporate audience interested for the next time...

Sunday, December 02, 2012

Introverted Programming: Agile by name, Not So Much by reputation.

Shagwell by name, shag very well by reputation
Witnessing quite a few project within past two years I am still surprised how world differs from what is declared and discussed inside the community walls.
Agile and its incarnations are vary rarely a weapon of choice. Even projects declared as “agile” only adopt superficial practices. Projects routinely planned and executed the same “proved” way and routinely spill over time and budgets. Project Manager's most daring task is to successfully invent excuses manage client’s expectations when “it” hits the fan. Iterations do not exist or their length is arbitrary and inconsistent: one of the projects I observed had two iterations – four months and one month. Retrospective meetings, even if held (rarely), have zero value as no statistic data is being gathered or it is irrelevant. Everybody had their own idea of what went well in iteration and what did not (and kept this thoughts to themselves). In some projects Agile was understood as a roam-naked-and-free environment - no documentation, no plan, just build-as-we-go. *
There is no software project manager in existence who hasn’t heard about the agile methodology, yet just 11 years since declaration of independence agile manifesto was signed and it is already old news for vast majority of IT folk.
We seem to not learn anything from the hardware revolutions. Who could believe that ugly smelly noisy tin cans could replace centuries-proven horses as a main meaning of transportation? Internal combustion engines have existed for almost 80 years before been attached to a real self-propelled carriage and it took another 20 years for an automobile to make it to the mass-production. Assuming that life has accelerated tenfold since then, we should have seen our Henry Ford for Agile mass-production already.
Let’s face it - it’s hopeless.

 * Disclaimer:  Any resemblance to actual events or locales or projects, living or dead, is entirely coincidental. The fictional projects in description were stumbled upon during my contracting years and user group discussions. Some of them got better with time.

Friday, October 05, 2012

Necessary and sufficient condition: The Friend

To consider the person a friend it is necessary and sufficient to:

1. Know the person
2. Like the person.
3. Trust the person.

Axiom 1. Condition #1 has to be mutual. Otherwise you are probably a stalker.
Axiom 2. Condition #2 may be one-way. In the worst case the friendship is non-reciprocative.
Axiom 3. Condition #3 may be one-way. In the worst case you can still cry drunkenly on his shoulder but don't expect a honest advise.

Without #1 Warren Buffett could be your friend.
Without #2 your CRA agent could be your friend.
Without #3 your favourite lap dancer can be your friend.

Wednesday, September 12, 2012

Meanwhile at Apple...

Friday, July 13, 2012

HTML5: What are we waiting for?

HTML5 final specification is scheduled to arrive in 2022. It is expected that W3 Consortium can come up with a core feature cut by 2014.
All this is not really important for cool kids freelance or startup developers who usually selecting emerging platforms for production application long before than clients will be absolutely comfortable with that.
But should enterprise developers and architects be waiting? Form my experience it is not a question of personal confidence or courage but rather ability to sell the technology up to the management and down to the business. In HTML5 case there is not yet much reliable (hence: mentionable in "CEO Magazine" or "CTO Weekly") arguments to help the big-corp-dwelling technology pioneers push the idea. I came across a Gartner Inc.'s "HTML5 and the Journey to the Modern Web" review and I know that the Big Guys trust Gartner reviews (and favour Gartner Magic Quadrants in sales and vision presentations).
And in short words the review says "Yes, we can":
- Pieces of HTML5 are available now and usable, with the WebKit be the de-facto standard to strive for (sorry, Internet Explorer and Firefox kind of fall out).
- While HTML5 and its specification evolve it is wise to rely on frameworks and toolkits with the highest community support rather than using new APIs directly.

Tuesday, June 26, 2012

The Hitchhiker's Guide to the Work Lifecycle

Time into the job:

The Agile Architect

An interesting article Who should be the architect in an agile project? made me think of summarizing the necessary and sufficient qualities of the architect suitable for the Agile jungles. As the
So far it looks like it should be the guy/gal who is:
1. Excitable enough to run along with the team recklessly avoiding architectural decisions.
2. Experienced enough to determine the moment when it's time to stop and make the decision.
3. Knowledgeable enough to steer the discussion towards better decisions.
5. Laid-back enough to accept decisions which may slightly differentiate from his/her personal choice.
6. Tedious enough to keep an eye on the dynamics of the technical debt

Saturday, April 21, 2012

Worktime music: the high-tech device

If you interested in mastering this captivating art – there is a comprehensive training video at your service:

Wednesday, April 18, 2012

Unit testing legacy code the lazy way

When it comes to maintaining or expanding a legacy code, it is no surprize that we often find ourselves struggling with a mess of magically changing global variables, 1000-lines long methods, which do hundred different things inside and keep all logic to itself. Sometimes changed requirement or just popped production bug demand a limited incision – and often you afraid to touch the fragile masses of code around you and just try to minimize the potential impact and hope for the best.
More often than not method you need to change was developed in unenlightened age, when people used computers made of wood did not concern themselves with principles of cohesion or separation of concerns or thoughts about testability. It is hopelessly long and complex and business functionality is mixed with calls to database or services. Testing such a method is a dreadful task, which easily can eat a lot of time and bring the wrath of management on your head. But it still is no excuse to leave this code without any test coverage – so try to cover at least functionality which you are adding or even affecting. There are tricks you can use to test the legacy code fore cheap and with little overhead, quickly getting to the important logic testing. Let’s consider the following (greatly simplified) legacy method.

public bool ProcessEligibility(Person person)
    // Some functionality which we leave outside of our testing
    // A bunch of business logic which we would like to test
    bool result = CallDB(new ConnectionManager(), person.Age, person.Position);
    //Another bunch of business logic which we would like to test
    ServiceResponse response = RequestService("", person);
    return response.IsSuccessful;
It contains some logic which we would like to test, but also two calls to the complex methods, on of which hits database – CallDB and another, which calls outside service – RequestService. Those we would like to keep aside and maybe test them in separation, if time permits.
Let’s use Template Method derivative to minimize our testing efforts. Our goal is convert undesired method to dependencies which can be injected to improve testability.
First, let’s refactor the functionality, which we will test, out to a protected method:
public bool ProcessEligibility(Person person)
    // Some functionality which we leave outside of our testing
    return ProcessEligibilityConcrete(person);

protected bool ProcessEligibilityConcrete(Person person)
    // A bunch of business logic which we would like to test
    bool result = CallDB(new ConnectionManager(), person.Age, person.Position);
    //Another bunch of business logic which we would like to test
    ServiceResponse response = RequestService("", person);
    return response.IsSuccessful;
Next we lay a foundation for our methods to be extracted as a parameters. We can use a Func<T1, T2, TOutput> type to describe functions in our specific case, but unfortunately Func delegate allows maximum three input parameters while old-fashioned methods can accept 10 or more! In this case we have to create a delegate type ourselves:
public delegate TOutput HyperFunc<T1, T2, TOutput>(T1 input1, T2 input2);
Now let’s refactor the main and sub-methods further, injecting methods as dependencies (let’s describe one as a Func<T1, T2, TOutput> and another as a custom delegate):
public bool ProcessEligibility(Person person)
    // Some functionality which we leave outside of our testing
    return ProcessEligibilityConcrete(person, CallDB, RequestService);

protected bool ProcessEligibilityConcrete(Person person, 
    Func<ConnectionManager,int,string,bool> dbCaller,
    HyperFunc<string,Person,ServiceResponse> serviceCaller)
    // A bunch of business logic which we would like to test
    bool result = dbCaller(new ConnectionManager(), person.Age, person.Position);
    //Another bunch of business logic which we would like to test
    ServiceResponse response = serviceCaller("", person);
    return response.IsSuccessful;

public delegate TOutput HyperFunc<T1, T2, TOutput>(T1 input1, T2 input2);
Now we can test the ProcessEligibilityConcrete method in isolation, providing our own mock or stub methods as substitution:
public void TestEligibility()
    var result = ProcessEligibilityConcrete(new Person(), fakeDbCaller, fakeServiceCaller);
I said at the beginning that we got this test coverage for cheap. It is not quite true: we paid with adding redundancy and some obscurity to the original code. We performed some refactoring but we clogged the final result a bit, reducing code readability, although all refactorings were safe, especially if you used tools like Resharper.
To do it right, we should do a real refactoring and use mocking or other more sophisticated techniques. But between Fast, Good and Cheap we can pick only any two and weight out our trade-offs.

Sunday, March 18, 2012

Funny job scams

I have plans to visit friends on Aruba this summer and usually wherever I go I check Internet for the area’s IT background - user groups, interesting IT events and job postings. I am yet to discover and attend a meeting somewhere exotic but job postings are always fun – and Arubian weren’t a disappointment. Look at this top three list:

D… Consulting Limited., Lagos, Nigeria. We require reputable persons having prime experience and capable of providing Information Technology and others Service (as individuals or in a team). Salary indication (individual) – US $15,000 – 20,000 per month. All relevant information/ notification / CV/ Resume should be forwarded via word document attachment to the below email as follows for immediate consideration.

Kind of disappointing that position does not promise an adoption into a royal family..

Hardy Oil and Gas PLC, Korūna, Pakistan requires the services of reputable and devoted workers for the under listed job positions. Qualified persons should contact us immediately for job placement. Application process-please send us your documents by email: 1). Resume 2). Recent photo 3). Passport Copy. Email:

The list includes 20 professions, from cooks and cleaners to language teachers, nurses and Internet experts (probably to move the oil company corporate mail system out of yahoo). Surprisingly drill masters or geologists are not required. The Hardy Oil and Gas actually exists, registered in Great Britain and of course owns first-level “com” and “in” domains.

The last one is the only which looks legitimate (no word “reputable” in the description) – and I totally see Paul Rudd in this role:

The C… Hotel urgently needs the services of devoted and hardworking workers, who are ready to work after undergoing enlistment training: INTERNET SERVICE EXPERT,COMPUTER OPERATOR,CAFÉ MANAGER

Now this is a dream IT job – computers and coffee!

Saturday, March 17, 2012

Worktime music

Friday, March 16, 2012

Working Effectively with Legacy Code by Michael Feathers

Nice classic book, which I glanced through long time ago, but dealing extensively with 9-year old code base made reading it again much more insightful.
A lot of useful patterns to break down nasty 600 lines methods and copy-pasted classes. Java examples will not stop C# developers from fully understanding the ideas but C++ examples are not that easy to grasp – in my opinion most of the techniques deal with limitations of the language and patterns so they don’t seem that universal.

Saturday, March 03, 2012

KnockoutJS validation (and more)

If earn money doing web development and haven’t yet heard of KnockoutJS – you should probably find out sooner than later. It’s a powerful and yet surprisingly intuitive MVVM framework implemented in pure Java Script (meaning - it will work in any browser!). The author’s is a good place to start and when you are ready for a deeper dive – check the
While building my first form with Knockout, which quickly got over-engineered beyond the concepts described in the documentation, I found that the ability to add some validation or allow user to confirm the action is sorely missed. gave me a good start in a right direction and I ended up with this observable:

ko.smartObservable = function (initialValue, functions) {
var _temp = initialValue;
var _value = ko.observable(initialValue);

var result = ko.computed({
read: function () { return _value(); },
write: function (newValue) {
var shouldUpdate = true;
_temp = newValue;
if (functions) {
for (var i = 0; i < functions.length; i++) {
if (shouldUpdate && typeof (functions[i]) == "function")
shouldUpdate = functions[i](newValue, this.parent);
if (!shouldUpdate) break;
if (shouldUpdate) {
if (_temp !== _value()) _value(_temp);
else {
_temp = _value();
return result;

You need to supply an optional list of functions, each accepting a single value parameter and returning true or false, and the observable will execute them one after another until the list is over or until one of the functions returns false.

This is a working code (the example is based on a simple tutorial model):

This observable works perfectly with a brilliant Matthew Schnikel’s dirty flag extender – combined together they will arm you with really powerful input fields.

But the best thing about KnockoutJS is that it made me rethink my disposition towards Java Script. How Melvin Udall would put it:


Monday, January 02, 2012

Worktime music: as IT as it gets


also check Feed Burner

© 2008-2013 Michael Goldobin. All rights reserved