Snake_Cases are easier than CamelCase for non-native speakers of English to read

5 points by mofosyne 16 days ago

This is an interesting transcript from the podcast EMBEDDED.FM under episode 460: I Don’t Care What Your Math Says https://embedded.fm/transcripts/460 . Where he promotes the idea of using snake case over camel cases to ensure good readability for none native English speakers.

> EW: And there is a talk here, "Crafting strong identifier naming practices." And this is going to be science-based?

> GW: Sure, because it is actually pretty straightforward to study how recognizable different naming conventions in code are. For example, camelCase is harder for people to read, if English is not their first language. If you think, for example, of somebody coming from a non-alphabetic language like Chinese. The notion that the capitalization of the letter matters, and then we hit acronyms, and then we hit all of the other cases. There is some evidence that pothole_case is actually easier for non-native speakers of English to read, because it does not require as much implicit knowledge.

calrain 16 days ago

It's easier to read for English speakers as well.

When working with databases, all properties / columns that I use are lowercase snake case.

Much faster to work with, you learn to type _ pretty quickly.

  • compootr 16 days ago

    Also I like underscores side you can double click to copy

    i.e try copying these in one mouse action: `some-thing-lol` or `some_thing_lol`

bschmidt1 16 days ago

I've seen code all documented in Japanese with Japanese strings. I thought it looked awesome and wondered why people don't just write code in their own language - why nobody has bothered to create, say, Japanese JavaScript.

There are some non-English based programming languages: https://en.wikipedia.org/wiki/Non-English-based_programming_...

  • vunderba 16 days ago

    Most programming languages themselves have a relatively finite number of keywords (if, break, continue, etc). It's the entire ecosystem (npm, PyPi, nuget, etc) and all the English libraries where it gets confusing for non-native speakers.

    You would almost need something along the lines of a "source translation map" + a transpiler + IDE which supported these translated keyword equivalents as part of natural autocompletion to make something like this work.

    EDIT: I wouldn't be surprised if there's an extension for VS Code / Jetbrains that translates JSDocs side-by-side into the user's language.

    • bschmidt1 16 days ago

      Sure, like extending i18n to the code itself, I like it. It would be a fun way to practice my Italian.

phendrenad2 16 days ago

Seems like a good area for research. Until then, it's anecdata.

aristofun 16 days ago

Im curious if tabs are easier for non native speakers than spaces