News for hackers. Stuff that matters.
Re:How to Write Unmaintainable Code (2003) by axegon_ on Sunday August 30, 2020 @06:36PM (#24326561)
> Names From Other Languages

This is the worst thing that you could ever end up dealing with. Back at an old job many many years ago, the company bought a smaller one with the same business. Me and my at the time tech lead were given the task to migrate the database from the system they were using into ours. "How hard could it be" we thought. Well... All 51 tables scattered around two databases were in Romanian. Needless to say neither of us knew a single word in Romanian. I was surprised how much we managed to learn in a month though.

Re:How to Write Unmaintainable Code (2003) by arkitaip on Sunday August 30, 2020 @06:57PM (#24326709)
I write all my personal code, including comments, in English and not Swedish precisely because I want non-Swedish devs to be able to perfectly understand the code even without Swedish language or cultural knowledge. Also, thinking and writing in English is much simpler than jumping between two languages.
Re:How to Write Unmaintainable Code (2003) by axegon_ on Sunday August 30, 2020 @07:21PM (#24326871)
Personally I've always wrote my code and comments in English, even if I never fully understood why. That said, having studied abroad and returning after graduating I did hit a few rocks: My tech lead at my first job upon returning(the same job when we had to migrate the Romanian database) was telling me how to do something and he said something along the lines of "You take those and shove them into an array" in Bulgarian(my native tongue). As you could imagine, "array" in Bulgarian sounds nothing like that. I nodded with approval(having no idea what he had just said), and google-translated the word he used 5 minutes later. When "array" came up on the screen I felt like someone had smacked me in the head with a sledgehammer.
Re:How to Write Unmaintainable Code (2003) by ivan_ah on Sunday August 30, 2020 @09:43PM (#24327706)
масив? I had a similar experience wondering what this thing is when I first heard this. I wonder what the etymology is.

Python dicts seem to be „асоциативен масив“ but „речник“ is also acceptable, so at least that's understandable.

Re:How to Write Unmaintainable Code (2003) by axegon_ on Monday August 31, 2020 @02:33AM (#24328996)
Precisely. I truly have no idea how it's made it's way into CS, but I suspect it has to do with:

> Голямо пространство, заето от еднородни предмети. Горски масиви.

Re:How to Write Unmaintainable Code (2003) by de_watcher on Monday August 31, 2020 @05:36AM (#24329766)
It's probably from the Russian CS.
Re:How to Write Unmaintainable Code (2003) by Joker_vD on Monday August 31, 2020 @09:28AM (#24331231)
Students from different countries are asked to write an essay on elephants.

An English student: "Elephants and their import for the industrial production"

A French student: "Elephants and their sexual life"

A German student: "Elephants as the precursors of tanks"

A Soviet student: "The USSR: the country where elephants originally came from"

A Bulgarian student: "Bulgarian elephant, the younger brother of the Soviet elephant".

Re:How to Write Unmaintainable Code (2003) by throwawaynothx on Monday August 31, 2020 @12:08AM (#24328419)
Personally, I don't write comments. I write self explanatory method names. Comments become unmaintainable
Re:How to Write Unmaintainable Code (2003) by IggleSniggle on Monday August 31, 2020 @02:11AM (#24328909)
Regarding the relative usefulness of a well-named method vs an explanatory comment, I think it depends on the culture of refactoring for the codebase. If a codebase sees its code very regularly refactored, then comments can be downright dangerous/misleading while methods are easily renamed throughout. On the other hand, a well placed comment can tell you a lot of “why” or “how-to” that a method name / signature cannot.
Re:How to Write Unmaintainable Code (2003) by arkitaip on Monday August 31, 2020 @02:36AM (#24329009)
Comments can get stale really fast but I probably write at least twice the amount of comments as code because that's how I reason about the function and intention of the code. Sometimes the code seems simple but the reason why it exists can be really complex.
Re:How to Write Unmaintainable Code (2003) by thijsvandien on Sunday August 30, 2020 @08:01PM (#24327129)
How do you deal with the domain language? Translating that can be a pain and a source of unclarity too.
Re:How to Write Unmaintainable Code (2003) by yabai_yatsu on Sunday August 30, 2020 @07:27PM (#24326898)
I had fun adding https support to a decade old PHP app for managing a domain registry where the entire thing was in German :) I spoke neither German nor PHP.
Re:How to Write Unmaintainable Code (2003) by rightbyte on Monday August 31, 2020 @05:11AM (#24329668)
I have to concede that I write doc:s and code comments in my native tongue so moving development like this gets more expensive. Also writing in English takes like double the time.