Linguistics for Software Engineers

Linguistics for Software Engineers
Photo by Clarissa Watson / Unsplash
Note: I didn't originally write this as a blog post. I wrote it as a text to a teacher friend of mine, so it might read awkwardly

I had an experience at work that I thought might be a good lesson for students.

I'm working on an app and in my app, users compete in challenges and win prizes. At the end of the challenge, the results are posted in the circle (like a chat room).

So I have to program it to render like this:
1st - $50.00, 2nd - $25.00, 3rd - $10, 4th - $5

However, I can't just output the data "raw" since the monetary values are stored as number of pennies, and in software, most lists are 0-indexed, so the first item is item 0.

Also, our app supports multiple languages, so that text has to be translatable into all languages, even though the values are dynamic. So the question is - how do you do it?

Well, here's where it's interesting for students: even though I'm in software and coding, I now have to understand sentence structure and language. I don't have to know the other languages, but I have to be able to break up the sentence components such that they can be reorganized and translated into proper grammar.

1st, 2nd, 3rd etc are ordinals. Some languages change the ordinal suffix based on the gender of the subject! Currency symbols sometimes follow the numeric value as a suffix, and sometimes lead it as a prefix. Sometimes the separator is a different symbol than a period. List separators are also sometimes different, not always commas, and the meaning of "this - that" does not always translate directly.

Basically all of this is to emphasize that even though I'm in no way a language expert or linguist, I still have to understand all of this to build an app that works correctly.