Results 1 to 7 of 7

Thread: [RESOLVED] Limitation for coding

  1. #1

    Thread Starter
    PowerPoster eranga262154's Avatar
    Join Date
    Jun 2006
    Posts
    2,201

    Resolved [RESOLVED] Limitation for coding

    Few days back I start to work on Microsoft Visual C# 2005, using its express edition. At the same time buy a new for my study material. On the first chapter “Introduction to C#”, I’m really nervous.

    It’s about two things.

    1.) The maximum number of lines allowed in a C# program is 2097151.
    2.) The maximum number of characters per line in a C# program is 2064.

    If it is exceeded gives a compile error.

    I’m not worried about those numbers. Actually I can’t test this practically; it should be a large application.

    Presently I used Java and VB.Net, and never hared about such a limitation on them. May be there are but never I see.

    Any way my question is, why such a limitation there. Why that compiler can’t handle it. Please guys comment on this.

    “victory breeds hatred, the defeated live in pain; happily the peaceful live giving up victory and defeat” - Gautama Buddha

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Limitation for coding

    It's the way compilers work. A compiler will have its own parser and needs to be able to hold references to line numbers so that some lexical analysis can actually take place on all of the code. Now, obviously, there has to be a bit-representation for that variable to hold all the line numbers, and they are most likely using 22-bits (that comes closest).

    After all, it can't work with an infinite amount of lines.

    Something similar in logic would be applied to the number of characters per line, since, again, the lexical analysis cannot take place on an infinite number of characters per line, but needs some sort of a limitation.

  3. #3

    Thread Starter
    PowerPoster eranga262154's Avatar
    Join Date
    Jun 2006
    Posts
    2,201

    Re: Limitation for coding

    I got it, last night go through the parser and lexical analyzer.

    Thanks...
    “victory breeds hatred, the defeated live in pain; happily the peaceful live giving up victory and defeat” - Gautama Buddha

  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: [RESOLVED] Limitation for coding

    Yeah right. You just don't want to admit that you learned something new from my post.

  5. #5

    Thread Starter
    PowerPoster eranga262154's Avatar
    Join Date
    Jun 2006
    Posts
    2,201

    Re: [RESOLVED] Limitation for coding

    Be cool pal.
    “victory breeds hatred, the defeated live in pain; happily the peaceful live giving up victory and defeat” - Gautama Buddha

  6. #6
    Lively Member
    Join Date
    Mar 2005
    Location
    Dhaka, Bangladesh
    Posts
    102

    Re: [RESOLVED] Limitation for coding

    For Big lines you can write that in multiple lines in C# then what is the problem.

    You can use different classes for big programs also.

    -Rajib
    Please Rate every reply if it is useful to u

  7. #7

    Thread Starter
    PowerPoster eranga262154's Avatar
    Join Date
    Jun 2006
    Posts
    2,201

    Re: [RESOLVED] Limitation for coding

    Actually that what I'm doing now all my Java, VB, C# .... works. I never allow to appear horizontal scroll bar on the IDE which I use. Just I want to why that limitation.

    “victory breeds hatred, the defeated live in pain; happily the peaceful live giving up victory and defeat” - Gautama Buddha

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width