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

What if Jane Austen had been an engineer?

What if Jane Austen had been an engineer?

As a developer with two English degrees, over the years I’ve identified some concrete ways this education makes me a better developer. This talk will discuss how we can take lessons from literature to write more readable code, make better tests, and create more usable websites. At the end of the day, after all, our job is to write. Surely the techniques of great writers have something to teach us.

In this humanities-based talk, you’ll learn about Freytag’s pyramid and what it has to do with writing clean code, why writing those dastardly outlines before your term papers helped prepare you for your job as an engineer, and see for yourself how The Zen of Python is basically a modern retelling of Strunk and White’s classic Elements of Style. You will leave inspired to go read your favorite book to get some tips for your next project.

Lacey Williams Henschel

October 06, 2018
Tweet

More Decks by Lacey Williams Henschel

Other Decks in Technology

Transcript

  1. What if Jane Austen had been an engineer? Lacey Williams

    Henschel PyGotham 2018 ! @laceynwilliams | @revsys
  2. preface "They all paint tables, cover screens, and net purses."

    -- Charles Bingley @laceynwilliams | @revsys
  3. "... thorough knowledge of music, singing, drawing, dancing, and the

    modern languages, to deserve the word; and besides all this, she must possess a certain something in her air and manner of walking, the tone of her voice, her address and expressions, or the word will be but half-deserved." -- Caroline Bingley @laceynwilliams | @revsys
  4. "All this she must possess, and to all this she

    must yet add something more substan6al, in the improvement of her mind by extensive reading." -- Fitzwilliam Darcy @laceynwilliams | @revsys
  5. If someone has skills in ✦ music ✦ languages ✦

    miscellaneous other skills ✦ nonspecific "person" skills then they are accomplished. @laceynwilliams | @revsys
  6. todo: 1.Have a Person 2.Let that person have skills 3.Decide

    if they are skilled in specific areas 4.Decide, based on their skills, on their overall "accomplished" status @laceynwilliams | @revsys
  7. from django.db import models class Person(models.Model): music = models.BooleanField(default=False) singing

    = models.BooleanField(default=False) drawing = models.BooleanField(default=False) dancing = models.BooleanField(default=False) modern_languages = models.BooleanField(default=False) nonspecific_air = models.BooleanField(default=False) good_walker = models.BooleanField(default=False) good_tone = models.BooleanField(default=False) address_expression = models.BooleanField(default=False) reader = models.BooleanField(default=False) # add more as we need them @laceynwilliams | @revsys
  8. from django.db import models class Person(models.Model): ... def is_accomplished(self): return

    ( self.music and self.singing and self.drawing and self.dancing and self.modern_languages and self.nonspecific_air and self.good_walker and self.good_tone and self.address_expression and self.reader # etc. ) @laceynwilliams | @revsys
  9. When a sentence is made stronger, it usually becomes shorter.

    — Strunk & White, The Elements of Style @laceynwilliams | @revsys
  10. from django.db import models class Accomplishment(models.Model): MUSICAL = 0 LINGUISTIC

    = 1 OTHER = 2 ACCOMPLISHMENT_TYPES = ( (MUSICAL, 'Musical'), (LINGUISTIC, 'Linguistic'), (OTHER, 'Other') ) name = models.CharField(max_length=100) accomplishment_type = models.IntegerField( choices=ACCOMPLISHMENT_TYPES ) @laceynwilliams | @revsys
  11. from django.contrib.auth import get_user_model from django.db import models from accomplishments.models

    import Accomplishment User = get_user_model() class Person(models.Model): user = models.ForeignKey(User, on_delete=models.CASCADE) accomplishments = models.ManyToManyField( Accomplishment, related_name='people' ) @laceynwilliams | @revsys
  12. class Person(models.Model): @property def is_accomplished(self): return ( self.is_musically_skilled() and self.is_linguistically_skilled()

    and self.is_otherwise_accomplished() and self.is_something_in_air() #returns True ) @laceynwilliams | @revsys
  13. Simple is be*er than complex. Sparse is be*er than dense.

    Readability counts. -- Tim Peters, The Zen of Python @laceynwilliams | @revsys
  14. ... your descriptions are often more minute than will be

    liked... — Jane Austen @laceynwilliams | @revsys
  15. class Person(models.Model): @property def is_accomplished(self): return ( self.is_musically_skilled() and self.is_linguistically_skilled()

    and self.is_otherwise_accomplished() and self.is_something_in_air() ) @laceynwilliams | @revsys
  16. 1. !"#$%&' () * 2. +, , #➕( = .

    , $➕) = , 3. )2$ = ⛔ , %4* 4. )* , #4( 5. )4$ @laceynwilliams | @revsys
  17. exposition class Person(models.Model): user = models.ForeignKey(User, on_delete=models.CASCADE) accomplishments = models.ManyToManyField(

    Accomplishment, related_name='people' ) def is_musically_accomplished(self): return self.get_musical_accomplishments() >= 3 @laceynwilliams | @revsys
  18. rising action class Person(models.Model): user = models.ForeignKey(User, on_delete=models.CASCADE) accomplishments =

    models.ManyToManyField( Accomplishment, related_name='people' ) def is_musically_accomplished(self): return self.get_musical_accomplishments() >= 3 @laceynwilliams | @revsys
  19. climax class Person(models.Model): user = models.ForeignKey(User, on_delete=models.CASCADE) accomplishments = models.ManyToManyField(

    Accomplishment, related_name='people' ) def is_musically_accomplished(self): return self.get_musical_accomplishments() >= 3 @laceynwilliams | @revsys
  20. falling action class Person(models.Model): @property def is_accomplished(self): return ( self.is_musically_skilled()

    and self.is_linguistically_skilled() and self.is_otherwise_accomplished() and self.is_something_in_air() ) @laceynwilliams | @revsys
  21. Everything we do involves reading and wri2ng. Everything we read

    and write involves other people. @laceynwilliams | @revsys
  22. It is only a program... or, in short, only some

    work in which the greatest powers of the mind are displayed... in the best-chosen language, Python. — Jane Austen, probably @laceynwilliams | Source: Susan Yin