Is it bad practice to mix English and Portuguese in my source code?

Asked

Viewed 122 times

1

I see that some libraries made by Brazilians the codes are always in English. That’s why when I create something, I always do everything in English.

The point is, sometimes I see codes where there’s a mixture of English and Portuguese.

Something like:

$isUsuarioAtivo = $this->model()->getConsultaTable('minha_tabela');

This is bad practice?

I must avoid writing codes in Portuguese?

There is some difference in writing pattern between my application code and the code I write for library?

  • 2

    Excellent question! + 1

  • @Diegofelipe, it reminds me of things like ZueiraNeverEnds.

  • 1

    Try to use LIMIT in ZueiraNeverEnds :D

  • 3
  • @rray of error 404

  • @rray, there are cases that are accepted. As in the case of libraries that prefer methods, such as get. Then you’re bound to use getNome, getIdade. Unless you change your table to English (which is not feasible)

  • 1

    I prefer to write in English, it promotes for me (Brazilian) advantages, such as, getting closer to the native language of the language, familiarizing myself with the English language and with the terms of the world of programming (whether or not I wanted to or not, I didn’t come from Brazil). I think the most important thing is not to mix the styles. The idea is to follow a pattern primarily, if you are extending or are in a company where there is a way to write a code, I find it convenient to follow the pattern, before any own preference.

  • And it’s also impossible to accentuate my method, right, guys. usuario::éAdministrador(). I think you can suck it. You better Usuario::isAdmin()

  • Someone there gave -1. Did anyone get offended by the question. I have nothing against who makes the mix, I just want to know if this is good practice, Ué... kkkk

  • Good practice is something subjective, so as you can see that the question that I wrote that is very similar to yours was closed as mainly based on opinions, I don’t know if there is a right answer to your question. By the way, this has nothing to do with Patterns design, only I don’t know exactly what tag I could use.

  • 4

    I was not the downvoter, but there are probably those who think that this question is opinionated. See the "Should I write my program in English or Portuguese?", +36/-2 but closed. By the way, I consider this question duplicate the other, is there anything else you would like to know that is not addressed in the other question? (note that it also addresses the issue of the English/Portuguese mix in getters and setters, among other situations)

  • Got it @Math. Think I should specify the language for example?

  • @mgibsonbr, for me then can close. The answers are, yes, satisfactory. I will not exclude the question. so generates more reference to other

  • Wallacemaxters don’t think no, because this is language independent, could be just like the other question use estilo-de-codificação, but I no longer know exactly how to use the nomenclatura.

  • 2

    I gave my vote then. By the way, as my answer to the other question already speaks, I see no problem in using abbreviations in English with code in Portuguese (ex.: FuncionarioLV where "LV" stands for ListView, or IFuncionario for interfaces, etc.) but I don’t like to mix in getters and setters (by the way, I don’t like getters and setters, dot), I prefer obterConsultaTabela and atribuirConsultaTabela, But if you need to do it, I don’t find any "crime" rsrs either. For the rest, writing in English or Portuguese is much more a matter of public (who will develop, who will consume the API).

Show 10 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.