جمعه، بهمن ۰۲، ۱۳۸۸

The r.a.Pe of JSF - Part IV: Naming Conventions

If you have ever tried to write an enterprise application in Iran, you definitely have felt what I call it the naming crisis. The business domain names in Persian are strange. Most of them are taken from Arabic that I don't even understand their meaning in Persian. For example when I hear the word "اموال غیر منقول" or "وثایق" I have only a vague idea of its meaning.
Since you can not name your Java class in Persian and even if you could it would be a mess (English and Persian in a file), there are currently two common methods for naming domain entities. The first one and in my opinion better one is to Use Finglish, and the second one, for some assholes tending to be very English and original, the translation in English.
There are two major problems in translating domain names in English. First usually you don't know the exact translation! And you end up with some shit. For example in this project they used "Immovable Properties" for "اموال غیر منقول". It is really funny. When I hear the word immovable, I think of something like a chair that is tied to the ground and you can not move it!
The second problem is that Software Systems are by nature not fixed. They evolve and change. And usually another team will work on it in the future. They usually won't get your translations if you don't provide an extensive glossary explaining your reasons for names and after three generations of developers the code becomes a zoo.
But there is third approach! Again from our asshole programmer. Obviously he was very interested in English names with some "تخمی" selection and translation. In the middle of this ruin I find an spectacular example of naming:

Come on! Gardesh Deposit Last Six Month! :)))))) He used Finglish, whenever he did not the translation.

Use Finglish for your domain object names! You may seem to be illiterate in English but you would free the next generation of developers from a great deal of pain!

۲ نظر:

  1. Could you find a better way to include code than an image!
    It is in a way similar to what you are calling out in your post.

    پاسخحذف
  2. For images, I agree with you! This is not the best way to put code in a blogpost but please remember this code snapshots are not tutorial material.

    They are some sort of evidence I have collected. When I was editing this project. I took screenshot and put it in a folder for future usage and now I'm putting them here.

    If you click on the images you can see a larger version so I think there is no problem in readability. 

    پاسخحذف