Skip navigation.

exploreopera

| Help

Sign up | Help

There is no spoon

It is not the spoon that bends, it is only yourself

Posts tagged with "IT"

The reverse of Carlsberg slogan applied to code

, , , ...

I sometimes get very annoyed with code I stumble upon. It happens more often these days, when I'm doing for one of my clients a thorough code review, cleanup, low level refactoring and so on.

Today was a special day with this respect. I found something that made me mad, in the most Monthy Pythonesque way.

I found a piece of code similar to this:

for(int i = 0; i < 100; ++i)
{
    SomeEntity entity = 
        new SomeEntity{SomeOtherEntity = someValue};
}


For the people less familiar with the marvelous Microsoft universe, let me explain that we are using Entity Framework, which is a ORM for .NET, developed by Microsoft. So SomeEntity actually corresponds to a table in the database. The entity instances are managed in a special space called a context. As for the constructor, it has this strange form because it initializes properties of the class with some values.

Now, when any decent developer looks at this code, it becomes immediately apparent that the variable entity is a local variable which is not used again. So, it's useless. Right?

Right, but with one catch. It so happens that whenever you set a property based on a relationship between two entities, as in the example, the entity is also saved in the context. Yes, you understood it correctly. It's like doing something like:

Dialog dlg = new Dialog();
dlg.BackgroundColor = Color.White;


and the dialog gets displayed.

The worst thing is that we didn't actually do anything to provoke something like this. This is how it works out of the box.

Disclaimer: it's true that we are using the beta 3 version of the Entity Framework. However, I am not very convinced that the final version will improve on this point...

Why the CMMI or other standards have remained unattractive or avoided by software giants?

, , , ...

This is a question from LinkedIn that I answered today.

Why the CMMI or other standards have remained unattractive or avoided by software giants, compromising the software quality, and providing later on with service packs and patches to be applied?

Many software giants are not in the favour SW-CMM or P-CMM or any among the whole CMMI, just because they simply does not want the lengthy assessment to be performed on regular basis which may impact the right time to deliver the product, opening the major loopholes in the software product. Therefore, it is tendency to offer service packs and security patches after the software has been delivered without going through the quality procedures offered by CMMI like standards.


The short answer is because most software giants base their projects on people rather than processes. The Google example is the most well known, but Microsoft, Sun or IBM have similar policies.

The idea is that quality software requires discipline, and there are two extremes in the discipline axis: on one end you have disciplined people to work with and on the other you choose to follow certain processes to the letter. CMMI's focus is mostly on processes, while Agile methodologies (Scrum, XP, open source etc) focus on people.

This doesn't mean that a framework like Scrum has no rules; it does, but one of the first is that the team is self-organizing. I saw statistics related to Scrum and the results are impressive.

So, if you look to what software giants are using you will see that they are using one or more flavors of Agile: Microsoft is using MSF, Google is using Scrum, XP and some other flavors, IBM is using CMMI in some departments, open source and some form of agile in others etc. This is simply because a well implemented Agile framework gives much better results than CMMI.

Regarding the Service Packs and patches, in today's business world there is absolutely no way to eliminate them, no matter which methodology or framework you are using. You can reduce the number of issues through some engineering practices (which are common to all methodologies) like inspection, unit testing a.s.o., but the even if the software is perfect when you release it (which surely isn't), new threats and changes appear every day. So, the business reasons will push you to release new patches and service packs.

I don't say all this to defend Microsoft. I believe that their mistake is not in the way they build the software; it has much improved in terms of security and stability. Their mistake is in the way they are using the software as a business weapon; instead of doing the best software they can, they try to kill the competition with it. Sadly for them, it doesn't work anymore. Sadly for their users, they are still doing it.


Personal advertisement: I am PassionIT and I help teams develop high quality software. I train, I help improving and I work hands-on, depending on the needs. Contact me if you need help. Alexandru Bolboaca-Diaconu
Add to Technorati Favorites

Adopting Best Practices

, , , ...

I have been trying in those last days to write a document describing some best practices that should be followed by one of my projects - and, why not, by any other project. Trouble is, I find this a very difficult task, not because I wouldn't have enough material or inspiration, but because it's difficult to make it convincing.

It all starts from a simple fact: I know bad code when I see it. I know bad design when I see it. And, whenever I make those judgments I am aware that (A) I think of human nature and its limitations, (B) Many other people from the industry would agree with me and (C) My colleagues may not agree with me.

Regarding the first point, it is important to understand that people write software for people. And people are limited, they make mistakes, they have difficulties finding the simplest solution, they tend to overdo or to underdo, they don't know how to express something that will be easy to understand by others. The source code is nothing but a communication medium, only it's a three-fold communication medium: the developer who wrote it talks to the developer who reads it, and to the user who needs it, all through the code; the difficulty is that the user sees another representation of the code, which communicates differently.

If this communication is broken, problems start to appear. If you cannot read your code as a story, you are bound to have troubles at some point. If your application doesn't tell its story to the user, he/she won't be content.

Regarding the second point, there are countless books talking about best practices. "Code Complete", "The Mythical Man Month", "The Art of Unix Programming", "The Cathedral and The Bazaar", "Refactoring" and even "The Tao of Programming" are well-known books that are all cited, used as reference, implemented (Source Monitor's Complexity metrics is implemented based on "Code Complete") and required reading. But I still need to talk about them.

And this takes me to the last point. Many developers I know chose to be programmers because they felt they can do anything. To some extent, it is true: a programming job gives us power to mold ideas into something we like.
On the other hand, this view is terribly wrong. You cannot do anything, because you are limited as a human being.

This is a truth that's difficult to grasp, but it's the path towards mastering software development.


Personal advertisement: I am PassionIT and I help teams develop high quality software. I train, I help improving and I work hands-on, depending on the needs. Contact me if you need help. Alexandru Bolboaca-Diaconu
Add to Technorati Favorites

Business, more than usual

, , , ...

I was very busy during the last weeks, and unfortunately my blog has suffered by having less posts than usual. The reasons are partly related to software development.

First of all, I've worked on the offer for trainings. It's almost ready, and will see the light of web in a few days.
The topics covered are various and are presented in a modern, interactive, hands-on format. And I'm not just saying that; we spent countless hours (mostly during the night) thinking what kind of games, workshops or exercises could help presenting the topics in the best way possible.

The topics go from best development practices (e.g. Software design) to programming languages (e.g. Javascript), from software project management (e.g. SCRUM) to specifics related to development (e.g. Application security) and we think that we add to the Romanian trainings pool the pieces that are currently missing. Our goal is to simply take the best we've learned and pass it on, helping people do their software development better and to feel better about it.

Second of all, I am still working on my DSL. It is a fairly complex task, but it turns out that I made the right choice when I decided to work on it in an evolutionary way: Write, Re-write, Refactor. It's still room for improvement, but I'm happy about the code quality and I'm happy that it starts to take shape.

Third of all, I'm still learning more and more about the Linux ways. I'm very happy with the Ubuntus installed on my computers, but I found out yesterday a few more things: prelink, an invaluable tool for making it run faster, and free maps for GPS applications - including Romania. Really cool!

Last, I have to say a few words about the adoption of OOXML as a standard. I can only use my common sense in this problems, and I have mixed feelings. On one hand, OOXML is nowhere near the maturity I would have expected from a standard: it's unnecessarily complex, it's not unitary, it's very difficult if not impossible for another vendor to implement it. On the other hand, maybe it's better that the format is now controlled by a standardization committee. But that's a very long discussion, and I would rather wait for the next developments before making any conclusions.

Well, that's it. See you soon!

3 Hidden Costs in Software Projects

, , , ...

One of the core reasons for which software project fail is that managers and/or customers don't know the hidden costs of software development. Here are three of them.

Hidden cost #1: Unneeded complexity

Complexity is the enemy of a software project. Not only it undermines the productivity when developing the "too complex" feature, it also undermines the productivity of developing related features, of debugging, and of fixing issues. It undermines the moral of the team, produces headaches for developers and managers, and can also result in loss of personnel.

Complexity is fought with a variety of means, but all seem costly to an untrained eye: using good developers, good design, design reviews, code reviews, refactoring.

When complexity is well kept under control, the final costs of the project go way down. First of all, developers are happier, they are working better and get better results. Second of all, managers don't have to fight with them to get them motivated.


Hidden cost #2: Security

Only recently security has become a major ocupation for the commercial software developers. This only happened because of painful experiences and because it became clear that not taking security into account results in major losses.

Security is difficult to implement in a software. The only way is to use a holistic approach, to think of it right from the start and all throughout the process. It also implies additional development costs: training the developers on security issues, continuously monitor the code from a security perspective, implement specific security-related mechanisms that wouldn't be needed for an application deployed in the void.

Hidden cost #3: Choosing cheap but bad developers over good but expensive ones

Choosing cheap developers seems a very good financial decision. But there's a catch.

Good developers are often 10 times more productive than bad developers, and they are never paid 10 times more. On the other hand, if a team is formed of a lot of good developers, other will want to join it. If a team has only a few bad developers, either the bad developers or the good developers need to leave.

I've seen projects where good developers were fixing during the night what bad developers were implementing during the day, and they were not always paid for it. This is one reason for which this cost doesn't reach the financial balance. So, stop doing it!

So there you are: 3 hidden costs in software projects.

UPDATE: Martin Fowler talks about this third hidden cost in his blog.


Personal advertisement: I am PassionIT and help teams that develop high quality software. I train, I help improving and I work hands-on, depending on the needs. Contact me if you need help.
Alexandru Bolboaca-Diaconu



Add to Technorati Favorites  Digg!

The essential difficulty of software development...

, , , ...

... is that we are working with ideas, not with material items.

The relation between people and ideas is fundamentally different from the relation between people and material items. For one thing, material items are perceived in the same way by different people (unless some of the participants are under the influence of some perception-altering substances). Material items can be described completely by diagrams and numbers.

The IT industry has gone to a great length of defining ways that would allow completely describing ideas. We have UML diagrams, templates for writing technical documentation and so on. We have ways to describe data and the transformation it suffers. We also have ways to describe the user interface.

The problem with the description methods we're using to describe ideas in IT is that:
  • It's really difficult and time consuming to completely describe an idea (try to read Kant or Hegel to realize how difficult it is)
  • Different people understand the description differently
  • It's difficult for people to understand the description completely, to take into account all the details

Besides this, ideas evolve, and the people who need the application expect them to be easily included in the implementation. It's very difficult to dissociate an idea from its programmatic representation. Ideas are easy to modify; the implementation is itself immaterial; so why is the implementation so much difficult to change than the idea itself?

In order to prevent misunderstandings from happening, we are testing the "materialization" of the ideas; in other words, the implementation. But how do you test an idea? It's not a matter of fitting a mechanical piece in a mechanism. It's about comparing the mental image of the idea with the actual implementation. But you can't actually touch it, move it, look at it from all angles; at least not physically.

And then, there's the relation between users and their applications. The computer is different from any other tool known to man because of a few key characteristics:
  • It processes information and the result is information
  • It gives good results only when given good input
  • It gives wrong results in any other situation
  • The user cannot touch an application

Therefore, the user has to form a mental model of the application and of how it works. So we are back to the same problem of perception of ideas. The user's mental model about the application is not bound to be the same as the one of the developer, of the producer and so on.

This essential difficulty is responsible for the most problems we face in software development. And, because it's an essential difficulty, there are no ways to avoid it, only to alleviate its effects.


The first solution that comes into mind is to minimize the communication chain. If the mental model gets more corrupted the more it travels then make it travel less.

Open source is a succesful model because the people writing the software are the same people who need it, and they can take decisions regarding it. In other words, they are bound to have a similar mental model because they need the same thing, and they are free to adapt the ideas.

Agile methodologies are succesful because the communication chain is the shortest possible. The customer is part of the team and he is the one explaining the mental model directly to the people responsible with materializing it.

All the other methodologies have proven in time to be impractical. Completely documenting an application in UML is less productive than writing the application and adapting it as it goes. In fact, completely defining an application means that we are creating a complete representation of the application in another language, and isn't that exactly what programming does? Except that you can run a program and you can, with some extent, use your senses with a program. That's impossible with another abstract representation of the same idea.

The other way to alleviate the difficulty is to use the right people for the job. Since defining a mental model for the application is a human problem, it's dependent on the individual. People with the right mindsets and with a certain mental agility that allows them to adapt to exotic mental models manage to form a mental image that's much closer to the one that's transmitted to them. And, with experience, they come to the point where the fill in the missing parts with the correct pieces of the puzzle (for a very interesting discussion on the expert mind, see this article).

To summarize, if you want your software project to be succesful, do the following:
  • Minimize the communication chain between the vision and the implementer
  • Use the right people in your team


I believe this to be the basis for any succesful software project.


Personal advertisement: I am PassionIT and help teams that develop high quality software. I train, I help improving and I work hands-on, depending on the needs. Contact me if you need help.
Alexandru Bolboaca-Diaconu



Add to Technorati Favorites  Digg!

5 things managers don't get about software development

, , , ...

1. Software development is creative work

How do we know that's true: All rules that apply to creative work are known to give results for software development. For example: write the program, then re-write it at least once (see [1], [2]).

How do we know managers don't get it: The cubicle. The noise. Any other environmental factors that kill creativity.


2. Managing an IT project is different than managing projects in other domains

"In many ways, managing a large computer programming project is like managing any other large undertaking — in more ways than most programmers believe. But in many other ways it is different - in more ways than most professional managers expect."
(from [1])

How do we know that's true: Practices that work in other industries don't work in software development (for example adding more people to a project to make it end faster or motivating people with "the employee of the month" program)

How do we know managers don't get it: They still think people are interchangeable in a project team and they still use ineffective motivation and recruiting techniques.

3. People are more important than processes

How do we know that's true: No software company has succedeed only based on processes. Instead, all software companies that are very succesfull have very good people. The best example is Google.

How do we know managers don't get it: They still insist on the work processes instead of attracting talented people and instead of making sure that they reject the wrong people. (See [3] for an interesting story regarding this issue).

4. Good developers are cheaper than bad developers

How do we know that's true: Data from the industry shows that good developers can be up to 10 times more productive than bad developers (see [1]). From my own experience, there are cases when bad developers can be even worse than that. But good developers are never paid 10 times more than bad developers.

How do we know managers don't get it: They prefer to hire cheap but mediocre developers instead of hiring talented people.

5. No bad developer has ever become a good developer

How do we know that's true: Even Bill Gates said it. There are studies about it (see [5]).

How do we know managers don't get it: They still hope that bad but cheap developers will learn in time.

References:

[1] Frederick Brooks, "The mythical man month"
[2] Eric S. Raymond, "The art of Unix programming"
[3] Paul Graham, http://www.paulgraham.com/colleges.html
[4] Joel Spolsky about recruiting software engineers: http://www.joelonsoftware.com/articles/GuerrillaInterviewing3.html
[5] Saeed Dehnadi, Richard Bornat, Research Study about Programmer Aptitudes, http://www.cs.mdx.ac.uk/research/PhDArea/saeed/


Personal advertisement: I am PassionIT and help teams that develop high quality software. I train, I help improving and I work hands-on, depending on the needs. Contact me if you need help.
Alexandru Bolboaca-Diaconu



Add to Technorati Favorites  Digg!

I'm not a C# developer or a .Net software architect; I'm a software developer, period

, , , ...

Managers and marketeers have a thing with names; they have to translate everything into something easy to digest and that sounds nice.

I've been called during my career names like: C++ developer, .Net developer, .Net software architect. During my first years in the industry, it seemed OK. Now I know better.

It's true that I've worked mainly with Microsoft tools: Visual C++ 5.0, 6.0 and Visual Studio 2003, 2005. It's true that I've used Microsoft libraries: MFC, ATL. But that's only the surface.

I believe that what I did is more important than what language I used. Let's see a short list:
  • I designed and implemented (with the help of my mentor) a custom database engine optimized for read only operations
  • I improved the performance for a number of applications
  • I worked on a number of tasks related to networking (sockets and stuff)
  • I designed and implemented a resource locking subsystem in a distributed application
  • Now I'm designing and implementing a Domain Specific Language

While knowing a programming language is necessary for all the above tasks, it's not enough.

On the other hand, I have evolved much besides the Microsoft world. I am currently using Linux at home, and loving it. I have finally understood functional programming only a couple of years ago, although I had passed an exam on this topic in college. I have understood that this whole discussion of patterns, procedures and other buzz words is futile; it's only programming. I have read about and used, within the available time, languages like Python, Ruby, Haskell, Perl and others. (In fact, even when working on Windows, I have a Cygwin instance open at all times so that when I need something I can quickly go in Python). Oh, and I know C, C++, Java, Javascript and C#.

For me the holly wars between Java and C# or any other two languages is just a pointless waste of time. If I think a language does a better job for what I need, I'm using it. If I think I need a new language, I'm designing and implementing it.

Finally, everything comes down to a few simple rules:

Be responsible
Know what you're doing
Take into account the advantages and the disadvantages
Use the appropriate tools
Solve the problem


So please, don't call me names; I'm a software developer, sometimes a software designer.

Update: Martin Fowler talks in his last bliki post about the different languages available for the Java platform. It seems we're on the same page about multilanguage projects...


Personal advertisement: I am PassionIT and help teams that develop high quality software. I train, I help improving and I work hands-on, depending on the needs. Contact me if you need help.
Alexandru Bolboaca-Diaconu



Add to Technorati Favorites  Digg!

Writing less code is good for your software's health

, , , ...

In a previous post I criticized some of Jeff Atwood's ideas. Today it's time to step in and defend him.

Jeff Atwood's today post talks about being able to run a program in 600 lines of code. He calls for an exercise in minimalism:

What can you build in 600 lines of code? Think of it as an exercise in minimalism. Does your preferred language or environment allow you the freedom to create something interesting and useful with that constraint in place?


The comments to this post are mostly jokes for a matter that is quite really serious.

I suppose that everyone's heard by now that the software industry has a horrible failure rate. 30% of projects never finish, while other 30% of projects finish but not in the due time and/or budget. That leaves only about 1/3 of the projects that are really succesfull.

Imagine now that one in three cars would explode and another one would be delivered one year late. Or that one in three houses (bridges, airplanes and so on) would fall apart. This is the sorry state of the software development industry at this point. Our only luck is that our mistakes kill much less people than other industries.

There are many reasons for the failure rate. Some of them are related to the fact that most managers don't understand how software is produced and don't know how to improve the process (hint for the managers: read for starters "The mythical man month", "Code complete", "Peopleware" and "Software Estimation: Demystifying the Black Art"). Some of them are related to the education of programmers.

When all those things are done well, the final product has a few characteristics that show it's good. The Tao of Programming explains it in a very expressive way:

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity.

A program should follow the `Law of Least Astonishment'. What is this law? It is simply that the program should always respond to the user in the way that astonishes him least.

A program, no matter how complex, should act as a single unit. The program should be directed by the logic within rather than by outward appearances.

If the program fails in these requirements, it will be in a state of disorder and confusion. The only way to correct this is to rewrite the program.


The connection between good software and fewer lines of code is well documented (again, see "Code complete"):

The more lines of code your software has, the greater the number of bugs.
The more lines of code your software has, the longer it takes to solve one bug.
So writing less code helps you write good software.


Any software can be written badly. The experience shows that this category of software usually fails. So, how's it gonna be?


Personal advertisement: I am PassionIT and help teams that develop high quality software. I train, I help improving and I work hands-on, depending on the needs. Contact me if you need help.
Alexandru Bolboaca-Diaconu



Add to Technorati Favorites  Digg!

A very heated market

, , , ...

Right now, I have the most profound hatred on the PC hardware industry. They are the most annoying people on the face of the earth. The only ones who are even more annoying are those who make the subscription models for mobile networks, but that's another story and deserves a post by itself.

My story is probably very common. I have a computer that works very well. Everything is tuned right and I can do most entertainment and office stuff with it. I can play games, maybe not with maximum details, but they work quite well. There's only one minor issue: it has only 512 Mb of RAM. And what's even more interesting is that I haven't felt the need to get more RAM until recently. This is probably a direct result of the fact that I'm mostly using Kubuntu and that I haven't even tried to work with Windows Vista.

For a number of reasons I need to get more RAM. At first glance, it didn't seem so expensive, until I found the catch: my mainboard only supports DDR RAM, because the AMD Athlon XP 64 bits Dual Core processor only has a memory controller for DDR, so it doesn't support DDR II. Ok, so I took a look at the prices for DDR memory and I was shocked; gold may be cheaper these days than 4 Gb of DDR. It's about 370 euros, while DDR2 costs half of this amount.

You would think at this moment that I should be able to buy DDR2 memory and use it on my DDR system. Nope, no chance. To quote from wikipedia:
DDR2 DIMMs are not designed to be backwards compatible with DDR DIMMs. The notch on DDR2 DIMMs is in a different position than DDR DIMMs, and the pin density is slightly higher than DDR DIMMs in desktops. DDR2 is a 240-pin module, DDR is a 184-pin module. Notebooks have 200-pin modules for DDR and DDR2.


Therefore my options are quite limited:
  1. Buy used DDR - if I can find at least 2 Gb somewhere
  2. Change the mainboard and the processor and buy DDR2 RAM, although I have a perfectly working computer - this may prove to be cheaper or close to the 4 Gigs of DDR


Excellent! The hardware manufacturers can be really happy with themselves.

But there's something more, besides my story: the PC model is based on flexibility. In theory, the consumer can choose to change any component inside a PC, can add or remove capabilities and so on. But, as my story shows, the PC model is fundamentally broken, because the hardware compatibility is a really complex issue nowadays. It's debatable whether this complexity is fundamental in the industry or if it is consciously fuelled by hardware manufacturers.

I am a professional software developer, but I don't know or care about all the difference between socket 949, socket 754 and socket AM2 (OK, I am curious about them, but I'm in consumer mode now). What I do care about is that I must pay an upgrade to my computer because of hardware compatibility issues.

What I would like to see on the market would be something like this:
  • Mainboards should support both Intel and AMD processors
  • New card types (memory, video, sound etc.) should be compatible with older card slots, at least for a number of generations; otherwise said, changes in the standard should only be made once every 4-5 years, when the technology limits are reached
  • Special slots for capability extensions should be available on the mainboard or on the cards themselves; for example instead of changing the video card just because there's a new one with OpenGl 5.0 support, you should be able to add an OpenGl 5.0 extension to the video card

Let's also note that we currently have home computers with too much computing power. Dual core, 64 bits Intel Core 2 Duo processors working at 4 GHz are used for writing emails, browsing the internet and watching movies. This happens because Moore's law dictates the computing power growth for economic reasons. The problem is that currently there's no market force to oppose Moore's law. This force can either come from market regulations or standards or from the consumer.

In the end, what I'm complaining about is the continuous push towards buying better and better hardware, while most consumers actually don't need it. This is the most annoying side of the PC market.