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

Don’t believe everything you learn

Don’t believe everything you learn

A minute always has 60 seconds, right? Wrong! Ok, but a country always has a capital city, right? Wrong again!

Come and join us for a lighthearted talk about some of the common falsehoods that developers believe which cause issues in real, production systems. We’ll cover the classics like timezones and names, as well as some new contenders such as geography and software versions.

Michael Heap

May 12, 2017
Tweet

More Decks by Michael Heap

Other Decks in Technology

Transcript

  1. THINGS THAT WE
    BELIEVE ARE TRUE…

    View Slide

  2. THINGS THAT WE
    BELIEVE ARE TRUE…
    But they’re not

    View Slide

  3. Falsehoods
    programmers believe
    about X

    View Slide

  4. “Constraints placed upon a
    complex system by a
    mixture of ignorance, apathy,
    business requirements, or
    other legal constraints”

    View Slide

  5. Hello!
    I’M MICHAEL
    I’ve made lots of mistakes in the past
    You can find me at @mheap

    View Slide

  6. TIME

    View Slide

  7. The number of days in
    every month starts with a
    3, so either 30 or 31?
    February has 28

    View Slide

  8. Each month has the same
    number of days every
    year though?
    February has 29 in Leap Years

    View Slide

  9. But we can calculate the
    leap years - they're every
    4 years?
    Yes... unless its divisible by 100

    View Slide

  10. But that rules holds all the
    time right?
    Yes… unless you’re Sweden

    View Slide

  11. But we’re agreed,
    February is 28 or 29
    days?
    Yes… unless you’re Sweden

    View Slide

  12. But we’re agreed,
    February is 28 or 29
    days?
    Or the Soviet Union

    View Slide

  13. If we ignore Sweden, Leap Years are
    easy.
    Every 4 years unless it divides by 100
    …unless it doesn’t divide by 400.
    1900 wasn’t a leap year, neither is 2100
    2000 is.

    View Slide

  14. It's a good job that only small
    companies and independent
    programmers have issues with
    leap years though…. right?
    https://azure.microsoft.com/en-us/blog/
    summary-of-windows-azure-service-
    disruption-on-feb-29th-2012/

    View Slide

  15. TIME

    View Slide

  16. A month starts and ends
    in the same year
    Unless you’re an ancient
    Roman

    View Slide

  17. A month starts and ends
    in the same year
    Or modern Ethiopian

    View Slide

  18. Time always goes
    forwards
    Unless you’re in Shanghai
    1927-12-31 23:54:08 happened twice

    View Slide

  19. MODERN TIME

    View Slide

  20. The day before Saturday
    is always Friday.
    Unless you’re in Samoa in 2011

    View Slide

  21. The offsets between two
    time zones will remain
    constant.
    10 changes in 2016
    2 so far this year

    View Slide

  22. If they do change there’ll
    be plenty of notice
    North Korea gave 8 days' notice of a 30
    minute change in their time zone in 2015

    View Slide

  23. When they do change,
    they change by an
    integer number of hours
    UTC+04:30 Afghanistan
    UTC+12:45 New Zealand (Chatham Islands)

    View Slide

  24. Ok… so 15 minutes then?
    That’s safe?
    UTC-00:25:21 - Dublin Mean
    Time

    View Slide

  25. Audience
    Participation

    View Slide

  26. When are there more or
    less than 24 hours in a
    day?
    Daylight savings time!
    Means 23 or 25 hours in a day

    View Slide

  27. Is the time 23:59:60
    invalid?
    When leap seconds are inserted,
    a minute will be 61 seconds long.

    View Slide

  28. NAMES
    Michael

    View Slide

  29. A child will have the same
    surname as either their
    mother or father (or both)
    Not in Iceland

    View Slide

  30. People have at least two
    names
    Teller (of Penn and Teller fame)
    Akihito (Emperor of Japan)

    View Slide

  31. However many names they
    have... People’s names do
    not contain numbers
    John5… but that’s a stage name

    View Slide

  32. However many names they
    have... People’s names do
    not contain numbers
    How about K8lyn? (Kaitlyn)
    Ok.. it was actually KVIIIlyn

    View Slide

  33. For every rule you come up
    with there are guaranteed to
    be hundreds of exceptions

    View Slide

  34. For every rule you come up
    with there are guaranteed to
    be hundreds of exceptions
    No spaces
    van Buren

    View Slide

  35. For every rule you come up
    with there are guaranteed to
    be hundreds of exceptions
    Only letters
    O’Reilly

    View Slide

  36. For every rule you come up
    with there are guaranteed to
    be hundreds of exceptions
    One capital letter
    McDonald

    View Slide

  37. Audience
    Participation
    Michael

    View Slide

  38. “A name must contain one
    or more alphanumeric
    characters”

    View Slide

  39. View Slide

  40. I can safely assume that
    this dictionary of bad words
    contains no names in it.

    View Slide

  41. I can safely assume that
    this dictionary of bad words
    contains no names in it.
    Ever been to Middlesex?

    View Slide

  42. I can safely assume that
    this dictionary of bad words
    contains no names in it.
    Or eaten Shitake
    mushrooms?

    View Slide

  43. I can safely assume that
    this dictionary of bad words
    contains no names in it.
    Been named Craig
    Cockburn?

    View Slide

  44. I can safely assume that
    this dictionary of bad words
    contains no names in it.
    Or Linda Callahan?

    View Slide

  45. What about less obvious
    ones?
    Super Bowl XXX?

    View Slide

  46. Planning permission
    emails bouncing
    They talked about
    erection of a structure

    View Slide

  47. The sad story of
    Christopher Null
    if lastname = null then… well, then try
    again with a lastname that isn’t “null.”

    View Slide

  48. Addresses

    View Slide

  49. When there is a building
    number, it will be all-
    numeric
    1A Egmont Road, Middlesbrough, TS4 2HT

    View Slide

  50. No buildings are
    numbered zero
    0 Egmont Road, Middlesbrough, TS4 2HT

    View Slide

  51. If the addresses on the left of
    the road are even, the
    addresses on the right must be
    odd
    You can have even numbers on both sides.. but
    that’s not the interesting part

    View Slide

  52. Well, at least you can
    omit leading zeros
    101 Alma St, Palo Alto - where apartments 1 and 001
    were on different floors.

    View Slide

  53. A street name won't
    include a number
    8 Seven Gardens Burgh, Woodbridge, IP13 6SU

    View Slide

  54. OK, but at the very least
    you wouldn't name a
    town Street
    Actually there's a town called Street in Somerset,
    UK.

    View Slide

  55. You can't have two towns
    or cities with the same
    name in the same country
    The UK has three towns called Newport.

    View Slide

  56. OK, but those cities won't
    have duplicate street
    names
    10 High Street, Newport, PO30 1SS
    10 High Street, Newport, NP20 1FQ
    10 High Street, Newport, TF10 7AN

    View Slide

  57. OK, but you don't get
    multiple postcodes per
    building
    DVLA Swansea:
    V5Cs are processed at SA99 1BA,
    Driving licences at SA99 1AB

    View Slide

  58. But street names will be
    reasonably short - certainly
    less than 50 characters
    Aleja Alije Izetbegovića Prvig
    Predsjednika Predsjedništva Republika
    Bosna i Hercegovina

    View Slide

  59. Addresses are a fixed
    point in space
    BF1 4FB

    View Slide

  60. Concrete buildings are a
    fixed point in space
    In Zürich, a 6200 ton building was
    moved by 60 meters to make way for
    railway tracks

    View Slide

  61. Audience
    Participation

    View Slide

  62. Do all countries have a
    capital city?
    Switzerland does not. The
    government is currently in Bern,
    but the city is not the capital.

    View Slide

  63. Commerce

    View Slide

  64. A product has a price
    Products sold on auction site do not
    yet have a price. The moment the
    price is known is actually the moment
    the item will not be on sale anymore.

    View Slide

  65. Except for auctioned
    items, products have one
    price
    Price with tax, price without tax,
    sale price, list price, minimum
    price

    View Slide

  66. Currencies symbols
    uniquely identify a
    currency.
    The peso and dollar sign $ is used
    my many countries: USA, Cananda,
    Australia, Brunei, Namibia

    View Slide

  67. Currencies have a
    unicode symbol that
    represents them
    The Swiss franc does not, and
    until 2010, neither did the India
    rupee

    View Slide

  68. Audience
    Participation

    View Slide

  69. Which currency does not
    have a three letter
    identifier?
    The Canadian dollar:
    CA$

    View Slide

  70. Computers

    View Slide


  71. The network is reliable.
    Latency is zero.
    Bandw
    idth is infinite.
    The network is secure.
    T
    opology doesn't change.
    There is one administrator.
    T
    ransport cost is zero.
    The network is homogeneous.

    View Slide


  72. (?:(?:\r\n)?[ \t])*(?:(?:(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:
    \r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?
    [ \t]))*"(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\
    \.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\]
    (?:(?:\r\n)?[ \t])*))*|(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:
    \r\n)?[ \t])*)*\<(?:(?:\r\n)?[ \t])*(?:@(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:
    \r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:
    \r\n)?[ \t])*))*(?:,@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:
    \r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:
    \r\n)?[ \t])*))*)*:(?:(?:\r\n)?[ \t])*)?(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?
    [ \t]))*"(?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:
    (?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]
    \r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|
    \\.)*\](?:(?:\r\n)?[ \t])*))*\>(?:(?:\r\n)?[ \t])*)|(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:
    (?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)*:(?:(?:\r\n)?[ \t])*(?:(?:(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:
    [^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\
    [\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\
    ["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\
    ["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*|(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:
    [^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)*\<(?:(?:\r\n)?[ \t])*(?:@(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\
    \".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\
    [\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*(?:,@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\
    [\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|
    \[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*)*:(?:(?:\r\n)?[ \t])*)?(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:
    [^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\
    [\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\
    ["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\
    ["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*\>(?:(?:\r\n)?[ \t])*)(?:,\s*(?:(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|
    (?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?
    [ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:
    (?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:
    \r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*|(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\
    ["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)*\<(?:(?:\r\n)?[ \t])*(?:@(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?
    [ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])
    +|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*(?:,@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|
    \Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?
    =[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*)*:(?:(?:\r\n)?[ \t])*)?(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\
    ["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])
    +|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:
    \r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:
    \r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*\>(?:(?:\r\n)?[ \t])*))*)?;\s*)

    View Slide

  73. In Summary
    Computers are hard
    Humans make assumptions
    Things are never as simple as
    they seem.
    Ask questions, find out more. It’ll
    make life easier in the long run

    View Slide

  74. Thanks!
    I’M MICHAEL
    You can find me at @mheap

    View Slide