Archive

Archives pour la catégorie ‘sinarf’

Some people says that unit test are not maintainable…

… but that we should add more comments in our code.

This is just plain wrong. I think that untested code is not maintainable, and if you have a low test coverage of your code, soon you’ll have developers that will say : “We can add that functionality because we would have to retest everything manually and it will take too much time”. Correcting bug and adding feature will take more and more time

Unit test are compilable documentation of your code which are, by definition, more maintainable that plain text comment.
Most of the time the comments I see are useless at best, misleading at worst because they are almost never updated. They are useless because they explain what the code is doing which is duplication because the code already says what. The comments should answer the why instead.

If you have to choose between writing a test or comment, you should choose a test, because it is more maintainable. The reason for that is simple, as soon as your test is obsolete it will break and this is the time you have the best chance to know why the test broke.

Categories: sinarf Tags: ,

Creating a post on my blog from my nokia n900

I just had to install the mastory application and it worked!

Categories: sinarf Tags:

Why I switched to Google Chrome

2 weeks ago I discovered that Google chrome was finally available for Linux. So, I tried it and it took me only 2 days to switch from Firefox, and I was using Firefox for so long it wasn’t even called Firefox at the time (do you remember phenix or firebird? Or even the mozilla suite that existed before that?).

I thought I never switch because I was addicted to some of the extensions that I needed to survive online. But Google Chrome has extensions now. I particularly like Chromed bird the best twitter client I found so far.

The main reason I switched is speed, Chrome is freaking fast, especially with eavy javascipt site like iGoogle, gmail,  google wave, Digg, facebook or any site that is not Flex…

There is the thing I was getting tired of with Firefox.

  • A general slowness, that wasn’t solve with the last version which was suppose to be fast.
  • When you have to use authentication on a proxy and have extensions that try to connect to internet at the start you can have like a dozen of authentications popups at each startup. And if you had a master password you’d have a dozen of master password popups.
Categories: sinarf Tags:

Office documents are so XXth century, let’s move on…

10/11/2009 sinarf 2 commentaires

I’m pretty amazed that, today, in 2009, in the XXIth century, 40 years after a man has landed on the moon, people are still using Office documents to write documentations, follow task, all sort of thing. I’m a developer and I work with computer literate people who should know better. Is it unconscious incompetence or is it me? (it’s not me, I’m just making a point ;) )

There is the main reason why office documents are broken by design:

  • Text informations are not saved in plain text, (tip 20 of the pragmatic programmer guide: keep your knowledge in plain text)
    • if the file are corupted you probably lost everything instead of just the corrupted part.
    • two versions of the same document are nearly impossible to merge.
    • it’s hard to search informations, if you don’t already know were the informations is.
  • I think they induce  duplication: many documents have the same informations, sended through email, stored on local hard drives,… You spend lots and lots time manually synchronizing documents Most of the time you end up with X documents with errors or omissions, and worth, even if they all are up to date, you never can be 100% sure that they are.
  • It’s very easy to loose all your work, making every error a big risk, increasing stress.
  • They don’t respect the MVC design pattern, meaning you spend time on presentation instead on working on content. And I think that when you write a professionnal docunent you should worry about the presentation layer, it should have been taken care long before by somebody else.
  • Some easy task, can become unnecessary difficult. (try a cut/paste in an excel file.)

Most of the time, the use of office document is the result of intellectual lazyness, resulting in more work in the end. I am a true lazy person, as any developer should be!

There is lots of alternatives, more professional, more reliable, simply better (wikis, issues trackers, …) exist, we should use it. I kind of feeling sorry for the guys working on OpenOffice, most of them think they provide a usefull alternative to the big Microsoft Office suite, but they just reproduce a broken design. There probably is some use for this kind of software, but I’m sure they shouldn’t be used so much.

So, what the fuck guys! Wake up! we are in the XXIth century, it’s time to live with our time. Figure it out already. :D

Categories: sinarf Tags:

Making your wordpress blog mobile friendly.

There is a plugin that do that for you :

MobilePress – Enable The Mobile Web – Turn Your WordPress Blog Mobile.

very nice…

Categories: sinarf Tags:

Objective 0 unread in my google reader.

Today I totally clean my google reader and no I didn’t read everything. ;)

As most of the people, I always have around 500+ post unread in my google reader. This is a problem because it’s very unproductive. I think of my google reader as a inbox (in a gtd sens) and it should be empty-ed on a regular basis. As a matter of fact, google reader make the collect phase, but, for the system to work you must go through the review phase and there is where all the mess is starting.

List of problems of having a lot of unread items :

  • It’s depressing, it ’s a constant reminder of what you have not done (which is unproductive because it cannot be done).
  • When you read blog entry for example it is at least a few weeks old, you will not be able to participate the discussion, meaning you cannot spread your wisdom or start a flame war or a troll.
  • You have no sensation of achievement, because the unread count is a constant reminder of what’s you haven’t done. This might lead you to drug abuse or worth (like no drug at all, imagine that).

The first step to achieve this was to admit that I won’t ever read everything. So, you have to prioritize you’re reading. We need to categorize our reading, first there is several kind of feed :

  • The ones you read exhaustively (e.g. Dilbert), these are clearly not the problem.
  • The ones you think it would be nice to read but you’re never in the mood for it. Simple solution, if you didn’t read any item for some time -> unsubscribe!
  • The ones you read on and off. If you don’t need to read everything for this source but you think you’d profit from time to time reading, one good solution is to follow the source on twitter (all the cool kids are doing it). The great thing about twitter is the fact that you don’t see what you’re missing (and would miss anyway) but you can skim over the flow with no guilt at all.

Good day.

Categories: sinarf Tags:

Why do I drink so much coffee?

Because if I don’t, I may sleep at night and have a good night sleep, and I could becomme a morning person. And the is no way, I’ll ever let that happen!

Categories: sinarf Tags:

very simple way to pretty print xml from command line

I was looking for a tool to format xml, making it more readeable, under Linux you can use xmllint. It’s included in libxml2 and thererfore should be availlaible in any distribution. The use is very simple :
$ xmllint --format myXmlFile.xml
It will pretty print to the console to have in a file just redirect the default output to a file.
$ xmllint --format myXmlFile.xml > myPrettyPrintedFile.xml

And that’s it!

Categories: sinarf Tags: , ,

Devenir indépendant.

Bonjour,

Depuis que j’ai fait un bilan de compétences, il y a quelques années, l’idée de devenir indépendant me trotte dans la tête. Le nouveau statut d’auto-entrepreneur semble au premier abord intéressant, mais en fait il y a plusieurs limitations qui font qu’il est peu adapté à une activité à plein temps. Le plus grand problème étant,  le chiffre d’affaire maximum pour les métier de services et de 32000 € (cela comprends la rémunération, les charges et les frais).

D’un autre coté monter sa propre société est un vrai cauchemar, n’oublions pas que la France n’est pas le pays de la libre entreprise. La paperasse est énorme et on commence à payer des taxes et assurances avant même d’avoir encaissé le premier chèque.

Pour les personnes qui sont dans le consulting ou le service en général, il existe une autre solution très intéressante : le portage salarial. Le principe du portage salarial est le suivant.

  • Vous trouvez un client et vous négociez un prix
  • Vous faites signer à l’entreprise un contrat, que vous ne signez pas, il sera signer par l’entreprise de portage salarial. Ce contrat sera entre le client et l’entreprise de portage salarial.
  • L’entreprise de portage salarial prend en charge toute la partie administrative. (paiement des factures, assurances, recouvrement …) pour un montant allant de 5 à 15%.
  • L’entreprise de portage vous verse un salaire (le plus intéressant c’est que vous toucherez probablement votre premier salaire avant même que la première facture ait été payée par le client).

En gros, c’est être salarié, mais sans patron.

Alors pourquoi tout le monde parle du statut d’auto-entrepreneur avec les yeux qui pétillent. Parce que dans certains cas ce statut est une bénédiction. Par exemple, pour un complément de retraite, ou pour une activité annexe qui ne peu, en tout cas dans un premier temps, devenir une activité à plein temps, pour les personnes voulant, à terme créer une micro-entreprise (le passage se fait automatiquement dès que le chiffre d’affaire maximum est dépassé).

Je suis actuellement en période d’inter-contrat donc j’en profite pour explorer les solutions qui s’offre à moi.

Categories: sinarf Tags:

should I move ouatodo project to grails

I started this project based on appfuse but a framework like Grails is maybe more appropriate. Since I’m in the very beginning of the project I’ll probably should do the switch now.

The nice thing about groovy is that it will be easy to refactor to java if needed.

The nice thing about grails is that it’s based on the JEE stack.

The only argument I find against moving to grails would be scalability but it’s way to early to talk about this kind of optimization, according to the rule ‘Premature optimization is the root of all evil’ .

Categories: sinarf Tags: , ,