Re: Newbie Advice/Critiscism
- From: "MikeD" <nobody@xxxxxxxxxxx>
- Date: Sat, 23 Jun 2007 07:19:45 -0400
"Darren (UK)" <DarrenUK@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:63F5CB06-022D-430F-93C5-9640DD611494@xxxxxxxxxxxxxxxx
Hi Guys,
OK this is my very first attempt at development and whilst it does what i
want it to i know that in actual the fact the coding is awful. The first
thing you will notice is the amount of repetition of similiar code that
does
the same thing.
Im hoping that someone will take the time to look at the code and offer
some
advice as to how to curtail the amount of lines of code. As it is obvious
to
even the naivest coder there is some way of eliminating the repetition.
Im not asking for someone to rewrite the thing, what i am after is someone
to try explain the error of my ways and show me some ways of cleaning the
code up, as im sure that there will be occasions where i will be able to
apply lessons learnt.
You need to post in a .NET newsgroup. These have "dotnet" or "vsnet" in
their names.
However, regardless of programming language, certain principles and concepts
of good programming are always the same. For example, you're repeating a
lot of identical code to set checkboxes Checked property. Move the code to
do that into its own procedure and just call that procedure from whereever
you need. This will eliminate all that duplication of the code in various
event procedures.
Also, see my reply to Argusy on a way to have an event procedure handle an
event for multiple controls. Although, if you do the above suggestion,
haivng the event procedure handle multiple controls isn't really too
critical because it'd only be one line of code (the call to the procedure
into which you moved all your checkbox assignment statements).
But again, THIS newsgroup is for VB6 and under and most people won't be able
to offer specific advice for VB.NET.
--
Mike
Microsoft MVP Visual Basic
.
- Follow-Ups:
- Re: Newbie Advice/Critiscism
- From: Darren (UK)
- Re: Newbie Advice/Critiscism
- References:
- Newbie Advice/Critiscism
- From: Darren (UK)
- Newbie Advice/Critiscism
- Prev by Date: Re: Newbie Advice/Critiscism
- Next by Date: Re: Newbie Advice/Critiscism
- Previous by thread: Re: Newbie Advice/Critiscism
- Next by thread: Re: Newbie Advice/Critiscism
- Index(es):
Relevant Pages
|
Loading