[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.
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.
Re: Limitation for coding
I got it, last night go through the parser and lexical analyzer.
Thanks...
Re: [RESOLVED] Limitation for coding
Yeah right. You just don't want to admit that you learned something new from my post. :afrog: :p
Re: [RESOLVED] Limitation for coding
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
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.
:blush: :blush: