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

OTOH if you need follow-mode, aren't your functions too long?


Probably, but sometimes you have to work on other peoples's code. The worst for me was a 312 line function, which nearly caused me to quit.


I don't think that people give this situation enough credit. I once took over a project of about 30,000 lines of C++, with only about one line of commenting per 1,000 lines; and was frustrated with a lot of tools/documentation/suggestions that amounted to "don't write code like that". (Doxygen ended up being my friend)


From the C code I've seen, 300 lines sounds like standard fare.


Yes, but it's great to see your functions in context.

I also use Emacs for text editing, and I'm writing a major manifesto right now which is thousands of lines.


Emacs should have a dedicated manifesto mode.


I'd rather have too long than too short. I got some code recently where 3 lines was about the longest function (for a loop), and many functions were one line. It was nearly impossible to follow what was going on because you could never catch the "flow" of the code.


Sometimes you need to see context that extends past the boundary of a function.




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

Search: