Hacker Read top | best | new | newcomments | leaders | about | bookmarklet login

I generally separate operands, but in dense math expressions it's not always the best for readability.

   x = (-b + sqrt(b**2 + 4*a*c) / (2*a)
   
   x = (- b + sqrt(b ** 2 + 4 * a * c) / (2 * a)
... Although, one could argue that allowing tightened multiplication and division are enough.


view as:

Not to be that guy, but...

  x = (-b + sqrt(b**2 - 4*a*c) / (2*a)

lol, thank you.

Well, if you're only interested in kebab-case, then specifying that identifiers can't start or end with hyphens solves most of the problem. The only restriction would be that you'd need whitespace around '-' only when used as an infix operator.

Legal | privacy