Notes 2 Myself

Damian Conway

 

The Mind of Damian Conway: Science, Computer Science, the Future of Perl 6, and Advice for Today’s Aspiring Programmers

 

 

Damian Conway

The 7 Principles of Better API Design

This course presents a minimalist approach to interface design known as “S.A.T.” Developed by Damian Conway over the past decade, this design philosophy can produce smaller, better-focused, more usable module APIs.

The seven principles are:

  1. Do one thing really well
  2. Design by coding
  3. Evolve by subtraction
  4. Declarative trumps imperative
  5. Preserve the metadata
  6. Leverage the familiar
  7. The best code is no code at all

All these topics covered will be explored and illustrated by examining the interfaces and implementations of commonly used modules from the Perl standard library and the CPAN (many of which were designed by Conway himself).

One of the major challenges of using Perl in a real-world development environment is that Perl’s “More Than One Way To Do It” philosophy often means there are far too many choices when it comes to solving a particular problem with the language. When everyone is free to do it their own way, they often do so at the expense of maintainability, usability, and sometimes even performance.

This session follows on from last year’s class, exploring still more coding practices that can help you produce robust, maintainable, and efficient Perl programs.

When a dying operating system scrawls his name across its corrupted boot volume, Dr. Damian Conway, an unassuming college professor, is plunged into a deadly race against time to solve a series of impossible riddles. What is the mysterious “Priory of Bios?” And who are their deadly nemeses “Opus Arai?” On the run from the law and stalked by a ghostly pale killer, will he unravel the subtle clues hidden in Leonardo’s most famous source code and reveal to the world the incredible secret encrypted in…the Da Vinci Codebase?

Perl6 will be a major improvement on Perl 5 in many ways: syntactically, semantically, performance-wise. This class looks in depth at the features of the new version of Perl, and at many of the programming techniques those features make available. Numerous real-world examples of porting Perl 5 code to Perl 6 are shown.

Day 1, AM: Perl 6 Fundamentals

Overview of the project, virtual machine architecture, compilers, new dereferencing syntax, new sigil syntax, variable declarations, static variables, constants, concatenation operator, Unicode, strictures and warnings, new output statement, interpolation blocks, new heredoc syntax, ranges, string lists, key lists, pairs, string manipulation methods, other operator changes, pipelines, defaulting operators, operator precedence, hyperoperators, reductions, junctions, sets, chainable comparators, smartmatching, variable binding, subroutines, option pairs, switch statement, contextual awareness, filehandles, autochomping, serialization, file slurping.

Day 1, PM: Perl 6 Core features

Introspection, pod rationalization, modules, blocks, closures, and subroutines, implicit parameter lists, argument binding, control statements, topics, C-style for statement, Perl-style for statement, no assignments in conditionals, sorting, operator overloading, stubbing, error variables, exceptions.

Day 2, AM: Perl 6 pattern matching:
regexes, rules, and grammars

Classes, attributes, methods, class attributes and methods, implicit invocants, inheritance, submethods, object construction, reflexive method calls, object creation, object destruction, multiple dispatch, roles, subtypes, enums.

Day 2, PM: Object Oriented Perl 6

Regular expressions, unchanged features, modifiers, changed metacharacters, new metacharacters, new regex repetition qualifier, bracket rationalization, variable (non-)interpolation, extensible metasyntax, backslash reform, backtracking control, regex match variable, regex capture variables, hierarchical regex captures, subrule capturing, hypothetical variables, matching against non- strings, regex declarations, named regexes, grammars.

This tutorial will show you how to build on the object-oriented Perl techniques you already know and unlock the full power of Perl’s OO capabilities.

In the full two-day course you will learn:

  • how (and when) to bless arrays, scalars, typeglobs, and subroutines;
  • three different ways to implement data hiding for Perl objects (including the Tie::SecureHash module);
  • how Perl implements inheritance and polymorphism (and how you can change the rules of either);
  • advanced polymorphic programming techniques (including virtual constructors);
  • advanced method redispatch techniques (especially under multiple inheritance)
  • how to simulate scalars, arrays, hashes, and typeglobs using ties;
  • the use of tie-based proxies in OO Perl
  • the features (and traps) of operator overloading in Perl;
  • easy ways to build complete classes (semi-)automatically;
  • how to do design-by-contract programming in OO Perl (using the Class::Contract module);
  • how to use multiple dispatch (an advanced form of polymorphism).

The one-day version covers the following subset of the material: array- and scalar-based classes, encapsulation (one of the three techniques), inheritance and polymorphism, automatic class construction, and operator overloading.

Comment Form

 

October 2008
M T W T F S S
« Sep    
 12345
6789101112
13141516171819
20212223242526
2728293031  

Blog Stats

  • 5,257 hits

RSS Digg

  • An error has occurred; the feed is probably down. Try again later.

RSS Digg Videos

  • An error has occurred; the feed is probably down. Try again later.

Flickr Photos

IMG_0191

IMG_0190

IMG_0189

IMG_0188

IMG_0187

IMG_0186

IMG_0185

IMG_0184

IMG_0183

IMG_0182

More Photos