The notation $[n,k]$ specifically denotes a linear code of length $n$ and dimension $k$, i.e. a code that is closed under addition (and scalar multiplication, if the alphabet field is not the prime field). The notation $(n,|\mathcal{C}|)$ is used, when non-linear codes are allowed. If the minimum distance $d$ is included, then the notations $[n,k,d]$ and $(n,|\mathcal{C}|,d)$ are common. If the alphabet field is something other than binary, say, a field of $q$ elements, then the subscript $q$ is added: $[n,k,d]_q$.
Especially when the topic is studied by combinatorial methods linearity is not always assumed. The combinatorialists derived several bounds early in the development of the theory, and they were also interested in non-linear codes, because some of the problems on bounds of existence are then more interesting. Hence this notation was used to make the distinction clear.
You are correct in that when $q=2$ (=the default), then $|\mathcal{C}|=2^k$. Take notice of the round vs. square brackets.