I have my own coding style that stems deeply from C/C++ background, but using C# and .Net I know I don't take full advantage of the .net framework.
My coding is very C/C++ based in a C#/.Net environment.
For example, one thing I don't use is the components variable of the form. I know every form gets created with a container called components, and its disposed when the form is disposed, but I NEVER use it.
In fact, I never use containers, ever. If I recall, they were slower than just doing arrays so thats what I use, arrays.
I also RARELY dispose anything in my forms Dispose event.
Typically the only time I use the constructor and destructor for forms is if I'm adding custom event handlers and removing custom event handlers.
Anyone have a link to a decent project I can download to view?
I've written over 200,000 lines of C# so far and I'd like to see how well I'm doing. lol
Thanks. ![]()
-
-
CodeGuru123 wrote:I have my own coding style that stems deeply from C/C++ background, but using C# and .Net I know I don't take full advantage of the .net framework.
My coding is very C/C++ based in a C#/.Net environment.
For example, one thing I don't use is the components variable of the form. I know every form gets created with a container called components, and its disposed when the form is disposed, but I NEVER use it.
In fact, I never use containers, ever. If I recall, they were slower than just doing arrays so thats what I use, arrays.
I also RARELY dispose anything in my forms Dispose event.
Typically the only time I use the constructor and destructor for forms is if I'm adding custom event handlers and removing custom event handlers.
Anyone have a link to a decent project I can download to view?
I've written over 200,000 lines of C# so far and I'd like to see how well I'm doing. lol
Thanks.
Check the sandbox here on C9. -
You've written 200kloc of C# code and you don't know what the Components member of the Form is for? You should read a few books.
The Components member variable holds references to all the components on the form (Controls are a subclass of Component). The form designer does that so that code which needs to do something for all components on the form at once doesn't need to be customised for each and every form. The main purpose is to call Dispose() on all the components on the form, giving Controls a chance to release their window handles and non-visual components like database connections and timers to release what resources they've allocated.
You don't put stuff there yourself. If you design customer components and then drag them onto the form, the form designer will create the code to add them there for you. There's nothing to say you need to create your code as components either and you probably won't unless you plan on selling them to other Windows Forms developers. Most ppl will just create their custom code as a plain old class if they need to re-use it on more than one form. -
What would be interesting is if several people were given the same project and then the final results compared. Who writes the most code, the best UI, the first to be developed, least bugs etc.
-
Thanks for the info rhm!
-
sbc wrote:What would be interesting is if several people were given the same project and then the final results compared. Who writes the most code, the best UI, the first to be developed, least bugs etc.
I agree. Not just the same goal, but I would insist on fairly strict specs. You wouldn't wanted so open ended that you're comparing architecture. The comparison would be in the implementation.
-
I would also suggest the Sandbox. There is a guy - wait a yes - "littleguru" is his name... he has a sample in it... really great code

-
littleguru wrote:I would also suggest the Sandbox. There is a guy - wait a yes - "littleguru" is his name... he has a sample in it... really great code
does littleguru love himself a bit?
lol just kidding yeh i have downloaded some sandbox stuff and its kool. have u tried windowsforms.net coz they have samples on there aswell which might be on interest. just a thought
Thread Closed
This thread is kinda stale and has been closed but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.