Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 1st, 2009, 09:33 PM
Registered User
 
Join Date: Sep 2007
Posts: 9
Thanks: 3
Thanked 0 Times in 0 Posts
Default lines of code

" i just want to know if lines of code in a class are limited ".
if yes,how many lines of code in class can be accepted
by Visual studio.net 2005 ?.
Because i have once happened that in my class accepted some error, when the code got to 3000 lines,but when subtracted,the class went well. please somebody(if know) reply this queastion .thanks.
 
Old April 2nd, 2009, 07:43 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

I've never heard of any limitation like that. What are the error details and how does it manifest itself?
__________________
Joe
http://joe.fawcett.name/
 
Old April 2nd, 2009, 08:40 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

First off, if you have classes that are getting that big, you should probably be looking into refactoring that class. With that many number of lines things become unwieldy and hard to maintain.

Second, what was the EXACT error you were getting? Like Joe, I know of no limitation on the maximum number of lines that the compiler will allow in a single class. Are you sure this error wasn't caused by say an error on line 3000 and when you removed that line it therefore removed the error?

-Doug
__________________
===============================================
Doug Parsons
Wrox online library: Wrox Books 24 x 7
Did someone here help you? Click on their post!
"Easy is the path to wisdom for those not blinded by themselves."
===============================================
The Following User Says Thank You to dparsons For This Useful Post:
nandar_hayhay (April 8th, 2009)
 
Old April 3rd, 2009, 09:26 AM
Authorized User
 
Join Date: Nov 2006
Posts: 93
Thanks: 0
Thanked 1 Time in 1 Post
Default RE: lines of code

Just a quick note. If there is a limitation it will probably be related to the file size not the number of lines of code. For instance 4 gByte may be the file limitation. Probably not your problem.
__________________
What you don\'t know can hurt you!
The Following User Says Thank You to David_0223 For This Useful Post:
nandar_hayhay (April 8th, 2009)
 
Old April 3rd, 2009, 09:33 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

To that end, a 4GB file, the number of lines that a class file would have to have to be that large would be astronomical (after all, class files are nothing more than glorified text files). Besides, if the physical size of the file were the problem you would most certainly have troubles beyond actual compilation e.g. Visual Studio would physicially bomb when you tried to open this file because the system would simply run out of memory (I am assuming a typical development machine not some super PC with 16gb of RAM or something crazy like that).

If you are running the compiler from the command line you would have this issue with Visual Studio, obviously, but the chances of getting a class file that is 4GB is highly unlikely.

-Doug
__________________
===============================================
Doug Parsons
Wrox online library: Wrox Books 24 x 7
Did someone here help you? Click on their post!
"Easy is the path to wisdom for those not blinded by themselves."
===============================================
The Following User Says Thank You to dparsons For This Useful Post:
nandar_hayhay (April 8th, 2009)
 
Old April 8th, 2009, 12:09 AM
Registered User
 
Join Date: Sep 2007
Posts: 9
Thanks: 3
Thanked 0 Times in 0 Posts
Default just reply

it's not error on line 3000,but vs.net could not be debugged..and when i subtracted the class, it went well..,i did not know what the reall matter.i forgot the error VS.net showed,because it happened in the past and i forgot the exact date,but thank you for all who replied my question.i will search for the matter.

Last edited by nandar_hayhay; April 8th, 2009 at 12:16 AM..





Similar Threads
Thread Thread Starter Forum Replies Last Post
Reducing code lines with suitable method john316 C# 2005 7 September 21st, 2007 10:43 AM
Add few Lines of code to All new aspx pages. gadhiav ASP.NET 1.0 and 1.1 Professional 3 October 19th, 2005 02:33 PM
dragging lines rajanikrishna Pro VB 6 0 April 24th, 2004 03:14 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.