127
Big guns for the small guys (reloaded) Jorge Lopez-Lago 6 March 2016 Annotated!

Big guns for small guys (reloaded)

Embed Size (px)

Citation preview

Page 1: Big guns for small guys (reloaded)

Big guns for the small guys (reloaded)

Jorge Lopez-Lago6 March 2016

Annotated!

Page 2: Big guns for small guys (reloaded)

http://www.wallpaperup.com/150483/transport_military_cargo_A400M_f.html

Engineer

The last airplane I was part of.Testing the engines!

Page 3: Big guns for small guys (reloaded)

https://www.amazeelabs.com/en/blog/fun-potatoes-other-wallpapers

Drupaleer Not endorsed.I just like the table :)

Page 4: Big guns for small guys (reloaded)

My company!

Page 5: Big guns for small guys (reloaded)

AT-AT

http://starwars.wikia.com/wiki/All_Terrain_Armored_Transport

Advice and tools.Repeat.

Page 6: Big guns for small guys (reloaded)

Disclaimer(*) There is always a disclaimer.

(*)

Page 7: Big guns for small guys (reloaded)

I do not endorse any of the products or brands mentioned in this talk.I have used them, I am using them or I am looking into using them in the near future.

Page 8: Big guns for small guys (reloaded)

This is an opinionated talk.Some swearing may be featured in it.

***!

Page 9: Big guns for small guys (reloaded)

What have I learnt?

95% of what we learn happen before the age of 7 (I heard somewhere).

Page 10: Big guns for small guys (reloaded)

Humans build stuff as badly as possible, but not worse.Me Some call it “optimization”.

It is an strategy that works pretty well… until it doesn’t.When it doesn’t it is usually because we crossed the crap line.An expert is someone that has failed many times. That helps to estimate the crap line in projects.

Page 11: Big guns for small guys (reloaded)

AdviceBased on my experience and preferences. You may disagree violently...

Page 12: Big guns for small guys (reloaded)

http://nutritiouslife.com/edible-sunscreen-you-need-to-know-about/

Sunscreenhttps://en.wikipedia.org/wiki/Wear_Sunscreen

At least you will have a piece of solid, backed by science, good advice.

Page 13: Big guns for small guys (reloaded)

We are in the business of selling.

There is no other business.The sooner you get it the better.

Page 14: Big guns for small guys (reloaded)

Do not sell your time!Sell the product of your work,

not your time.

FYI: this is bad stuff.

Bodyshopping is a form of modern slavery based on “employment” ideas of the 18th Century.

Page 15: Big guns for small guys (reloaded)

Small is good.It is the right thing to do.

Less people = less bullshit, less noise, more clarity.Cut down the middleman between you and the final client.

Small clients are good for this strategy.Everyone has his personal agenda, with personal objectives.

Personal agendas interfere with project objectives. Do the math..

Page 16: Big guns for small guys (reloaded)

Luke: Is the dark side stronger?Yoda: No, no, no. Quicker, easier, more seductive.

AKA: big corporation teams.

Page 17: Big guns for small guys (reloaded)

Broken telephone effect:CEO > Marketing > Designer > B. Analyst > Designer > P. Owner > T. Lead > Developer

Littered with middle managers as well.

Page 18: Big guns for small guys (reloaded)

Fear is the path to the dark side...fear leads to anger… anger leads to hate… hate leads to suffering.Yoda

Fear of losing their jobs.Large companies policies make people to worry about their jobs, not their work.

Page 19: Big guns for small guys (reloaded)

This industry is cheap.Code is cheap.

And this is one of the main problems with it. Everyone thinks that we can keep making changes to code indefinitely because it

has a perceived cost of almost nothing; after all it is “digital/virtual” and we can rewrite it at no cost…

Page 20: Big guns for small guys (reloaded)

Agile?Whatever works for you!

For me it is a combination of frozen specifications, architecture planned in advance (you need overall vision of the project), prototyping, many checklists and agile Ganttified sprints.

But never “agile planning”, whatever that means.

Page 21: Big guns for small guys (reloaded)

Never start everything at the same time!

Big teams go large here.

I have seen things… whole development teams coding frantically, directed by the PM, before the architect joins the project.

Someone hired them early and they must work (write code!) as they are being paid to warm up their chairs.

The train can not stop: timber!

Page 22: Big guns for small guys (reloaded)

First, solve the problem.Then, write the code.John Johnson

Practical tip: print this slide and paste it to your computer screen.

Page 23: Big guns for small guys (reloaded)

But we cost more and take longer than building a house!

The average time to build a family house is 6 months.The perception of cheapnes is the origin of our trouble as it provokes multiple cycles of changes (together with developers reinventing the wheel in each

project). We do not have the restrictions of the physical world: when something is done it cannot be changed. That helps the house builders.

Page 24: Big guns for small guys (reloaded)

Plain bad planningIt is really difficult to manage and plan projects.

Sometimes I have the impression that…Those who can, code. Those who can’t, manage.And that is not a good strategy for success.

A good PM is priceless. And very rare.

Page 25: Big guns for small guys (reloaded)

Plans are of little importance, but planning is essential.Winston ChurchillDo not mistake software planning with project delivery planning. The first one must be done in advance while the former may be done in an agile way as the project progresses. I am afraid all planning is treated in the same fashion by the agile crowds.

Mainly software planning

Page 26: Big guns for small guys (reloaded)

No battle plan survives contact with the enemy.Helmuth von Moltke the Elder

Always have a plan B.

Page 27: Big guns for small guys (reloaded)

Use checklists.For absolutely everything.The whole aerospace industry is based around checklists. I am sure we can do very well with them in our industry...

Page 28: Big guns for small guys (reloaded)

Use Gantt charts.To control the work allocated to tasks and

the dependencies between them.

I am open for suggestions. And not, I do not trust developers, or other people for the matter.

Page 29: Big guns for small guys (reloaded)

Development, design and content creation work planned for one sprint. You only need colourful post its and a large enough window.

Page 30: Big guns for small guys (reloaded)

The science behind it

Says who?

Page 31: Big guns for small guys (reloaded)

Parkinson’s bicycle shed effectEveryone knows better… the simple stuff. And our industry is

perceived as simple (we have been promoting it like that for over a decade). The larger the team or group of people involved the more difficult to control. And subordinates will not question their

masters… we are doomed!

Page 32: Big guns for small guys (reloaded)

https://en.wikipedia.org/wiki/Law_of_triviality

Page 33: Big guns for small guys (reloaded)

Pareto principle (80-20)80% of effects come from 20% of the causes

20% of code has 80% of errors20% of features provide 80% of functionality

... 20% of staff create 80% of problems

For many events approximately...

Page 34: Big guns for small guys (reloaded)

https://en.wikipedia.org/wiki/Pareto_principle

Page 35: Big guns for small guys (reloaded)

Metcalfe's lawThe cost of interrelated or connected operations increases exponentially with the number of connections:- Testing becomes more expensive as the software grows and

relations increase between components.- Team management gets more complicated fast with the number

of members (meetings, communications between parties, etc).

Page 36: Big guns for small guys (reloaded)

https://en.wikipedia.org/wiki/Metcalfe's_law

Page 37: Big guns for small guys (reloaded)

Parkinson’s lawWork expands so as to fill the time available for its completion.

So if a developer “thinks” that he has a sprint worth of time it will take him one sprint to deliver. But if he thinks he has three days…

You need a Gantt chart to figure this out.

Page 38: Big guns for small guys (reloaded)

https://en.wikipedia.org/wiki/Parkinson%27s_law

Page 39: Big guns for small guys (reloaded)

What do I need?

And what I do not need

Page 40: Big guns for small guys (reloaded)

You need testing.Automated testing.

Choose your flavour and tool and master them (TDD, BDD, PHPUnit, SimpleTests, Selenium, etc). Get used to coding tests as you code features (or before, up to you). Tests are your QA metric, your

benchmark for improvements, your professional standard seal. And, for God's sake, test patches and bug fixes. Identify your smoke

tests and keep them updated.

Page 41: Big guns for small guys (reloaded)

The only valid QA measurements are maintainability and reliability.

No one will care about feature xif the application or site keeps crashing.

And no one will miss feature x if the application runs smoothly and costs peanuts to maintain.

Page 42: Big guns for small guys (reloaded)

The central enemy of reliability is complexity.Geer et al.

Get the idea. It is easier to say than to do.

Page 43: Big guns for small guys (reloaded)

Simplicity is prerequisite for reliability.Edsger W. Dijkstra

Another way to say it.It is important, so let's repeat it.

Page 44: Big guns for small guys (reloaded)

Bultaco Sherpa. My father’s motorbike.Simple, robust, reliable, maintainable. Indestructible.From 1970 to date (46 years in the family!). https://ca.wikipedia.org/wiki/Bultaco_Sherpa_T

Page 45: Big guns for small guys (reloaded)

Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.Rick Osborne

In case you didn’t get it.

Page 46: Big guns for small guys (reloaded)

Cost of (unit) testing?Just a practical trick to

estimate the testing routines required for your code.

Page 47: Big guns for small guys (reloaded)

N-Path complexity.Number of unique paths in a routine.Minimum number of tests required to completely test a routine.

Got it? Me neither.

Page 48: Big guns for small guys (reloaded)

entity_load()NPath: 2

http://blog.ircmaxell.com/2013/05/development-by-numbers-slides.html

Great talk. View it.

Great!Just 2 tests required :)

Use PHPMD (Mess detector) to calculate it.(see PHPQA slide for tool info).

Page 49: Big guns for small guys (reloaded)

drupal_http_request()NPath: 25,303,344,960

http://blog.ircmaxell.com/2013/05/development-by-numbers-slides.html

WTF?

If you like this, you will love CRAP!(Change Risk Analysis Predictions)

Page 50: Big guns for small guys (reloaded)

You do not need CI.

In essence it is a bunch of scripts executed automatically on code commits. You can do it manually on demand and still be cool.

Page 51: Big guns for small guys (reloaded)

You do not need the cloud.Local is good (if you can share it).

See DrupalVM later.

But backup your stuff!

Page 52: Big guns for small guys (reloaded)

Good and now is better that perfect and tomorrow.

In code, testing and love.

Tomorrow never comes.

Page 53: Big guns for small guys (reloaded)

Share your work with other professionals.We can’t do everything under the sun. Outsource work to professionals: development work or supporting tasks (accountancy, contracts, etc).

Specialization leads to efficiency. Efficiency leads to profits.

Page 54: Big guns for small guys (reloaded)

If you think it's expensive to hire a professional to do the job, wait until you hire an amateur. Red Adair Whatever you outsource will

affect your delivery with your client. Find good collaborators and be fair.No client is worth few pennies saved.

Page 55: Big guns for small guys (reloaded)

Prototype in Drupal.Turn web building process around.

Start with Drupal, then Design and finish with Drupal.

I have been championing this for over 7 years.

I am not alone. At last!See following slides

Page 56: Big guns for small guys (reloaded)

https://www.phase2technology.com/blog/static-prototyping-and-keeping-drupal-simple-kds/

Page 57: Big guns for small guys (reloaded)

http://pronovix.com/blog/prototyping-drupal

Page 58: Big guns for small guys (reloaded)

Understand the basicsExample: do not misunderstand technical debt with writing bad code knowingly. Code must be always written as best as we can, with the best understanding of the project at the point. Debt comes from

partial understanding of what you are coding (the project).

Page 59: Big guns for small guys (reloaded)

https://http2.github.io/How many web devs do you know that do not understand

the HTTP protocol? And how many are stuck in 1.0?

Page 60: Big guns for small guys (reloaded)

https://en.wikipedia.org/wiki/Web_cache Understanding web caching is paramount.

Page 61: Big guns for small guys (reloaded)

https://en.wikipedia.org/wiki/Technical_debt Everyone misunderstandsthis concept big time.

Page 62: Big guns for small guys (reloaded)

Sell!Do as little development as possible and as much selling as bearable.

Page 63: Big guns for small guys (reloaded)

Find your unfair advantage.WHat do you do well? What is it that you do much much better than others? Transform it in an advantage. Find a way of using it to

surpass your competitors, to stand out.The more unfair (for others) the better (for you).

Go and find it!

Page 64: Big guns for small guys (reloaded)

Every client thinks he is an unique unicorn.And no one is.

No one.As small guys we are in a great position to manage their delusional dreams. We are their experts, so behave as such and guide the client through a doable plan to succeed. We control the product here. Avoid development spirals.

In big projects with big teams there are too many delusional unicorns to tame.

Not even you, I am afraid. Be pragmatic here.

Page 65: Big guns for small guys (reloaded)

Manage expectations. Communication is key.

Better to say anything early than late.Bad news delivered frequently and with plenty of time are much much better than saved until the very last minute. Most people are quite reasonable if given time to react and respond. Don’t be afraid of

delivering bad news. Shit happens. The sooner we find out the better we are positioned to fix it.

Page 66: Big guns for small guys (reloaded)

Time to market beats features hands downNow and flawed is much better than never and perfect.

Cut down marginal-benefit features ruthlessly. And ship early.Focus on the 20% that will give you the 80ish%.

Page 67: Big guns for small guys (reloaded)

Build a streamlined product and sell it again and again. That is the key to profit.

Companies profit on top of imperfect products.

The whole planet is doing it.Why don’t we do it in “digital” industries?

Why can’t we?

Page 68: Big guns for small guys (reloaded)

Ditch your marketing departmentMarketing is for when the clients find you. It is lazy selling. It promises everything at the expense of development costs.

What small guys need is a hardcore salesperson to sell your “product” to as many clients as possible. They need to be convinced rather than

promised any fancy dreams. Think of profitable actions here..

Page 69: Big guns for small guys (reloaded)

Lie about your professional standards.Do not let the client to dictate them.

This is the only industry where the client decides about the professional standards of the suppliers.

If the client or manager knows you will spend time testing your code, he will try to remove it from the project. Testing is part of your professional standards and responsibility. They can not be removed.

This is insane, madness!

Page 70: Big guns for small guys (reloaded)

http://www.todayonline.com/world/asia/photos-show-felled-building-taiwan-quake-had-tin-can-fillers

February 2016, Taiwan. A new building collapsed like an accordion during a moderate earthquake killing 170 people.It had “tin reinforced” concrete.No engineer could have ever agreed to do that due to professional standards. Draw your conclusions here.

Page 71: Big guns for small guys (reloaded)

Tools

Page 72: Big guns for small guys (reloaded)

Know your tools well.The tools you use do not matter. What matters is how good you are

with them. So… use the web server that you know well!Consider the cost of continuously adopting the “latest buzz thing”:

learning curve, slow development, inefficient development, technical debt, short shelf life of new rapidly changing technologies.

Page 73: Big guns for small guys (reloaded)

The technology you use doesn’t matter as much as what you can do with it. Stop running after the best new thing.

https://www.digitalocean.com/community/tutorials/apache-vs-nginx-practical-considerations

Page 74: Big guns for small guys (reloaded)

Miscellaneous tools

Page 75: Big guns for small guys (reloaded)

https://github.com/ansible/ansible Provisioning at its best. Can’t live without it.

Page 76: Big guns for small guys (reloaded)

http://phpqatools.org/ Every PHP developer should know these. And use them.

Page 77: Big guns for small guys (reloaded)

http://robo.li/ Deployment, installation, tests running, home baked CI...

Page 78: Big guns for small guys (reloaded)

https://thephpleague.com/ S-W-E-E-T-!

Page 79: Big guns for small guys (reloaded)

https://www.jetbrains.com/phpstorm/ Bye bye Eclipse. Paid for, but so good.

Page 80: Big guns for small guys (reloaded)

https://bitbucket.org/ Free private repositories. Say no more.

Page 81: Big guns for small guys (reloaded)

https://www.dropbox.com The cheapest and easiest local backup.

Page 82: Big guns for small guys (reloaded)

Drupal development tools

Page 83: Big guns for small guys (reloaded)

http://drushcommands.com/ Easy to read. Great source to explore drush doc.

Page 84: Big guns for small guys (reloaded)

http://www.drush.org/en/master/make/ Just build Drupal sites with make. Now!

Page 85: Big guns for small guys (reloaded)

http://www.drupalvm.com/ Your local VM as 1,2,3! Packed with goodies.

Page 86: Big guns for small guys (reloaded)

https://reload.github.io/deployotron/ Very interesting. Seems abandoned?

Page 87: Big guns for small guys (reloaded)

https://www.drupal.org/project/profiler_builder A helper for your profiles.For lazy devs or newbies.

Page 88: Big guns for small guys (reloaded)

https://www.drupal.org/project/master Manage config per environment. Yes!

Page 89: Big guns for small guys (reloaded)

https://www.drupal.org/project/paragraphs Everyone is doing paragraphs.Beware of its limitations, by design.

Page 90: Big guns for small guys (reloaded)

Debugging tools

Page 91: Big guns for small guys (reloaded)

https://xdebug.org/ This is a must. Run it from your IDE for maximum gain.

Page 92: Big guns for small guys (reloaded)

http://phpdbg.com/ Were you aware of this?

Page 93: Big guns for small guys (reloaded)

https://addons.mozilla.org/en-US/firefox/addon/firephp/

The most effective debugging tool is still careful thought, coupled with judiciously placed print statements. Brian W. Kernighan (1979)

In case you areold fashioned.

Page 94: Big guns for small guys (reloaded)

https://blackfire.io/features My next toy.

Page 95: Big guns for small guys (reloaded)

Paperwork tools

Page 96: Big guns for small guys (reloaded)

https://stuffandnonsense.co.uk/projects/contract-killer/ Check it now. Go, do it!

Page 97: Big guns for small guys (reloaded)

Testing tools

Page 98: Big guns for small guys (reloaded)

https://www.drupal.org/project/drulenium Wraith in Drupal.Does it get better than this?

Page 99: Big guns for small guys (reloaded)

https://www.phptesting.org/ If you really need CI in house. DIY. PHP, yeah!

Page 100: Big guns for small guys (reloaded)

https://httpd.apache.org/docs/2.4/programs/ab.html The classic benchmarking tool.

Page 101: Big guns for small guys (reloaded)

https://redmine.lighttpd.net/projects/weighttp/wiki Benchmarking.

Page 102: Big guns for small guys (reloaded)

https://github.com/wg/wrk More benchmarking.

Page 103: Big guns for small guys (reloaded)

Design tools

Page 104: Big guns for small guys (reloaded)

http://styletil.es/ Please, please, please designers: embrace this.And atomic design.

Page 105: Big guns for small guys (reloaded)

http://pencil.evolus.vn/ My tool of choice for UX mockups, although not perfect.

Page 106: Big guns for small guys (reloaded)

https://www.lucidchart.com/ It just works. Tidy diagrams.

Page 107: Big guns for small guys (reloaded)

http://uxmyths.com/ Fun and very useful.

Page 108: Big guns for small guys (reloaded)

Which Drupal?

Page 109: Big guns for small guys (reloaded)

Hobby Amateur Professional Enterprise

D6

D7

D8

Drupal reach

Will amateurs ever tinker with Drupal 8?

Page 110: Big guns for small guys (reloaded)

Drupal size

D6

I know it all :)

Page 111: Big guns for small guys (reloaded)

D7

Drupal size

D6 D7

I still know it all :)

Page 112: Big guns for small guys (reloaded)

D8D7

Drupal size

D6 D8D7

WTF? WIll I ever know enough of it?The end of rockstars and solo heroic devs..

Page 113: Big guns for small guys (reloaded)

D8B1D7

Drupal size

D6 B1D7 D8

This is Backdrop. There is still hope to know it all!

Page 114: Big guns for small guys (reloaded)

D6

D7

D8

B1

Drupal size Each “dot” represents a “book of code” of 760 pages, with 72 lines of code per page.

I totally dominate this!

24 volumes of code of 760 pages each! WTF? How many developers do I need in my team to master it?

Page 115: Big guns for small guys (reloaded)

Drupal size

D 6.37 D 7.42 B 1.3.2 D 8.0.3

Files 500 1,100 2,100 12,300

Folders 60 150 330 3,600

Lines 55,000 177,000 230,000 1,300,000

Pages 760 2,500 3,200 18,000

Volumes 1 3 4 24

Calculated using cloc and tree and rounding the numbers for clarity. Each page has 72 lines of code.Drupal 8 includes vendor folder.

988,000 w/o vendor

Page 116: Big guns for small guys (reloaded)

https://backdropcms.org/ The moral is to pick the right tool for your size.

I would rather use Backdrop than Wordpress… don’t quote me on this.

Page 117: Big guns for small guys (reloaded)

Server monitoring

Page 118: Big guns for small guys (reloaded)

https://sensuapp.org/

Page 119: Big guns for small guys (reloaded)

https://mmonit.com/monit/

Page 120: Big guns for small guys (reloaded)

Logs aggregators

Page 121: Big guns for small guys (reloaded)

https://www.elastic.co/products/logstash DIY. Complicated but... powerful!

Page 122: Big guns for small guys (reloaded)

https://papertrailapp.com/ Very easy to set up. Good, not great.

Page 123: Big guns for small guys (reloaded)

https://www.graylog.org/ Very interesting. DIY solution.

Page 124: Big guns for small guys (reloaded)

https://www.loggly.com Very easy to set up. Drupal modules to help.

Page 125: Big guns for small guys (reloaded)

Searching

Page 126: Big guns for small guys (reloaded)

https://www.elastic.co/products/elasticsearch Once you go elastic, there is no other search so fantastic!

Page 127: Big guns for small guys (reloaded)

[email protected]

kurkuma at Drupal.org

Skull icons from http://www.dlanham.com/ui/sticker/