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

4 Responses to “Maximum lines per method”

  1. Carlos Rodrigues Says:

    “but this problem may arise with code generation tools”

    That’s a very good reason to strongly dislike code generation tools…

  2. Pedro Santos Says:

    That’s like saying that you shouldn’t use developers because there are those that write a lot of lines of code. :P

  3. Ruben Fonseca Says:

    I had the same problem with Java some time ago, when using AntLR 3 to generate a compiler from a reasonable big grammar :(

  4. Fernando André Says:

    nuts!!

    What are you building ?! a new DB Engine ?

Leave a Reply