Last active
August 29, 2015 13:57
-
-
Save Mikeyheu/9528698 to your computer and use it in GitHub Desktop.
Revisions
-
Mikeyheu revised this gist
Mar 14, 2014 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -99,6 +99,7 @@ Controller should have no business logic and more concerned about routing https://github.com/thoughtbot/guides/tree/master/best-practices Moving to presenters over helpers -
Mikeyheu revised this gist
Mar 14, 2014 . 1 changed file with 29 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -76,4 +76,32 @@ what if i didn't know where i came from assignment - redo bottles up to refactoring to strategy pattern do miracle do home Sandi Metz's rules 1. Classes can be no longer than one hundred lines of code. 2. Methods can be no longer than five lines of code. 3. Pass no more than four parameters into a method. Hash options are parameters. If bigger than that - if was going to break these into 2 objects what would they be? One instance variable Can only know 2 other class names Never test controllers - no logic in controllers! Never test helpers - no helpers! Put logic in things that she owns that she can create fast unit tests for Have to use presenters if I can't have helpers Have to write a ruby class that does what normally what would be in the helper Controller should have no business logic and more concerned about routing https://github.com/thoughtbot/guides/tree/master/best-practices 4. 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). 5. -
Mikeyheu revised this gist
Mar 13, 2014 . 1 changed file with 6 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -71,4 +71,9 @@ naming convention - be specific otherwise use composition what if i didn't know where i came from assignment - redo bottles up to refactoring to strategy pattern do miracle do home -
Mikeyheu revised this gist
Mar 13, 2014 . 1 changed file with 4 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -68,4 +68,7 @@ Refactor away from composition ruby naming convention - be specific otherwise use composition what if i didn't know where i came from -
Mikeyheu revised this gist
Mar 13, 2014 . 1 changed file with 6 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -15,6 +15,12 @@ Copy don't cut Robert Martin Bowling Kata Looslely coupled - not tied tightly to other objects Highly cohesive - all parts about the same thing Easily composable - like legos Context independent - can use in other contexts List of things we don't like -
Mikeyheu revised this gist
Mar 13, 2014 . 1 changed file with 49 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ Refactoring ----- Find the things that are most similar and make them the same @@ -15,3 +15,51 @@ Copy don't cut Robert Martin Bowling Kata List of things we don't like Then fix the thing that is the easiest to fix lot of private methods all related to one public method number is a magic number number -1 constant passing of a number prevalence of cases are there 2 logical classes here? If this were 2 classes pick a small object strategy you must have good unit tests to employ this strategy!!! modules are an inconvenint lie when applying recipe to refactoring code if you hit a roadblock you may be missing a concept Less arguments is better poodr domain driven design responsibly driven design implementing domain driven design goosgbt clean code code complete avdi grimm: objects on rails confident ruby ruby tapas destroy all software Draw a line in the sand to have a maximum class size like 100 lines total only subclass if the subclass is using most if not all of the superclasses methods inheritence needs to shallow, not deep, subjects are leaf nodes in object graph Refactor away from composition ruby naming convention - be specific otherwise use composition -
Mikeyheu revised this gist
Mar 13, 2014 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -13,3 +13,5 @@ Always be in the green Copy don't cut Robert Martin Bowling Kata -
Mikeyheu renamed this gist
Mar 13, 2014 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,5 @@ Refactoring _____ Find the things that are most similar and make them the same -
Mikeyheu created this gist
Mar 13, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ Refactoring: Find the things that are most similar and make them the same Then collapse them and do it over and over and over again Then find the things that are similar Very small steps Always be in the green Copy don't cut