cs50 / cs50.readthedocs.io

https://cs50.readthedocs.io
209 stars 523 forks source link

Manual should mention that style50 supports Python and Javascript (soon) as well. #35

Open cmlsharp opened 6 years ago

cmlsharp commented 6 years ago

We should link to PEP8 for python and document the modifications we've made (max line length relaxed to 132 characters and we require padding around operands, although maybe we shouldn't do this latter bit since PEP8 disagrees with us here).

tommylenz commented 4 years ago

As of today, PEP8's specification says maximum line length is 79 chars, while docstrings or comments should be limited to 72 chars. They even have an exception, but that's nowhere near 132 chars either:

Some teams strongly prefer a longer line length. For code maintained exclusively or primarily by a team that can reach agreement on this issue, it is okay to increase the line length limit up to 99 characters, provided that comments and docstrings are still wrapped at 72 characters.

Hm. Seems like we can't agree with them, then! :grinning:

And as of right now, they advice to have the same amount of whitespace on both sides of a binary operator , but lets a user decide whether to use whitespace or not (saying it should be used alongside binary operands and if operands with different priorities are in use). I guess it's ok to demand the use of padding around operands, because it's demanded to increase the readability, and in the end readability counts!