Top Banner
Why do lazy developers write beautiful code?
33

Why do lazy developers write beautiful code?

Jan 28, 2018

Download

Technology

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Why do lazy developers write beautiful code?

Why do lazy developers write beautiful code?

Page 2: Why do lazy developers write beautiful code?

Why lazy developers write beautiful code?

Page 3: Why do lazy developers write beautiful code?

Who is this guy?

@javier_arilos / Javier Arias Losada

Page 4: Why do lazy developers write beautiful code?

Programming as building construction

CASE - Computer-Aided

Software Engineering

Page 5: Why do lazy developers write beautiful code?

Software development is a wicked problem

"wicked": a problem

whose solution can be

defined only by

solving it*.

Page 6: Why do lazy developers write beautiful code?

Engineering essence: elegant efficiencybest

engineering is born out of an imperative to

use the minimum amount

of materials

Page 7: Why do lazy developers write beautiful code?

Is software development like science?

Page 8: Why do lazy developers write beautiful code?

Art the expression or application of human creative skill and

imagination

producing works to be appreciated primarily for their beauty

Page 9: Why do lazy developers write beautiful code?

Programming and painting

Page 10: Why do lazy developers write beautiful code?

How Picasso paints a womanhttps://youtu.be/V1UmPiUlFis

Page 11: Why do lazy developers write beautiful code?

Programming and painting

● sketching

● gradual refinement

Page 12: Why do lazy developers write beautiful code?

Beauty

a combination of qualities, such as shape, colour, or form, that

pleases the aesthetic senses, especially the sight.

Page 13: Why do lazy developers write beautiful code?

"The Magical Number Seven,

Plus or Minus Two: Some

Limits on Our Capacity for

Processing Information" -

George A. Miller, 1956

The Magic Number Seven, +/- Two

Page 14: Why do lazy developers write beautiful code?

"beautiful code" is not an abstract virtue

beautiful code must help the

programmer be happy and

productive

beautiful code is easy to

understand

Page 15: Why do lazy developers write beautiful code?

Yukihiro Matsumoto (Ruby Creator)

Brevity & no redundancy

Familiarity

Simplicity

Flexibility

Balance

Page 16: Why do lazy developers write beautiful code?
Page 17: Why do lazy developers write beautiful code?

>>> import this, The Zen of Python

Beautiful is better than ugly.

Explicit is better than implicit.

Simple is better than complex.

Complex is better than complicated.

Flat is better than nested.

Sparse is better than dense.

Readability counts.

Although practicality beats purity.

If the implementation is hard to

explain, it's a bad idea.

If the implementation is easy to

explain, it may be a good idea.

Namespaces are one honking great idea --

let's do more of those!

Page 18: Why do lazy developers write beautiful code?

Kent Beck (XP/agile)

Passes the tests

Reveals intention

No duplication

Fewest elements

Page 19: Why do lazy developers write beautiful code?

Clean code - Uncle Bob

The only

valid

measurement

of code

quality:

WTFs/minute

Page 20: Why do lazy developers write beautiful code?
Page 21: Why do lazy developers write beautiful code?

Laziness

the quality of being unwilling to work or use energy; idleness.

Page 22: Why do lazy developers write beautiful code?

Tips for lazy developers

Page 23: Why do lazy developers write beautiful code?

Tip 1. Use the right tools

Optimise for development time, not execution time

Page 24: Why do lazy developers write beautiful code?

Tip 2. Be pragmatic

Page 25: Why do lazy developers write beautiful code?

Tip 3. automate all the things

Page 26: Why do lazy developers write beautiful code?

Tip 4. Fast feedback is king

Page 27: Why do lazy developers write beautiful code?

Law 5. Write beautiful code

Page 28: Why do lazy developers write beautiful code?

Inspired by...

Page 29: Why do lazy developers write beautiful code?

Lazy person

"I will always choose a lazy

person to do a difficult job

because a lazy person will

find an easy way to do it."

Bill Gates

Page 30: Why do lazy developers write beautiful code?

Laziness

“The quality that makes you go to

great effort to reduce overall energy

expenditure. It makes you write

labor-saving programs that other

people will find useful, and document

what you wrote so you don't have to

answer so many questions about it.

Hence, the first great virtue of a

programmer.”

Larry Wall - Perl author

Page 31: Why do lazy developers write beautiful code?

Done. Now I think I can use some rest.

@javier_arilos / Javier Arias Losada

Page 32: Why do lazy developers write beautiful code?

references

Jeff Atwood - Development is Inherently Wicked https://blog.codinghorror.com/development-is-inherently-wicked/

Jeff Atwood - Good Programmers get off their butts https://blog.codinghorror.com/good-programmers-get-off-their-butts/

Yukihiro Matsumoto - Treating Code As an Essay https://www.safaribooksonline.com/library/view/beautiful-code/9780596510046/ch29.html

Code Complete: A Practical Handbook of Software Construction, Second Edition by Steve McConnell: http://a.co/exQvydH

Bartosz Milewski - Category: The Essence of Composition: https://bartoszmilewski.com/2014/11/04/category-the-essence-of-composition/

Joe Armstrong - Why programming is difficult http://joearms.github.io/2014/02/07/why-programming-is-difficult.html

Martin Fowler - Beck Design Rules https://martinfowler.com/bliki/BeckDesignRules.html

Rob C. Martin - Clean Code https://www.amazon.com/dp/0132350882/ref=cm_sw_r_tw_dp_x_g-JXzbJT5GS7X

Page 33: Why do lazy developers write beautiful code?

Abstract

There has been a lot of discussion during the last 50 years about the nature of

programming: Is it an art like poetry? Is it craftsmanship like pottery? Is it an

exact science like physics? Or a non exact science like medicine? Is it engineering

like bridge building?

Whatever the nature of software development is: during this time, a lot of tools and

techniques have appeared to make your lazy-developer life more difficult: Coding

conventions, OOP, FP, SOLID, Design Patterns, Tests, TDD, UML, Use-cases, CASE tools,

Refactoring, RUP, Agile, SCRUM, Continuous Integration, Code Complexity Metrics,

Emergent Architecture, DevOps, SCM... and whatnot!

But, sometimes, being a lazy developer makes you do things that seemed

counterintuitive, in order to pursue your main objective: WORK LESS.