Multiple Return Points ARE Bad

What a troll; writes almost-correct article that takes strong position on controversial subject, over-elaborates, and then on crucial point in the argument makes a gaping subject error. Shaaaaame. I came here for wisdom, and I leave empty-handed and very disappointed.

For the record, here’s the mistake: “So if false is returned, we know that isEnabled() returned false, so none of the object state that this method affects was altered.” Bullshit! It could also be that counter was incremented beyond 5, and false is returned AFTER “doing stuff”.

Also, the MR example was shitty; only the “exceptional” or “unreasonable” arguments or states should be guarded, and there multiple return points are NOT bad (basically same as exceptions), and of course later in the code they should be avoided. I’m sure there’s a gray area between “beef” of a function and guards, but surely in the “beef” you shouldn’t have MRP.

Anyhow, to feed the troll and vent off my frustration with “Both comments and pings currently closed”: http://whatimean.wordpress.com/ is an asshole and incompetent when it comes to coding. Never take code review suggestions from him seriously.

Over and out.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: