Oxford comma
Written , a minute read
While writing other post I realized something: Oxford comma (aka serial comma) is my preffered option when it comes to punctiuation due to programming habbits. In Python I would list fruits in this way:
FRUITS = [
"apple",
"banana",
"strawberry",
]
In Go I'm forced to write it this way, since it requires trailing commas for parsing reasons.
fruits := []string{
"apple",
"banana",
"strawberry"
}
With code above I will get following error: syntax error: unexpected newline in composite literal; possibly missing comma or }
So when I'm doing short list in HTML I would write it like this:
I like
apples,
bananas,
and strawberries.
To ensure that when I sort entries using sort
command, I don't have to look for the comma that is missing from the reordering of elements.
Sure I have to prefix the last element with and but that is much easier to spot and remember.
Addendum: short lists with list element
If you are crazy enough, you can restyle this:
- apples
- bananas
- strawberries
Into this:
- apples
- bananas
- strawberries
By adding class short
to your list with this CSS:
Do not use this unironically since text inside before and after cannot be selected.