The Humane Programmer

Understand your limits, so that you can overcome them. A CC-BY-SA licensed blog.

Subscribe to RSS feed

My take on technology

, , ,

A few days ago I had a conversation about the mobile space with a Romanian entrepreneur. Before that, I finally learned that Nokia E51 has a predictive text ability and I learned how to use it. Shortly after, I had an epiphany. This is the story of my surprise finding.

Read full story

Website

I've worked a lot to improve my website lately. You can see the results here: http://www.alexbolboaca.ro

Maybe you take a look and give me some feedback or join my remote pair programming tour or whatever you prefer doing.

See you there!

Questions About Agile That We'd Like to Answer

Does Agile Work?

Short Answer:

The optimistic version: Yes. No.

The pessimistic version: No. Yes.

Phylosophical Answer:

If you become a Buddhist, will it end your suffering?

If you learn martial arts, will you be able to always defend yourself?

If you learn the rules of chess, will you become a grand master?

OpenAgile Romania 2010 - Register now

Read more

Full schedule

, , ,

I'm still having a very intense schedule:

  • Me and Maria are speaking at Agile Eastern Europe 2009 in Kyiv on the 18th of September, on the topic "Developer's Toolkit in an Agile World"
  • We started the preparations for the second edition of Open Agile Romania, the Romanian event dedicated to agile methodologies - see more at www.openagile.ro
  • We extend Agile Works to Timisoara, while we return to Cluj, Brasov and Bucharest. The community is both about management and about development - specifically, software craftsmanship
  • We are working on bringing well known personalities of the industry to talk in Romania. More to come...


So, see you at AgileEE or OpenAgile or AgileWorks. Or, who knows wink?

The future is semantic

, , , ...

I have been involved in the last couple of years in a project that uses semantic technology, and I will try in this post to give a feeling about what it is and how it can be used.

I'm sure that we've all heard about semantics, in various contexts: language, parsers and compilers and lately related to web. However, until I've worked and thought of this concept, I didn't have a very good understanding of what semantics is in general.

According to wikipedia, semantics is "the study of meaning in communication", and actually you can substitute semantics with meaning in almost all contexts. Semantic analysis in grammar is looking at a sentence from the point of view of meaning. Semantic analysis in parsers and compilers is looking at the meaning of the programming language constructs put together. The idea of semantic web is to add machine-readable and inferable meaning.

The world we're living in contains semantics, a semantics built by three main characteristics: things, relations between them and actions that you can apply to a thing. Take the following example:

My(relation) name(thing) is(relation) Alex(thing) and(relation) I(thing) write(action) a blog entry(thing) while(relation) sitting(relation) on(relation) a chair(thing).

And that's basically what semantics is.

The problem with semantics is that we have a great tool for processing it, one that machines lack: our brains. The brain evolved along with us in this environment, and it developed special powers that allow it to process and understand the semantics of this world. Machines have no idea about things that to us are very simple to understand, like the fact that "Alex" is the name of a person, or what "writing" means. Therefore, in order to make machines process such information, you need to explain everything to them, or to allow them to evolve. The first solution is very time consuming, while the second may give very strange results as you cannot control the evolution but only the environment and the rules for it.

Despite these problems, people have found ways to build machine-readable and inferable semantics, some of them very familiar to any of us.
The web is the first example that comes to mind. It has a few types of objects (page, image, sound, object), a single type of relation - links to - and one action - follow link. A wiki is the same thing, only that there are rules for the free text content of the page - you know that in wikipedia the page http://en.wikipedia.org/wiki/Semantics discusses "Semantics" and you have additional actions: edit, create, delete.

Video games build their own semantics. In a FPS, you can move, rotate, shoot, and each object may have additional attributes: weight, health, stamina etc. A RPG builds upon a more complex semantics that describes not only your current state but also your possibilities of evolution - nothing more than a kind of metadata. This is only natural, since a game tries to define a world with meaning for the player.

The easiest built semantics that you can find in games is in MUDs. Due to them being text-based, there's plenty of freedom in defining objects, relations and actions very quickly, and obtaining a world where anybody can play and try. This advantage of quick prototyping allows for a lot of user generated content, even if the community is rather small.

Social networks also build semantics. The main object is a person, with various other collateral objects: company, group, awards, schools etc. The main relation is "know": "Person X knows person Y". The actions are add and remove. The problem is that they are limited, because other elements are missing from the picture: trusts, prefers, likes etc.


If we think about technology from this perspective, we realize that the tendency is to add and to enrich the semantics of the applications. However, this is no easy treat. Trying to do too much can only bring failure. It's better to start small, and that's why technologies like the web, wikis, social networks are so successful, despite having very limited semantics.

However, it is clear that adding semantics - new types of objects, of relations and of actions - can significantly enrich the user experience, if done properly. That's why I think that in the long run, the future is semantic.

People love recipes but they shouldn't

,

The more I meet with developer communities, the more I understand (and get annoyed by) a simple truth:

People love recipes.

Recipes don't work in the real world when you're trying to obtain exceptional results or when you're working on something innovative or when you're working in a fast changing environment. Some of us are forced to work in such conditions. For the others, I think that's what we should try to accomplish.

Even the most common meaning for the word "recipe", the meal recipe, is a very good example. If you've ever eaten an excellent meal, do you think it was made after an old recipe? Sometimes, very seldom, yes, but most of the times the recipe is adapted, slightly modified or completely invented by the chef (or by your mother or grandmother). The best meals are the ones that you invent for your own taste. The chefs know that, and so do most of the people who cook tasty meals.

Software development has another kind of recipes: patterns. I definitely recommend knowing the GoF patterns and all the ones presented on Martin Fowler's web site, but only because they are selected patterns and have proven to be the most useful. The literature on software patterns has exploded in the recent years, without providing much added value. Even the GoF patterns need to be adapted to specific situations that we encounter, and they were taken from years of practice. The context can change everything, that's why patterns are only mildly beneficial.

Business recipes could be one of the greatest hoaxes of our times. Their promise is that by applying them you will reduce the risks for starting or for growing your business. Let me tell you one thing: once you start building a business, there's no way the recipes will be useful to you. Reality finds ways to avoid repeating itself, so what was good for one, two, one hundred businesses before you won't be good for you. You will need to adapt, to fine tune and sometimes to rebuild your strategy from the scratch. Recipes mean nothing in the real world. It is more probable that those businesses that succeeded in following a recipe were very lucky. Try reading "Black Swan" to get a feeling of why this happens.

People like recipes because they think they make their lives easier. The intuition is that following a recipe reduces risks by building upon past experience. This intuition is wrong, because reality changes all the time. A meal recipe used to be good at some point because a different type of onions was used that's no longer available. A design pattern worked fine because there were no applications with 10 million users. Copyright law used to work because copying a work was very difficult. Newspapers used to work because publishing was difficult.

So what's left when we take the recipes out? The techniques for making the recipe. You need to boil or fry your ingredients. You need to use classes in OOP languages. You need to tell a story so that customers come to your business. But the number of ingredients, how and when you mix them, how long you keep them together and the seasoning - that's your decision.

It's risky, but with decisive actions, the results will be exceptional.

Brief history of reactions to innovations in communications and publishing

, ,

So everyone will know how to read?
So everyone will know how to write?
So everyone will know how to compute?
So many people will read what's written by certain authors?
So everyone will be able to talk to everybody else?
So everyone will be able to see/hear movies/music made by some people?
So everyone will be able to tape the movies and music from radio/TV?
So everyone will be able to make movies?
So everyone will be able to make music?
So everyone will be able to publish text, images or sound?
So everyone will be able to transfer text, music, videos to a lot of people?
So everyone will be able to publish anything and everyone will be able to see/hear/read/get a copy?
So everyone will be able to do all that without anybody knowing it?

Software development mantra

, ,

I've got inspired today to write this. I hope you'll like it.

What's left after you take out OOP
What's left after you stop thinking about methodology
What's left when there's no manager
What's left when you stop thinking
About principles, patterns, best practices, design, statistics, workload or productivity
What's left after you've cleaned your head
Of all images and diagrams and opinions and views of others
Is the code, and it's all that matters.

A theory about common sense

, , ,

In my many long days (and a few nights) of professional software development, I've had quite a few WTF moments. I'm sure you all know what I'm talking about - that moment when you look to somebody's else piece of code and you realize that he/she/them used the worst possible solution to the problem in hand, one of such devious ingenuity that you could never have created it, and therefore builds into you feelings of both fear and nervous laughter at the same time.

Every time I shared such a solution with one of my fellow developers who have the appropriate stature to understand the point, we were both thinking: this is nonsense! This violates the most basic mechanics of software development! This violates our common sense!

But common sense is a very elusive concept. How do you express it, how do you explain it to those people violating it in such an unimaginable manner? How can they learn it, use it, teach others? How did you get into its possession?

Hard questions, with no answer. Until now, when I have finally developed a theory of common sense. It may be proven right or wrong, but at least it's a theory that is, I believe, worth exploring.

My theory can be summarized as following:
  1. We start learning programming because we are attracted by it
  2. We continue to learn and read more and more because it's more and more interesting
  3. The knowledge pieces we gather connect to each other
  4. The connections solidify in patterns
  5. The patterns become the second nature and the common sense is born


The first empirical evidence of this theory was available to me a long time ago. I realized that the programmers that had common sense also touched a wide area of topics related to software and computers. I could discuss with them about all kinds of things, from the architecture of Linux kernel to functional languages, including topics from telecommunications, networking, assembly, electrical circuits or even unrelated topics like quantum physics, astronomy or genetics. One does not read such topics if forced, so they must have liked it.
On the other hand, the programmers that did those mistakes could not discuss any interesting topic and had almost zero culture in programming. Most of them had learned one programming language and one platform (.NET in my case) and were programming for money.

However, knowledge is not enough. I have also met people who knew quite some things about programming but had a crippled common sense. They weren't as bad as the WTF cases, but they had some repeated glitches. The brain plays a major factor here; the way it filters and organizes information can create very good systems or good enough systems of patterns.

My theory is also supported by some scientific research. A Scientific American article talks about The Expert Mind.


A chess master expert. Photo licensed under a CC license by mysza831

How did he play so well, so quickly? And how far ahead could he calculate under such constraints? "I see only one move ahead," Capablanca is said to have answered, "but it is always the correct one."



The article shows that the mind of an expert is formed by learning, practicing and working for at least 10 years. This helps forming a specialized type of memory that the expert uses for his work and that makes a very big difference between him or her and a beginner.

On the other hand, software development studies have shown that a good programmer is at least an order of magnitude better than a mediocre programmer. This isn't so unexpected when you know about the expert mind, is it?

In programming specifically, many studies have shown order of magnitude differences in the quality of the programs written, the sizes of the programs written, and the productivity of the programmers. The original study that showed huge variations in individual programming productivity was conducted in the late 1960s by Sackman, Erikson, and Grant (1968). They studied professional programmers with an average of 7 years' experience and found that the ratio of initial coding time between the best and worst programmers was about 20:1; the ratio of debugging times over 25:1; of program sizes 5:1; and of program execution speed about 10:1. They found no relationship between a programmer's amount of experience and code quality or productivity. (Code Complete, page 548)



And the final piece of evidence that I can provide at this point is a study on the ability of people to learn how to program. The study was initially called in a very suggestive manner The camel has two humps because it shows a large difference between the people who can learn programming and those who can't.


Expert pattern built by an expert. CC licensed work by Vilhelm Sjostrom.

Abstract: All teachers of programming find that their results display a 'double hump'. It is as if there are two populations: those who can, and those who cannot, each with its own independent bell curve. Almost all research into programming teaching and learning have concentrated on teaching: change the language, change the application area, use an IDE and work on motivation. None of it works, and the double hump persists. We have a test which picks out the population that can program, before the course begins. We can pick apart the double hump. You probably don't believe this, but you will after you hear the talk. We don't know exactly how/why it works, but we have some good theories.



In conclusion, my take on common sense in software development is:
  • Some people like programming and some don't - the camel has two humps
  • The people that like programming study a lot, forming their expert mind
  • The expert mind makes an order of magnitude difference
  • What we call common sense are the patterns found in the expert mind


Until next time, may the common sense become more common!

Another take on the essential problem of software development

, , ,

I discussed in a previous article what I believe is the fundamental issue of software development: the fact that software development works with ideas. Specifically, software development starts with an initial idea, what we call requirements, which is about the resolution of a problem from the real world or an optimization of an activity and goes to a more material idea, the actual implementation of the requirements.
I will present in the following another take on the same discussion.

If we think at the majority of the human projects, you can split the needed work in two categories: think-work and work-work. Take construction for example: think-work is the work of the architect when he imagines a new type of building, or a new bridge; think-work is also the work of the construction engineer who thinks of how to solve practical problems, like ensuring the structural strength and the fire proof quality of the construction; think-work is also the work of the construction crew who solves particular issues or optimizes the work during construction. Work-work is the more mechanical activity that, if we keep the construction example, can be drilling a hole, brick working or nailing boards together.

An example of think-work. CC licensed photo from nelle100

We can find such examples for most human activities, be it cooking (create a recipe vs. slicing the vegetables), music (compose a song vs. playing an instrument), writing (composing vs. typing or handwriting) and so on. The difference lies in proportion; some activities need more work-work (driving) while others need more think-work (painting, writing a novel, solving a mathematical problem).

I believe that software development is at the upper range of think-work. You can easily realize this once you try to give examples of work-work in software development, besides typing or talking. Software requirements and software design are easily excluded from the set of examples. Despite what some companies want you to think, writing code is not work-work - you cannot disconnect your brain while doing it. Solving bugs is like solving a mystery, so it's definitely think-work. Testing is the most repetitive part of software development, so there is work-work there, especially in the execution of test scenarios.

A good software design might assure more work-work and less think work, but in most cases it only obtains easier think-work - if you think of it, that's what it does, by sustaining conceptual integrity and by defining patterns and recipes for specific problems in a limited scope (e.g. how to create a new form in the application). The specifics are however so elusive that nobody can design everything completely from the beginning for any complex enough application. Therefore, you are bound to have a significant amount of think-work in any software project, no matter how good your design is.

An interesting characteristic of software development is that think-work is not easily assignable to one or more members of the team, being spread in all the activities of the project. Trying to do this for economical reasons - pay one or more team members more and let them take responsibility - produces more problems than it solves, by introducing mistakes in the system that need to be tackled afterwards. That's one of the reasons why Lean Methods applied in software are successful - it's better to make something good from the first time rather than making it wrong and then trying to solve it.

Therefore, we have seen that the amount of think-work in the software development endeavors is quite high and spread inside the team. That's another reason why we need to understand our brains better and why we need to try to void their pitfalls.

Until next time, may your think-work and your work-work combine swiftly!