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?
Excellent question! + 1
– user28595
@Diegofelipe, it reminds me of things like
ZueiraNeverEnds
.– Wallace Maxters
Try to use
LIMIT
inZueiraNeverEnds
:D– rray
Related: Should I write my program in English or Portuguese?
– Math
@rray of error 404
– user28595
@rray, there are cases that are accepted. As in the case of libraries that prefer methods, such as
get
. Then you’re bound to usegetNome
,getIdade
. Unless you change your table to English (which is not feasible)– Wallace Maxters
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.
– Ale
And it’s also impossible to accentuate my method, right, guys.
usuario::éAdministrador()
. I think you can suck it. You betterUsuario::isAdmin()
– Wallace Maxters
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
– Wallace Maxters
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.
– Math
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)
– mgibsonbr
Got it @Math. Think I should specify the language for example?
– Wallace Maxters
@mgibsonbr, for me then can close. The answers are, yes, satisfactory. I will not exclude the question. so generates more reference to other
– Wallace Maxters
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 thenomenclatura
.– Math
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 forListView
, orIFuncionario
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 preferobterConsultaTabela
andatribuirConsultaTabela
, 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).– mgibsonbr