2014/09/15 09:00 Cristina Videiera Lopes, “Exercises in Programming Style”, PLoP 2014

2014/09/15 09:00 Cristina Videiera Lopes, “Exercises in Programming Style”, PLoP 2014

Plenary address @cristalopes at Pattern Languages of Programs 2014, Allerton Park Retreat Centre, Monticello, Illinois

This digest was created in real-time during the meeting, based on the speaker’s presentation(s) and comments from the audience. The content should not be viewed as an official transcript of the meeting, but only as an interpretation by a single individual. Lapses, grammatical errors, and typing mistakes may not have been corrected. Questions about content should be directed to the originator. The digest has been made available for purposes of scholarship, posted by David Ing.

About 20 participant in the room, laid out classroom style with a large screen projector


Icons:  Art History, Simplified

  • Can recognize Dali style paintings

Have programming styles

  • Ways of expressing tasks
  • Fractal, see in programs, organization, all scales
  • Frozen in programming languages, sense of convention in syntax, forcing people to think in a way:  programming paradigms

Teaching advanced programming, students have a shallow understanding based in the languages they learned

  • How to teach?

Raymond Queneau, Exercises in Style

  • Starts with trivial stories, tells 99 versions of the same story
  • Inquisitive approach, dreamy approach, etc.
  • Gives titles to each style, maybe not translated in the best way from the original French

Oulipo’s styles

  • Based on constraints, that generate creativity
  • To start from the blank page, start from a constraint
  • “A Void” (La Disparition) by Georges Perec:  has a feeling like something is missing, it doesn’t use the letter “e”, so can’t use the natural word

Computational approach, term frequency

  • Eliminate words like software
  • Normalize to lower case
  • List more frequently-occurring words
  • e.g. Pride and Prejudice, mr 796, elizabeth 6358, very 488, darcy 418

First named as style #1, etc., because would get attacked on name, then put the names back in publishing the book

Example with lots of ifs: what are the constraints?

  • No abstraction
  • No use of library functions
  • Monolithic style
  • Diagram:  control flow is overbearing
  • The language was Python, but would have the same constraints in Java

Style #2, 6 lines of code

  • Code golf style, either fewest lines or fewest characters, comes from APL
  • As few lines of code of possible
  • “Try Hard”

Style #3: 1.5 pages

  • Procedural abstraction
  • Shared state
  • Series of commands
  • Cook book style:  first sugar, then add other ingredients

Style #4 seems almost identical, but different

  • Functional abstraction, think in terms of math
  • No shared state
  • Functional composition f o g
  • Pipeline style, chain one thing after the other (a fixed pipeline)

Style #5

  • Like Javascript and Node, a functional form of goto
  • Functions take one additional parameter, f, call at the end
  • Kick forward style

Style #6

  • Things, things and more things, capsules of data and procedures
  • Data is never accessed directly
  • Capsules can reappropriate procedures from other capsules
  • Kingdom of nouns style

Style #7

  • Similar to #6
  • Capsules receives messages via single receiving procedure

Style #8:  concurrency

  • Like Mapreduce, can parallelize
  • Hadoop has another map on the reduce function, then have many partial solutions
  • Two key abstractions, mapping of chunks and reducing to results

Style #9:  not just counting words, extract more knowledge

  • Entities and relations between them
  • Query engine, with declarative queries
  • Persistent table style

Take aways:

  • There are many ways to solve problems
  • Constraints are important for communication
  • Don’t be a hostage of one way of doing things
Advertisements
About

David Ing blogs at http://coevolving.com , photoblogs at http://daviding.com , and microblogs at https://ingbrief.wordpress.com . See .

Tagged with: , ,
Posted in post

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Beyond this microblog
This content is syndicated to Twitter. For professional perspectives, look to Coevolving Innovations; for a photoblog, look to Reflections, Distractions.
  • 2017/01 Moments January 2017
    Toronto, Ontario. (A whole month without leaving town, since Don Mills and Scarborough are Metropolitan Toronto)
  • 2016/12 Moments December 2016
    Helsinki; Finland; London, England; Dublin, Ireland; Toronto, Ontario; Fairfield, Iowa
  • 2016/11 Moments November 2016
    Markham, Ontario; Toronto, Ontario; Scarborough, Ontario; London, Ontario; Montreal, Quebec; Brussels, Belgium; Woluwe Saint Pierre, Belgium; Amersfoort, Netherlands; Hameenlinna, Finland
  • 2016/10 Moments October 2016
    Toronto, Ontario; Richmond Hill, Ontario; Don Mills, Ontario; San Francisco, California; Oakland, California; Berkeley, California; San Jose, California; Mountain View, California; Las Vegas, Nevada; Los Gatos, California
  • 2016/09 Moments September 2016
    Toronto, Ontario (all images within bicycling distance of home)
  • 2016/08 Moments August 2016
    Washington, Iowa; Fairfield, Iowa; Cedar Rapids, Iowa; Toronto, Ontario
Contact
I welcome your e-mail. If you don't have my address, here's a contact page.
%d bloggers like this: