kodecocodes / english-style-guide

Style guide for writing in English for tutorials and articles at Kodeco.
157 stars 22 forks source link

Italicization of single letter variables and specifically Big O notation #24

Open suragch opened 2 years ago

suragch commented 2 years ago

I assume it is correct to italicize single letter variables that are not specifically used in code:

Does this apply to the O used in Big O notation? Here are some common examples:

Are the following correct:

_O_(1)
_O_(_n_)
_O_(_n_²)
_O_(log _n_)
_O_(_n_ log _n_)
suragch commented 2 years ago

https://guides.raywenderlich.com/article-author-guide/prepare-to-write/follow-our-formatting-conventions

suragch commented 2 years ago

The official guides don't seem to support it.

But also note that the current version of Data Structures and Algorithms in Swift does use italics. And see the usage here: https://en.wikipedia.org/wiki/Big_O_notation