JacobNinja / exercism-analysis

2 stars 2 forks source link

Common pattern: conditional within loop #8

Open kytrinyx opened 9 years ago

kytrinyx commented 9 years ago

Very often I see people use an enumerable method, and then stick an if/else or ternary statement or a postfix if inside of it. I generally point them to the list of enumerable methods and say that often there will be one that can do more of the heavy lifting.

Is this something that would be fairly low-cost to implement an analyzer for?

JacobNinja commented 9 years ago

Is this something that would be fairly low-cost to implement an analyzer for?

Seems fairly simple to me. Just to clarify: This rule should trigger when a conditional is used within a block called on an Enumerable method? Does that include ternary as well?

kytrinyx commented 9 years ago

Yeah, ternary as well as unless and if (both normal and postfix).

JacobNinja commented 9 years ago

I have a branch sitting around that needs updated with additional Enumerable methods and then it's code complete. I'll get to that this weekend I'm sorry for the delay

kytrinyx commented 9 years ago

That's great!