It's considered a bad pratice use return to end a function?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I'm a PHP and ActionScript developer, and in some of my functions I use return to end it. Example: private function lolsome ( a : String ): void { if ( a == "abs" ){ return void ;} // function's code } I could just place the function's code into its else , but I prefer this way because in my opinion, this is more legible. I just want to know if this is considered a bad practice or something like that. Thanks! 回答1: I would only consider it bad practice if you have returns inside long complicated functions because it can be harder