Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Craftsmanship: it's important!

Craftsmanship: it's important!

The slides for my Detroit Craftsman Guild talk about why craftsmanship is important.

7c2a83b93fe0e5f2ed4c95c59367259c?s=128

Amber Conville

August 26, 2014
Tweet

More Decks by Amber Conville

Other Decks in Programming

Transcript

  1. craftsmanship it’s important!

  2. wait, who the hell are you? i’m amber conville! you

    can find me on the internet at these places: i develop software here, at detroit labs, which is an awesome place! twitter: @crebma
 email: crebma@gmail.com
 github: crebma
 other stuff: i’ll bet you can guess!
  3. craftsmanship important? ok, back to business… why is

  4. ok, what even is craftsmanship?

  5. ok, what even is craftsmanship? let’s talk about history.

  6. first there was agile.

  7. so, agile is about teams and how teams work.

  8. so, agile is about teams and how teams work. enter:

    software craftsmanship.
  9. None
  10. so what is the difference, exactly?!

  11. code quality

  12. code quality community involvement

  13. code quality community involvement partnerships

  14. None
  15. ok cool, that all sounds neat. so what can i

    do to start learning about and practicing craftsmanship?
  16. test your code

  17. expect others to read your code, and preemptively make it

    easy to figure out whats going on.
  18. expect others to read your code, and preemptively make it

    easy to figure out whats going on. wait, how?
  19. s- single responsibility principle

  20. s- single responsibility principle why does it matter?

  21. None
  22. None
  23. o - open-closed principle

  24. public class Thinger() { protected int thingerType; public int doStuff(int

    baseStuff) {
 if(thingerType == 4) {
 return baseStuff * 8;
 } else if (thingerType == 2) {
 return baseStuff * 12;
 } return baseStuff * 2;
 }
 } public class FourThinger extends Thinger() { public FourThinger() {
 this.thingerType = 4;
 } } public class TwoThinger extends Thinger() { public TwoThinger() {
 this.thingerType = 2;
 } }
  25. None
  26. public class Thinger() { public int doStuff(int baseStuff) {
 return

    baseStuff * 2;
 } } public class FourThinger extends Thinger() { @Override
 public int doStuff(int baseStuff) {
 return super.doStuff(baseStuff) * 4;
 } } public class TwoThinger extends Thinger() { @Override
 public int doStuff(int baseStuff) {
 return super.doStuff(baseStuff) * 6;
 } }
  27. l- liskov substitution principle

  28. public class Rectangle { private int width;
 private int height;

    public void setWidth(int width) {
 this.width = width;
 } public void setHeight(int height) {
 this.height = height;
 } public int getArea() {
 return this.width * this.height;
 } }
  29. @Test
 public void rectangleWithSidesOf5And10HasAreaof100() {
 Rectangle rectangle = new Rectangle();


    rectangle.setWidth(5);
 rectangle.setHeight(10); int area = rectangle.getArea(); assertThat(area, equals(50)); //pass! yay!!
 }
  30. None
  31. public class Square extends Rectangle { public void setWidth(int width)

    {
 super.setWidth(width);
 this.height = width;
 } public void setHeight(int height) {
 super.setHeight(height)
 this.width = height;
 } }
  32. @Test
 public void rectangleWithSidesOf5And10HasAreaof100() { Rectangle rectangle = new Square();


    rectangle.setWidth(5);
 rectangle.setHeight(10); int area = rectangle.getArea(); assertThat(area, equals(50)); //fail! oh nooooo, it's 100! i am so surprised right now as a consumer of this object that i have to go look at the code to see what is going on!
 }
  33. None
  34. i - interface segregation principle

  35. d- dependency inversion principle

  36. but wait, that was all about object oriented programming!

  37. but wait, that was all about object oriented programming! (@nathandotz)

  38. learn, grow, and contribute

  39. stuff to do go to user groups, or organize them.

    there are tons of them in south east michigan, so look at meetup! pair with new people you don't work with all the time. go to conferences all over the place about all kinds of things, not just your favorite technology. speak at groups and conferences.
  40. tl;dr be awesome as hell, and take pride in what

    you do.
  41. thanks for listening to me ramble! @crebma