7

Even when questions are asked in English, often the code has foreign variable names (if I see the word formulario one more time...) and as such is really difficult for me to read as a native English speaker, I imagine it's as bad or worse for those who don't know the language and don't have the best grasp of English either.

Should something be done about this, or should I just deal with it? It seems like they are shooting themselves in the foot since those questions seem to attract less answers.

5
  • 1
    Related MSE dicussion: meta.stackexchange.com/questions/194059/… Commented May 13, 2014 at 22:17
  • 4
    Is it really that much harder to read than a poorly named variable (e.g. xyz)? Or typos? I'd say there's no reason to touch code at all so long as the rest of the question is in English.
    – Adam Lear StaffMod
    Commented May 13, 2014 at 22:29
  • Poorly named variables are as bad or worse, I think. Commented May 13, 2014 at 22:33
  • 1
    As long as they stick to an ASCII character set, I don't think it's an issue. Plus, I get to flex my sweet 8th-grade-level spanish skills.
    – roippi
    Commented May 13, 2014 at 22:43
  • Wouldn't this suggest to foreign advertisers that their money could be better spent elsewhere?
    – Gayot Fow
    Commented May 13, 2014 at 23:15

4 Answers 4

7

I'd say just deal with it, although it does irritate me as well... English is not my first language, but I always make a point of coding in English.

5

I think we should not just deal with it, but embrace it. Most of the text will be in code which you should be able to read; it's only a few identifiers that you may not recognize, but those may be easy enough to look up on, say, Wiktionary. Often learning just a few words will make the code much clearer, especially if the variable names are—as we are often reminded to do—chosen well.

-2

TLDR: Code including foreign-language variable names or comments indicates low effort on the part of the asker. Feel free to downvote; however, leaving a comment may help them understand the problem and improve their post.

I disagree with the other answers given here – I don't think we need to accept this kind of code; we can and should downvote such questions.

Ours is an English-language site; we require questions to be asked in English. If a user knows enough English to ask in English or translate their question, clearly they can be expected to use meaningful English variable names. I have also seen posts with foreign-language comments in the code; these are basically just noise since we don't expect our readers to understand them. In my opinion, they should be translated or deleted.

Generally, we frown upon users simply dumping their code into a question; we require them to reduce the code to the parts relevant to the question. So if we require them to make this effort, surely they can go a little further and rename a few variables?

Reading this reminded me of this question where a user posted code that was golfed and therefore hard to read. In my mind, anything that hinders us from easily understanding the code posted is their responsibility to clean up before they post it.

That means:

  • Reduce your code as much as possible while including all the relevant parts (if you have created an MCVE, you have already got that covered)
  • Format your code properly (no golfing)
  • Use meaningful variable names, that means naming your variables in English
  • Remove any comments that are not intended for the audience and consider adding some that are (that means no foreign-language comments)

All these are things you do to facilitate potential answerers to understand the questions with minimal effort on their part. Generally, the burden to do this lies with the asker; if you are feeling particularly helpful, feel free to edit their post to reflect this.

Questions asked without making this effort are essentially wasting the time of volunteers who should focus on answering questions, not trying to make sense of badly asked questions. That is worth a downvote, IMHO. That said, no one is stopping you from still answering these questions.

6
  • 1
    Agreed; it is often a sign of copy-pasted code, hence no effort shown to reduce the problem to its minimal form.
    – CodeCaster
    Commented May 28, 2018 at 11:55
  • 1
    Holy crap, wow. You're basically saying that in spite of the question itself being in English, just because the code's identifiers aren't in English, you believe the question to be "low effort"? If the question is otherwise understandable, and your compiler or interpreter can handle it just fine, what's the real problem?
    – Makoto
    Commented May 28, 2018 at 15:47
  • You referenced a question about "golfed" code here, which I would loudly argue that these two circumstances are completely different. The difference between golfed code and code with foreign language identifiers is that one of those pieces of code has the intention of being small, terse and obfuscated. If someone wants help with their golfed code, they'd need to ungolf it before we could look at it.
    – Makoto
    Commented May 28, 2018 at 15:49
  • 2
    @Makoto Yes, I believe simply dumping your code into a question makes it low-effort. Code is written not just for compilers/interpreters but for people as well. Is it really so hard to make sure they can read it with ease? Commented May 28, 2018 at 16:13
  • 3
    @Makoto It‘s not that the code is unreadable, but it takes more effort than necessary. We get a lot of low-effort questions that can be answered just fine but require the answerer to do way too much work – work that the asker should have done. Whether it is less readable on purpose (golfed/obfuscated) or just by the fact that you copy-pasted it from your project that just so happens to be in eg Spanish, makes little difference to me – after all, you are posting the code as-is, on purpose. You could choose to modify it and make the lives of the people helping you essier, or just dump it in. Commented May 28, 2018 at 16:19
  • See also: idownvotedbecau.se/unreadablecode Commented May 30, 2018 at 10:52
-3

It can be a bit aggravating but, then again, I'm accustomed to seeing most things in English. However, if they aren't that terrible to read (and "formulario" isn't, IMHO) then it shouldn't be too much of an issue. That variable is going to be called "formulario" everywhere in the program (hopefully) so it shouldn't be too much of an issue as far as helping to solve the issue, provided you are given all of the necessary information.

I have seen some really bizarre variable names and, in those situations, it is ok to ask the OP to change them if it really is giving you (and possibly others) a problem in helping them.

I don't think this is anything that SO needs to deal with in their guidelines.

Somewhat off-topic

It may be a good idea to suggest to those users that coding in English is recommended most places so they might want to start getting familiar doing so.

2
  • I agree that formulario is a terrible example, just a very common one. The problem is that it's very hard to figure out what's wrong with some code if you have no idea what it's trying to do. And I can't figure out what someone is trying to do if their variables names are x, y, z, or salut, nacht, هتاف للترحيب Commented May 13, 2014 at 22:21
  • 3
    Your last example is a perfect example of what you are explaining, for me at least. So, if it is something like that then I might ask the user to use English in their code and I've seen a lot of others do the same. So, as stated in my answer, if it is that bad then I would suggest to the OP to change otherwise just deal with it.
    – codeMagic
    Commented May 13, 2014 at 22:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .