addressalign-toparrow-leftarrow-rightbackbellblockcalendarcameraccwcheckchevron-downchevron-leftchevron-rightchevron-small-downchevron-small-leftchevron-small-rightchevron-small-upchevron-upcircle-with-checkcircle-with-crosscircle-with-pluscrossdots-three-verticaleditemptyheartexporteye-with-lineeyefacebookfolderfullheartglobegmailgooglegroupshelp-with-circleimageimagesinstagramlinklocation-pinm-swarmSearchmailmessagesminusmoremuplabelShape 3 + Rectangle 1ShapeoutlookpersonJoin Group on CardStartprice-ribbonShapeShapeShapeShapeImported LayersImported LayersImported Layersshieldstartickettrashtriangle-downtriangle-uptwitteruserwarningyahoo

Code Kata - Conflicting Objectives

This month, we're on Code Kata - one from PragDave's collection (http://codekata.com/kata/kata08-conflicting-objectives/).

Why do we write code? At one level, we’re trying to solve some particular problem, to add some kind of value to the world. But often there are also secondary objectives: the code has to solve the problem, and it also has to be fast, or easy to maintain, or extend, or whatever. So let’s look at that.

For this kata, we’re going to write a program to solve a simple problem, and we’re going to write it with three different sub-objectives. Our program is going to process the dictionary (word List) and looking for all six letter words that are composed of two concatenated smaller words. For example:

al + bums => albums
bar + ely => barely
be + foul => befoul
con + vex => convex
here + by => hereby
jig + saw => jigsaw
tail + or => tailor
we + aver => weaver

Write the program three times.

• The first time, make program as readable as you can make it.

• The second time, optimise the program to run fast fast as you can make it.

• The third time, write as extendible a program as you can.

Now look back at the three programs and think about how each of the three subobjectives interacts with the others. For example, does making the program as fast as possible make it more or less readable? Does it make easier to extend? Does making the program readable make it slower or faster, flexible or rigid? And does making it extendible make it more or less readable, slower or faster? Are any of these correlations stronger than others? What does this mean in terms of optimizations you may perform on the code you write?


Join or login to comment.

  • Ruth M.

    Sorry to have to drop out at the last minute; my caring duties have had to take precedence tonight; need to get back to Shrewsbury ASAP to help Sonia.

    April 28

    • Ruth M.

      Aye - I had to miss February because my mum had a stroke, and I don't think you were at the March meetup, Trevor?

      April 29

    • Trevor A.

      That's correct, I was enjoying some Easter break sunshine abroad.

      April 29

No one went

People in this
Meetup are also in:

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy