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

2016 - Paul Bailey - A Guide to Bad Programming

PyBay
August 20, 2016

2016 - Paul Bailey - A Guide to Bad Programming

Description
In a sea of talks and information about how to improve your coding skills, this talk will make a case for bad code in your everyday life. In this talk you'll learn how and why you should write bad code.

Abstract
Inspired by "the queen of sh*tty robots" and a talk I had recently with a friend about how often our code "optimizations" and best practices don't matter, this talk will point out some of the obsessions we have as professional programmers that don't matter and can even be harmful to the progress of a product. The talk will show how identifying as a "bad programmer" can improve your skills in the long run and help you become a better programmer. Lastly, the talk will showcase some "bad practices" that can be fine or even good when used appropriately.

Bio
I'm a web developer with a background in aerospace engineering. I'm obsessed with Web technology and created an award winning Chrome application called Neutron Drive (https://super.neutrondrive.com/). I also run the PyWeb Meetup in Houston TX and am a chair person for the PyTexas annual conference. In addition to being a Web and aerospace geek, I'm a father of three and can cook a pretty mean pizza from scratch. I hold a BS in Aerospace Engineering from Embry-Riddle Aeronautical University.

Bio
I'm a web developer with a background in aerospace engineering. I'm obsessed with Web technology and created an award winning Chrome application called Neutron Drive (https://super.neutrondrive.com/). I also run the PyWeb Meetup in Houston TX and am a chair person for the PyTexas annual conference. In addition to being a Web and aerospace geek, I'm a father of three and can cook a pretty mean pizza from scratch. I hold a BS in Aerospace Engineering from Embry-Riddle Aeronautical University.

https://youtu.be/2tpNWcaaOqk

PyBay

August 20, 2016
Tweet

More Decks by PyBay

Other Decks in Programming

Transcript

  1. About Me: Paul Bailey • PizzaPanther ◦ Twitter ◦ Github

    ◦ About.me • Based in League City, TX (near Houston) ◦ Organize PyWeb Houston • Web Developer @ Lead Genius (Berkeley, CA) ◦ Python/Django, Angular, Chrome Extensions ◦ We're Hiring: https://www.leadgenius.com/careers/
  2. Every developer is an idiot. The willingness to admit our

    idiocy and reflect on it is how we measure seniority. Gabor de Mooij : http://gabordemooij.com/index.php?p=/manifest
  3. How to Become a Core Developer: What It Takes When

    you have consistently contributed patches which meet quality standards without requiring extensive rewrites prior to being committed, you may qualify for commit privileges and become a core developer of Python. You must also work well with other core developers (and people in general) as you become an ambassador for the Python project. https://docs.python.org/devguide/coredev.html
  4. You're Awesome, But! • It doesn't matter • Changes ◦

    Technology Changes ▪ Are you developing Python 1 code? ▪ Will you be developing Python 2 code 5 years from now? ◦ Projects Change ▪ Did you build the right thing? ◦ People Change ▪ Are you in the same role you were in two years ago? • Your code is good today but will it be good tomorrow?
  5. Why Should I Identify As A Bad Developer? 1. Sunk

    Cost Fallacy (https://youarenotsosmart.com/2011/03/25/the-sunk-cost-fallacy/): a. The Misconception: You make rational decisions based on the future value of objects, investments and experiences. b. The Truth: Your decisions are tainted by the emotional investments you accumulate, and the more you invest in something the harder it becomes to abandon it. 2. Easier to Accept Feedback. a. Your mind is an elephant and logic is the rider. 3. Improves learning capability: Dreyfus model of skill acquisition a. Developing Expertise: Herding Racehorses, Racing Sheep, By Dave Thomas
  6. Dreyfus Model • Wikipedia Article • Novice ◦ "rigid adherence

    to taught rules or plans" ◦ no exercise of "discretionary judgment" • Expert ◦ transcends reliance on rules, guidelines, and maxims ◦ "intuitive grasp of situations based on deep, tacit understanding" ◦ has "vision of what is possible" ◦ uses "analytical approaches" in new
  7. Dreyfus Model Take Aways • Rules aka "Best Practices" are

    the begining of the learning process • Strict adherence to rules (best practices) can keep you stuck at lower levels • Experts often break the rules or don't even bother to think about them • Because of the intuitive grasp of things experts don't always know why breaking the rules works ◦ Hard to rationalize decisions
  8. Dreyfus Model Take Aways • Being an expert in an

    area is highly dependent on your environment and often narrowly focused • When your environment or area of expertise changes you have to restart the model • You can be an expert and a novice simultaneously
  9. goto Statements • Edsger Dikjstra's 1968: "Go To Statement Considered

    Harmful" ◦ using goto will only produce "spaghetti code" • http://koblents.com/Ches/Links/Month-Mar-2013/20-Using-Goto-in-Linux-Kernel- Code/ • Rob Wilkens: "However, I have always been taught, and have always believed that "goto"s are inherently evil." • Linus Torvalds: "No, you've been brainwashed by CS people .... Any if-statement is a goto. As are all structured loops. Ans sometimes structure is good. When it's good, you should use it. And sometimes structure is _bad_, and gets into the way, and using a "goto" is just much clearer."
  10. Frameworks Are Evil! • Harder to control • Shapes how

    you code • Etc • Libraries: gets messy fast, easier to jump in with • Frameworks: optimized for novices • Are you willing to put in the time to document and train developers on your code base?
  11. Developing on Windows • Yash: "I am afraid to admit

    it with other devs, because developers I have met till now literally hate Windows"
  12. If we can't include Windows users in our culture how

    do we expect to be inclusive with other more important issues?
  13. Deploy Badly • ssh production • cd webapp • git

    pull • supervisorctl restart webapp • Do it Live! • DjangoCon US 2015 - Django Deployments Done Right by Peter Baumgartner
  14. Language X Sucks, Framework Y Sucks, Lib Z Sucks •

    Everything sucks! ◦ Not mature ◦ Doesn't do everything I want ◦ Really messy • Maybe your right but: ◦ Is it becoming popular? ◦ How will it be in the future? • You can learn and be a part of multiple communities
  15. References • You Are Not So Smart ◦ https://www.amazon.com/You-Are-Not-So-Smart/dp/1592406599?ie=UTF8&ref_=cm_sw_su_dp •

    The Righteous Mind: Why Good People Are Divided by Politics and Religion ◦ https://www.amazon.com/Righteous-Mind-Divided-Politics-Religion/dp/0307455777 • Be Bad First ◦ https://www.amazon.com/Be-Bad-First-Things-Future/dp/1629561088 ◦ https://proteusleader.com/topics/be-bad-first