scratch/content/html/fr/blog/2010-05-24-Trees--Pragmatism-and-Formalism.md
2010-05-25 08:13:27 +02:00

2.3 KiB

isHidden menupriority kind created_at title author_name author_uri tags
true 1 article 2010-05-24T20:05:14+02:00 Arbres ; Pragmatisme et Formalisme Yann Esposito yannesposito.com
arbre

First: my experience

It was said, 90% of programmer are unable to program a binary search without bug. The algorithm is well known and easy to understand. However it is difficult to program it without any flaw. I participated to this contest. And you can see the results here1. I had to face a problem of the same kind at my job. The problem was simple to the start. Simply transform and xml into another xml.

The source xml was in the following general format:

value1 value2 ... ... ... ...

And the destination format was in the following general format:

value1 value2 ... ... ... ...

At first sight I believed it will not be so difficult. I had the following rules:

  • I don't want to use XSLT
  • I wanted to avoid xml parsor if possible
  • I should do all that with a simple perl script wich search an replace things.

In the end, the program should be a simple list of: s/something/something else/g

It is not only possible but I believe it is the best way of doing this.

conclusion

As it should seems a bit contractidory. Sometimes the most pragmatic approach to a pragmatic problem should be the theoretical one. Not the commonly accepted pragmatic one. This simple experience prove this point.


  1. Hopefully I am in the 10% who had given a bug free implementation. ↩︎