Thread: If statements
View Single Post
Old 09-17-2002, 07:46 PM   #1 (permalink)
abc123
bloomberg
 
abc123's Avatar
 
Join Date: Jun 2002
Location: bloomberg
Posts: 263
abc123 is on a distinguished road
Send a message via AIM to abc123 Send a message via Yahoo to abc123
If statements

i've just figured something out and i'm starting to use it but im not sure if it is really good coding style...

e.g.

Code:
//my if statements used to look like this

public void stuff()
{
	if(abc)
	{
		doSomething(x);
	}
	else
	{
		doSomething(y);
	}
}


//but now they look like this

public void stuff2()
{
	if(abc)
	{
		doSomething(x);
		return;
	}
	
	doSomething(y);
}

is this a good idea? doesn't matter? or should I stick to the regular if/else situation.
__________________
-- bloomberg.
abc123 is offline   Reply With Quote