Lessons learned the hard way

Let’s keep these short and to the point.

 

 

Not everyone has a first and last name.

 

Internet connections can cut out at any moment while using a web form.

  • Show a proper error and test for this using your web browser development tools.

  • The fetch api won't have an error response / status code in these cases

 

<select> inputs in HTML without a value attribute in the option tags will submit other-language values if client-side translation is active

  • use <option value="hello">hello</option> instead of just <option>hello</option>

  • Also consider adding translate="no" as an attribute on the <select>

 

Python3’s built in round function will round .5’s towards the even choice

  • round(0.5) == 0, round(1.5) == 2, round(2.5) == 2

  • https://stackoverflow.com/questions/33019698/how-to-properly-round-up-half-float-numbers < Proper way to solve this in python

    # Mirko's Disgusting hack for intuitive rounding (0.5 -> 1) # Don't use this (i do) (assumes positive numbers only, also that you dont care about small decimal points) def rounder(number, ndigits=None): # Just tip the scales towards positive lol return round(number + 1e-8, ndigits)

 

Five generalities Daniel has learned the hard way (evidenced by making the same mistake many times, but recognized eventually.)

  • I’ve had many instances of a priority I had completely forgotten about because I didn't have an effective reminder to come back to it.

    • eg., "do this every six months" -> get a reminder system I trust.

    • For me, that's todoist.

  • Forgetting to document something I needed n months later -> "hey, I should document this new thing while I remember it." -> hey, the second time I needed it, I should document this -> I was lazy and didn't last time. OK, 3rd time's the charm...

  • Multiple times, forgetting to warn an external group of a database schema change that affected them -> "who does this affect?" before pushing the change to prod

  • Most embarrassing: laziness double-checking what server I was on when I changed something or rebooted.

  • Most disrespectful: knowing I made a mistake that I'll have to own up to, and putting it off: does nobody any good.