Maximum lines per method
November 27th, 2007
In .NET, you know the maximum number of lines per method has been reached when the JITer throws “Common Language Runtime detected an invalid program” - InvalidProgramException. It’s maybe around 39.000 lines of code. Naturally, no one would ever write so many lines of code in one method (humz…), but this problem may arise with code generation tools.
Related Posts
- Contra @ Little Big Planet
- Entrepreneurship
- Teaching modern concepts...
- Designing a DSL
- Google Ad Manager




November 27th, 2007 at 9:16 pm
“but this problem may arise with code generation tools”
That’s a very good reason to strongly dislike code generation tools…
November 27th, 2007 at 9:40 pm
That’s like saying that you shouldn’t use developers because there are those that write a lot of lines of code.
November 30th, 2007 at 10:48 pm
I had the same problem with Java some time ago, when using AntLR 3 to generate a compiler from a reasonable big grammar
December 1st, 2007 at 7:01 pm
nuts!!
What are you building ?! a new DB Engine ?