vb.net - How to avoid if... else and switch cases -


I'm programming for a long time, usually in some languages, PHP, ASP.NET, Java, Javascript and others Programs in the programs. In all languages, I have to use more and more numbers. If value = 10 ... then if I review my code then I get a lot of position, if I want to reduce them, but it is not certain that

is a point Classes were reduced to a lesser extent but still they are more ...

Like functions, cats, seconds and types:

  If function = 'Junk' then if cat = "animal" then if sec = "man" then type = "male" then 'the following If you do stuff, then the end of the following stuff is if elseif sec = "horse" then if type = "play", do the following things: end the following material if elseif .... end if elseif cat = "plant "So if sec =" land ", then if type =" tree "then do the following material otherwise =" grass "then .. 'otherwise do the following material ... end if elseif sec =" water "then .. . ...  

...

Continue to continue even more n

So it is surprising that How can I reduce them and write some efficient codes?

Sorry recently to inform that there may be a lot of values ​​for work, cat, seconds, and type. My description is being nested nested if nested.

My code also looks more like this:

Many if..seek statement is often a symptom that is not being used.


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -