Roy Osherove

View Original

Mortal coding sin: programming in your mother tongue

If there's one nasty coding habit that gets me riled up every time it has to be coding with non English words. This probably won't mean much to the English speaking crowd, but here in Israel, and in other non English speaking countries, junior developers often choose to give their parameters, class names, database tables and sprocs names that, although written in English, are words in their mother tongue.
For example, I've come across code that looks like this:
 

Public Class MenahelLakoach

    Public Sub HosafatLachoach(ByVal shem As String, ByVal TeudatZehut As String)

        'Ugly code taken from original

        Dim sql As String = "insert into LAKOACH (shem,TeudatZehut) VALUES ('" + shem + "','" + TeudatZehut + "')"

        'more code here

    End Sub

End Class

 

Obviously, this is totally unreadable to anyone who does not speak Hebrew. Actually, it's hard to read even if you know Hebrew since you're used to read English, not translating it in your head to Hebrew. Ugh. Here's an easier to read translation:

 

 

 

Public Class CustomerManager

    Public Sub AddCustomer(ByVal Name As String, ByVal ID As String)

        'Ugly code taken from original

        Dim sql As String = "insert into CUSTOMERS (Name,ID) VALUES ('" + Name + "','" + ID + "')"

        'more code here

    End Sub

End Class

 

 

Not too hard, is it? Please, for the sake of the developer after you, write in English. Look at it this way:

  • Now you can actually send the code over to someone and they'll understand it no matter what their mother tongue is
  • it's more reusable
  • hey, you had to learn English to program , right? might as well use it.
  • You won't have to think so much about how to spell a particular non english word in english, thank god.