• Coding Software Engineering

    Lean vs. Agile

    There is a heated up debate going on among software development professionals about what is the difference between Agile and Lean software development? Are they rooted in the same principle or is there something fundamentally different between the two methods?

    James O. Coplien explains the difference:

    At PHZ.fi we are embracing both the methodologies, in particular Extreme Programming by the book, and eliminating the waste by reflecting on Kanban, Total Quality Management, Six Sigma and Shigeo Shingo’s Zero Quality Control.

    Published by:
  • Coding

    private considered harmful

    Time after time I explain to the other coders that private visibility is harmful, 95% of coders tend to try rock hard claim otherwise. Unfortunately private is a harmful visibility level to use.

    Personally I haven’t yet found any legitimate use case for private -visibility, but the opposite. Quote from the documentation of a unit testing framework:

    Limitation: final, private, and static methods
    Please note that final, private and static methods cannot be stubbed or mocked.

    Using protected visibility instead of private by default has the advantage of leaving the opportunity for the future developers open to reuse and extend your code. Using private denies this opportunity and forces rewrite of your code. For test classes using protected is however clumsy, since you need to create a subclass to be able to mock or stub the methods or properties you want. Using dependency injection would be a better idea.

    PHZ.fi has been conducting a range of code reviews for half a dozen large softwares with 150-600k lines of code. My surprising observation has been that in all the cases the code has been consisting 80% of public methods. The real life outcome thus seems to be that coders don’t really use encapsulation so often and limiting the visibility on class level is less common than using hidden interfaces (e.g. private). Of course a function is also an interface for encapsulation, and thus the one can also deduct that the coders are mostly hiding the implementation details inside one or only a few public methods rather than using large number of private methods.

    In Java my best practice is to define all non-public properties and methods on package -visibility, meaning that there is no public, protected or private. If you place your test class in the same package, you can easily access also the non-public the methods or properties and for most of the time you don’t even need DI configurations.

    Published by:
  • Coding Company Frontend Start-up

    Responsive Image Cache features Liquid Rescale

    Our Aalto University open source student project RIC developing a Responsive Image Cache system by using the Go language has released a couple of very cool features.


    The project idea is to offer the ultimate solution for web responsiveness for the increasing variety of mobile devices. Instead of offering for example just 3 break points with a few different image sizes, or preconfigured image sizes, RIC automatically detects exactly the right view port size for each image and device, thus offering precisely the best possible image for each user.

    For example, if you request the image asset id 123456, RIC automatically detects whether your browser supports .webp format. If not it will try the next best .png, and fallbacks to .jpg and .bmp images. See for example this image where, you don’t need to specify the format, RIC picks the best option for you:

    a waterfall responsively resized

    The latest two new features includes liquid rescale by adding ?mode=liquid to the img src url.

    a waterfall liquid rescaled

    Published by:
  • Careers Company

    PHZ.fi työtyytyväisyys 4.27 / 5

    Teimme hiljattain työtyytyväisyyskyselyn, jossa kysyttiin työntekijöiltämme parannusehdotuksia ja 1-5 skaalalla kuinka tyytyväisiä kukin työhönsä on. Valtaosa yrityksen 20 työntekijästä vastasivat kyselyyn, ja lopputuloksena kaikki olivat joko erittäin tyytyväisiä (5)  tai hyvin tyytyväisiä (4) työhönsä. Keskiarvo kaikkien vastanneiden osalta oli 4.27 / 5, jota voi pitää ihan hyvänä tasona.

    Kehitystoimenpiteenä perustimme toimikunnan, joka käy koeistumassa uusia erilaisia toimistotuoleja omalle toimistollemme (myös asiakkaiden luoksi vietäväksi :).

    Published by:
  • Coding Software Engineering Work Psychology

    Rule of Two for Pair Programming


    SidiousVaderPromo“Always two there are. No more, no less. A master and an apprentice.” – Yoda

    See a nice video on Pair Programming and Rule of Two. Pair work is not only a programming practice, but is a standard military practice ( https://en.wikipedia.org/wiki/Wingman and https://fi.wikipedia.org/wiki/Taistelijapari ) can be applied to any knowledge work such as sales and accounting, too.

    Pair Programming is a agile practice with 2 people in front of 1 computer and keyboard. There are 2 roles: the Navigator one tells what to do, the Driver holds the keyboard and writes (“one police man can read, the other can write”). You switch the roles frequently. Seniors should be paired with Juniors, Customers with Coders and Sysadmins with Frontend Developers.

    Pair Programming is a controversial practice where doing pair programming wrong is worse than not doing it at all. There is a vast amounts of scientific findings related to pair programming:

    Programmers working in pairs usually produce shorter programs, with better designs and fewer bugs, than programmers working alone. See http://en.wikipedia.org/wiki/Pair_programming

    • Pairs typically consider more design alternatives than programmers working solo, and arrive at simpler, more-maintainable designs; they also catch design defects early.
    • Pairs usually complete work faster than one programmer assigned to the same task (but it takes 2x the effort, but this is better than well compensated by the improved productivity)
    • Programmers are less likely to skip writing unit tests, spend time web-surfing or on personal email
    • Additional benefits reported include increased morale of the team.

    While Pair Programming works for the Sith, it is known to be kryptonite for

    • incompetent introverts
    • control freaks
    • super hero programmers
    • cowboy coders

    See http://blogs.atlassian.com/2009/06/pair_programming_is_kryptonite/

    More pair programming information is available from

    Published by:
  • Coding Testing Work Psychology

    Y2038 and Sustainable Software

    Today we were fixing some old unit tests for our large marketplace software, when I stumbled upon a peculiar test case. The test, written in 2005 assumed that a suitable date far in the Future would be 2015-01-01, and was now failing.

    We fixed the test case by the DoTheSimplestThingThatCouldPossiblyWork and extended the future date until Y2038.

    Anyway, the morale of the story is that at least at PHZ.fi, where we endeavor to build Sustainable Software, let’s expect that our software will be used for more than 10 years, before somebody rewrites it! In our case we are still using more than 10 year old software, but since we have unit tests (that now pass 100% again), it can still produce (a lot) business value. For a developer building sustainable software over building low quality, throw-away software, makes a big difference on the impact you contribute to the world.


    Published by: