- Classes can be no longer than one hundred lines of code.
- Methods can be no longer than five lines of code.
- Pass no more than four parameters into a method. Hash options are parameters.
- Controllers can instantiate only one object. Therefore, views can only know about one instance variable and views should only send messages to that object (@object.collaborator.value is not allowed).
- pair allows you
- you have good reason to
- I think that the most difficult rule to follow is the 5 line rule. In my experience in JavaScript (which isn't too much) I've found that keep certain methods short is diffucult. Also what makes this rule particularly difficult to follow is not being able to use the If Else blocks. The benifit to this is having functions that are particulary lean and only allow you to have one function. What I find great about this is the ability to debugg your methods if they are writtent this lean. Being able to know where they break and why they break is great. It also allows you the ability to transfer methods over to other applications.