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

I largely agree with this. However I also tend to have short lines. For example if a function takes more than a couple of arguments I put each on its own line. I like to keep a few number of "ideas" on each line, ideally one or two.

What I don't worry about is long function names or similar. I won't wrap a line because a function name is really long or similar, as I think that doesn't generally add more complexity to the line.

That being said I think soft-wrapping of code is very lacking. The best I have seen is matching the indent of the previous line. It would be neat if it preferred breaking on separate arguments, operators etc. I guess this is now moving to the realm of code formatters but now you are back to hard-wrapping which loses the info about the target screen size.



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

Search: