Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

One related issue is how should one mark up code that is intended to flow over multiple lines? Consider doing a long chain like:

MyObj.item.childItem.getAll()[0].properties... // etc.

It's common to want to split this over several lines. I am in favour of placing the the period at the end of the line to indicate that the expression continues. Other people prefer the dot to start the next line instead. I don't like the latter since the first line then looks like a mistakenly omitted semi-colon.



The dot is the operator.

It is customary to stack operators by indenting.

Why are lines without semi-colons at the end bad?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: