The document discusses improving documentation for Perl modules like Moose and Catalyst by focusing on providing working code examples and minimizing extraneous information. It advocates for an incremental, "git-based" approach to introducing concepts one by one and advertising examples. Key points made include assuming readers have minimal knowledge, reducing cognitive load, and crowdsourcing documentation improvements through a standard Pod format. Contributors are tasked with improving specific documentation areas by these principles.
Getting big without getting fat, in perlDean Hamstead
Thoughts on keeping your perl code lean as your code base gets bigger. Ideas on API structure for plugins and modules which can help. Some recommended option settings and module suggestions for handling configuration. A passing reference to logging.
A variety of pop culture, tech and start up culture references to keep things interesting.
All feedback welcome
Presented 18/08/2015 at Sydney PM
PHPSpec & Behat: Two Testing Tools That Write Code For You (#phptek edition)Joshua Warren
PHPSpec and Behat are two amazing PHP tools that empower specification-driven development and behavior-driven development. These two tools combined can help you build test coverage, but many people don't realize they can also write much of your code for you. In this talk, we'll see what PHPSpec and Behat can do, through a series of examples and use cases. In other words, I heard you like to code, so I wrote code that writes code while you code.
Presented at #phptek - http://tek.phparch.com
This is the slides I used when I shared my humble insight on Django to the students in University of Taipei in 2016. Please feel free to correct me if there is anything wrong.
If you are new to WordPress, but already know how to program, the typical "Hello, World" examples aren't helpful. You need to know how to make the right API calls, and where to find documentation about the actions and filters that WordPress makes available to you.
This presentation is a brief introduction skimming the surface of the API hook system in WordPress. It does not go into deep detail, but gives brief "real world" examples of how to use filters and actions, along with pointers on where to find the main documentation that will help you get started on your own plugins.
Describes Outside-In development and Behvaiour Driven Development. Illustrates basic Cucumber usage within a Rails app and then goes over more advanced topics such as JS as web services.
Getting big without getting fat, in perlDean Hamstead
Thoughts on keeping your perl code lean as your code base gets bigger. Ideas on API structure for plugins and modules which can help. Some recommended option settings and module suggestions for handling configuration. A passing reference to logging.
A variety of pop culture, tech and start up culture references to keep things interesting.
All feedback welcome
Presented 18/08/2015 at Sydney PM
PHPSpec & Behat: Two Testing Tools That Write Code For You (#phptek edition)Joshua Warren
PHPSpec and Behat are two amazing PHP tools that empower specification-driven development and behavior-driven development. These two tools combined can help you build test coverage, but many people don't realize they can also write much of your code for you. In this talk, we'll see what PHPSpec and Behat can do, through a series of examples and use cases. In other words, I heard you like to code, so I wrote code that writes code while you code.
Presented at #phptek - http://tek.phparch.com
This is the slides I used when I shared my humble insight on Django to the students in University of Taipei in 2016. Please feel free to correct me if there is anything wrong.
If you are new to WordPress, but already know how to program, the typical "Hello, World" examples aren't helpful. You need to know how to make the right API calls, and where to find documentation about the actions and filters that WordPress makes available to you.
This presentation is a brief introduction skimming the surface of the API hook system in WordPress. It does not go into deep detail, but gives brief "real world" examples of how to use filters and actions, along with pointers on where to find the main documentation that will help you get started on your own plugins.
Describes Outside-In development and Behvaiour Driven Development. Illustrates basic Cucumber usage within a Rails app and then goes over more advanced topics such as JS as web services.
Jenkins User Conference 2012
Only by the third plugin do you get the hang of writing a plugin. I thought as a developer coming to the build side of things it'd be easy to jump in and write some plugins. I was wrong. Don't be fooled by the extremely friendly Jenkins community, writing a plugin from scratch is harder than they let on. This talk will explain the hurdles that I had to cross to make writing plugins easy.
Concise guide to starting with Behat.
Covers:
* What is Behat?
* How do you get started with Behat?
* How to write tests?
* How to write good tests!
How to write portable tests, and other common problems.
It contains different concepts of Object Oriented PHP like cloning of object, Inheritance, function overriding, Final function, Error Handling, Exception Handling, Custom error handling class, Uploading a file to the server with different criteria like file size, file type, file extension etc. are discussed in this presentation.
Kindly look at it and give comments to improve it as good as possible ways.
PhpSpec is a SpecBDD tool that enables you to use a TDD workflow that can transform the way you write PHP. In this session we will look at the TDD workflow and see how PhpSpec can be used to speed up your development; add regression safety, and improve your object-oriented design.
Templates in Django - Python, How to use master page in Django using Templates, How to fix TemplateDoesNotExist at error in Django. How to run Django applications in Windows. How a Django view works.
Django is a open source framework written in Python, was designed to save Web developers time and money by promoting the idea of reusing code and avoiding replication. As with any language, programmers interviewing for a job involving Django are going to face a series of specialized questions.
Software projects are rarely on-spec, on-time and on-budget, and the primary cause is miscommunication. As Martin Fowler says, there is a "yawning crevasse of doom" between stakeholders and developers, full of misunderstanding. How do you make sure that you're building something that adds value? How do you know you're building the thing that was asked for? How does your bottom line affect user experience?
Into the fray leaps Cucumber, a business-readable DSL combined with an awesome Ruby library that lets domain experts express business requirements as executable user stories. We'll cover outside-in, story-driven development with Cucumber, how to write effective stories, and how to make Cucumber work for your project.
(as given to CharlotteRuby on Jan 6, 2010)
My colleague Adnan created this slide and on behalf of him i am uploading this slide.
A nice Visual Diagram is there on the SERVER CLIENT concept. Must see for newbie.
Drupal 8: Huge wins, a Bigger Community, and why you (and I) will Love itRyan Weaver
It's true: Drupal 8 includes big and exciting changes to its core and how Drupal code is written. These include using outside PHP libraries (Guzzle, Symfony, etc) as well as embracing PHP 5.4 and object-oriented code.
Scary, right? Definitely not! These changes give Drupal 8 so many "wins" and new possibilities that you're going to absolutely love it.
In this keynote, we'll explore the changes together and start to realize all of the wonderful things that each will bring. These include a (much) larger community, many more libraries you can use, higher quality tools, easier future upgrades, and some fantastic new features.
And because Drupal uses Symfony, you'll easily be able to use Symfony (or its little brother Silex) for any non-CMS projects. Being a great Drupal 8 developer means being a great PHP developer.
Of course, Drupal 8 has its criticisms: it will be too hard for new developers to learn, or it will not be useable for smaller sites. We'll take on these concerns directly and see why they are valid, but exaggerated.
Hiveminder - Everything but the Secret SauceJesse Vincent
Ten tools and techniques to help you:
Find bugs faster バグの検出をもっと素早く
Build web apps ウェブアプリの構築
Ship software ソフトのリリース
Get input from users ユーザからの入力を受けつける
Own the Inbox 受信箱を用意する
今日の話
Jenkins User Conference 2012
Only by the third plugin do you get the hang of writing a plugin. I thought as a developer coming to the build side of things it'd be easy to jump in and write some plugins. I was wrong. Don't be fooled by the extremely friendly Jenkins community, writing a plugin from scratch is harder than they let on. This talk will explain the hurdles that I had to cross to make writing plugins easy.
Concise guide to starting with Behat.
Covers:
* What is Behat?
* How do you get started with Behat?
* How to write tests?
* How to write good tests!
How to write portable tests, and other common problems.
It contains different concepts of Object Oriented PHP like cloning of object, Inheritance, function overriding, Final function, Error Handling, Exception Handling, Custom error handling class, Uploading a file to the server with different criteria like file size, file type, file extension etc. are discussed in this presentation.
Kindly look at it and give comments to improve it as good as possible ways.
PhpSpec is a SpecBDD tool that enables you to use a TDD workflow that can transform the way you write PHP. In this session we will look at the TDD workflow and see how PhpSpec can be used to speed up your development; add regression safety, and improve your object-oriented design.
Templates in Django - Python, How to use master page in Django using Templates, How to fix TemplateDoesNotExist at error in Django. How to run Django applications in Windows. How a Django view works.
Django is a open source framework written in Python, was designed to save Web developers time and money by promoting the idea of reusing code and avoiding replication. As with any language, programmers interviewing for a job involving Django are going to face a series of specialized questions.
Software projects are rarely on-spec, on-time and on-budget, and the primary cause is miscommunication. As Martin Fowler says, there is a "yawning crevasse of doom" between stakeholders and developers, full of misunderstanding. How do you make sure that you're building something that adds value? How do you know you're building the thing that was asked for? How does your bottom line affect user experience?
Into the fray leaps Cucumber, a business-readable DSL combined with an awesome Ruby library that lets domain experts express business requirements as executable user stories. We'll cover outside-in, story-driven development with Cucumber, how to write effective stories, and how to make Cucumber work for your project.
(as given to CharlotteRuby on Jan 6, 2010)
My colleague Adnan created this slide and on behalf of him i am uploading this slide.
A nice Visual Diagram is there on the SERVER CLIENT concept. Must see for newbie.
Drupal 8: Huge wins, a Bigger Community, and why you (and I) will Love itRyan Weaver
It's true: Drupal 8 includes big and exciting changes to its core and how Drupal code is written. These include using outside PHP libraries (Guzzle, Symfony, etc) as well as embracing PHP 5.4 and object-oriented code.
Scary, right? Definitely not! These changes give Drupal 8 so many "wins" and new possibilities that you're going to absolutely love it.
In this keynote, we'll explore the changes together and start to realize all of the wonderful things that each will bring. These include a (much) larger community, many more libraries you can use, higher quality tools, easier future upgrades, and some fantastic new features.
And because Drupal uses Symfony, you'll easily be able to use Symfony (or its little brother Silex) for any non-CMS projects. Being a great Drupal 8 developer means being a great PHP developer.
Of course, Drupal 8 has its criticisms: it will be too hard for new developers to learn, or it will not be useable for smaller sites. We'll take on these concerns directly and see why they are valid, but exaggerated.
Hiveminder - Everything but the Secret SauceJesse Vincent
Ten tools and techniques to help you:
Find bugs faster バグの検出をもっと素早く
Build web apps ウェブアプリの構築
Ship software ソフトのリリース
Get input from users ユーザからの入力を受けつける
Own the Inbox 受信箱を用意する
今日の話
Keep hearing about Plack and PSGI, and not really sure what they're for, and why they're popular? Maybe you're using Plack at work, and you're still copying-and-pasting `builder` lines in to your code without really knowing what's going on? What's the relationship between Plack, PSGI, and CGI? Plack from first principles works up from how CGI works, the evolution that PSGI represents, and how Plack provides a user-friendly layer on top of that.
2019 StartIT - Boosting your performance with BlackfireMarko Mitranić
A workshop held in StartIT as part of Catena Media learning sessions.
We aim to dispel the notion that large PHP applications tend to be sluggish, resource-intensive and slow compared to what the likes of Python, Erlang or even Node can do. The issue is not with optimising PHP internals - it's the lack of proper introspection tools and getting them into our every day workflow that counts! In this workshop we will talk about our struggles with whipping PHP Applications into shape, as well as work together on some of the more interesting examples of CPU or IO drain.
Epistemic Interaction - tuning interfaces to provide information for AI supportAlan Dix
Paper presented at SYNERGY workshop at AVI 2024, Genoa, Italy. 3rd June 2024
https://alandix.com/academic/papers/synergy2024-epistemic/
As machine learning integrates deeper into human-computer interactions, the concept of epistemic interaction emerges, aiming to refine these interactions to enhance system adaptability. This approach encourages minor, intentional adjustments in user behaviour to enrich the data available for system learning. This paper introduces epistemic interaction within the context of human-system communication, illustrating how deliberate interaction design can improve system understanding and adaptation. Through concrete examples, we demonstrate the potential of epistemic interaction to significantly advance human-computer interaction by leveraging intuitive human communication strategies to inform system design and functionality, offering a novel pathway for enriching user-system engagements.
Elevating Tactical DDD Patterns Through Object CalisthenicsDorra BARTAGUIZ
After immersing yourself in the blue book and its red counterpart, attending DDD-focused conferences, and applying tactical patterns, you're left with a crucial question: How do I ensure my design is effective? Tactical patterns within Domain-Driven Design (DDD) serve as guiding principles for creating clear and manageable domain models. However, achieving success with these patterns requires additional guidance. Interestingly, we've observed that a set of constraints initially designed for training purposes remarkably aligns with effective pattern implementation, offering a more ‘mechanical’ approach. Let's explore together how Object Calisthenics can elevate the design of your tactical DDD patterns, offering concrete help for those venturing into DDD for the first time!
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
Securing your Kubernetes cluster_ a step-by-step guide to success !KatiaHIMEUR1
Today, after several years of existence, an extremely active community and an ultra-dynamic ecosystem, Kubernetes has established itself as the de facto standard in container orchestration. Thanks to a wide range of managed services, it has never been so easy to set up a ready-to-use Kubernetes cluster.
However, this ease of use means that the subject of security in Kubernetes is often left for later, or even neglected. This exposes companies to significant risks.
In this talk, I'll show you step-by-step how to secure your Kubernetes cluster for greater peace of mind and reliability.
The Art of the Pitch: WordPress Relationships and SalesLaura Byrne
Clients don’t know what they don’t know. What web solutions are right for them? How does WordPress come into the picture? How do you make sure you understand scope and timeline? What do you do if sometime changes?
All these questions and more will be explored as we talk about matching clients’ needs with what your agency offers without pulling teeth or pulling your hair out. Practical tips, and strategies for successful relationship building that leads to closing the deal.
State of ICS and IoT Cyber Threat Landscape Report 2024 previewPrayukth K V
The IoT and OT threat landscape report has been prepared by the Threat Research Team at Sectrio using data from Sectrio, cyber threat intelligence farming facilities spread across over 85 cities around the world. In addition, Sectrio also runs AI-based advanced threat and payload engagement facilities that serve as sinks to attract and engage sophisticated threat actors, and newer malware including new variants and latent threats that are at an earlier stage of development.
The latest edition of the OT/ICS and IoT security Threat Landscape Report 2024 also covers:
State of global ICS asset and network exposure
Sectoral targets and attacks as well as the cost of ransom
Global APT activity, AI usage, actor and tactic profiles, and implications
Rise in volumes of AI-powered cyberattacks
Major cyber events in 2024
Malware and malicious payload trends
Cyberattack types and targets
Vulnerability exploit attempts on CVEs
Attacks on counties – USA
Expansion of bot farms – how, where, and why
In-depth analysis of the cyber threat landscape across North America, South America, Europe, APAC, and the Middle East
Why are attacks on smart factories rising?
Cyber risk predictions
Axis of attacks – Europe
Systemic attacks in the Middle East
Download the full report from here:
https://sectrio.com/resources/ot-threat-landscape-reports/sectrio-releases-ot-ics-and-iot-security-threat-landscape-report-2024/
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...UiPathCommunity
💥 Speed, accuracy, and scaling – discover the superpowers of GenAI in action with UiPath Document Understanding and Communications Mining™:
See how to accelerate model training and optimize model performance with active learning
Learn about the latest enhancements to out-of-the-box document processing – with little to no training required
Get an exclusive demo of the new family of UiPath LLMs – GenAI models specialized for processing different types of documents and messages
This is a hands-on session specifically designed for automation developers and AI enthusiasts seeking to enhance their knowledge in leveraging the latest intelligent document processing capabilities offered by UiPath.
Speakers:
👨🏫 Andras Palfi, Senior Product Manager, UiPath
👩🏫 Lenka Dulovicova, Product Program Manager, UiPath
Generating a custom Ruby SDK for your web service or Rails API using Smithyg2nightmarescribd
Have you ever wanted a Ruby client API to communicate with your web service? Smithy is a protocol-agnostic language for defining services and SDKs. Smithy Ruby is an implementation of Smithy that generates a Ruby SDK using a Smithy model. In this talk, we will explore Smithy and Smithy Ruby to learn how to generate custom feature-rich SDKs that can communicate with any web service, such as a Rails JSON API.
DevOps and Testing slides at DASA ConnectKari Kakkonen
My and Rik Marselis slides at 30.5.2024 DASA Connect conference. We discuss about what is testing, then what is agile testing and finally what is Testing in DevOps. Finally we had lovely workshop with the participants trying to find out different ways to think about quality and testing in different parts of the DevOps infinity loop.
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Ramesh Iyer
In today's fast-changing business world, Companies that adapt and embrace new ideas often need help to keep up with the competition. However, fostering a culture of innovation takes much work. It takes vision, leadership and willingness to take risks in the right proportion. Sachin Dev Duggal, co-founder of Builder.ai, has perfected the art of this balance, creating a company culture where creativity and growth are nurtured at each stage.
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Jeffrey Haguewood
Sidekick Solutions uses Bonterra Impact Management (fka Social Solutions Apricot) and automation solutions to integrate data for business workflows.
We believe integration and automation are essential to user experience and the promise of efficient work through technology. Automation is the critical ingredient to realizing that full vision. We develop integration products and services for Bonterra Case Management software to support the deployment of automations for a variety of use cases.
This video focuses on the notifications, alerts, and approval requests using Slack for Bonterra Impact Management. The solutions covered in this webinar can also be deployed for Microsoft Teams.
Interested in deploying notification automations for Bonterra Impact Management? Contact us at sales@sidekicksolutionsllc.com to discuss next steps.
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf91mobiles
91mobiles recently conducted a Smart TV Buyer Insights Survey in which we asked over 3,000 respondents about the TV they own, aspects they look at on a new TV, and their TV buying preferences.
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Albert Hoitingh
In this session I delve into the encryption technology used in Microsoft 365 and Microsoft Purview. Including the concepts of Customer Key and Double Key Encryption.
4. My background
Like most perl programmers I’m self taught
But I learned very slowly since 1999
Why?
Programming is 10% of my job and voluntary.
Documentation assumes too much pre-existing knowledge
5. My background - cont
Teaching Statistics for science and business students
They hate statistics, Why?
How can I make them hate statistics less?
The problem of contrived examples.
Our goal is to prime them to deal with real world problems in the
future.
6. How did I solve this problem?
Catalyst
Catalyst::Manual::Tutorial
didn’t work
12:23 <@kd> purl, doesn't work?
12:23 < purl> Look buddy, doesn't work is a strong statement. Does it
sit on the couch all day? Is it making faces at you? Does it want more
money? Is it sleeping with your girlfriend? Please be specific!
Fixed in Catalyst 5.65: 21st Feb 2006 :13 months since the
beginning of the project!
7. Remove irrelevant information:
created "MyApp"
created "MyApp/script"
- created "MyApp/lib"
- created "MyApp/root"
- created "MyApp/root/static"
- created "MyApp/root/static/images"
- created "MyApp/t"
- created "MyApp/t/Model"
- created "MyApp/t/View"
- created "MyApp/t/Controller"
- created "MyApp/lib/MyApp"
- created "MyApp/lib/MyApp/Model"
- created "MyApp/lib/MyApp/View"
- created "MyApp/lib/MyApp/Controller"
- created "MyApp/lib/MyApp.pm"
- created "MyApp/Build.PL"
- created "MyApp/Makefile.PL"
- created "MyApp/README"
- created "MyApp/Changes"
- created "MyApp/t/01app.t"
- created "MyApp/t/02pod.t"
- created "MyApp/t/03podcoverage.t"
- created "MyApp/root/static/images/catalyst_logo.png"
- created "MyApp/root/static/images/btn_120x50_built.png"
- created "MyApp/root/static/images/btn_120x50_built_shadow.png"
- created "MyApp/root/static/images/btn_120x50_powered.png"
- created "MyApp/root/static/images/btn_120x50_powered_shadow.png"
- created "MyApp/root/static/images/btn_88x31_built.png"
- created "MyApp/root/static/images/btn_88x31_built_shadow.png"
- created "MyApp/root/static/images/btn_88x31_powered.png"
- created "MyApp/root/static/images/btn_88x31_powered_shadow.png"
- created "MyApp/root/favicon.ico"
- created "MyApp/script/myapp_cgi.pl"
- created "MyApp/script/myapp_fastcgi.pl"
- created "MyApp/script/myapp_server.pl"
- created "MyApp/script/myapp_test.pl"
+ ... output snipped
created "MyApp/script/myapp_create.pl"
8. Make the supplied code work:
- sub greet : Local
- {
- my ($self, $context) = @_;
+ sub greet : Local {
+ my ($self, $c) = @_;
- my $name = $context->req->params->{name};
- $context->log->debug("Got name: $namen");
+ my $name = $c->req->param('name');
+ $c->log->debug("Got name: $namen");
- if(!$name)
- {
- $context->stash->{message} = 'Please fill in a name!';
+ if ($c->req->method eq 'POST') {
+ if(!$name) {
+ $c->stash->{message} = 'Please fill in a name!';
+ }
+ else {
+ $c->stash->{message} = "Hello $name!";
}
- else
- {
- $context->stash->{message} = "Hello $name!";
}
- $context->stash->{template} = 'greet.tt';
+ $c->stash->{template} = 'greet.tt';
}
9. Show that the code works
Always provide a reference implementation:
The first fully working Catalyst Tutorial:
http://dev.catalystframework.org/old-wiki/attachment/wiki/WikiStart/tutorial.tar.gz
10. This set up the future of Catalyst
Catalyst code is working code
Catalyst educational material is always accompanied by
working code.
11. The original Catalyst tutorial lasted 9 months
Kennedy Clark turned up and wrote a big tutorial
A real published author :)
(we have a history of these in Catalyst)
On to the future
13. Always give examples
You can obtain the code for all the tutorial examples from the
catalyst subversion repository by issuing the command:
svn co http://dev.catalyst.perl.org/repos/Catalyst/tags/
examples/Tutorial/MyApp/5.7/ CatalystTutorial
This will download the current code for each tutorial chapter in
the CatalystTutorial directory. Each example application
directory has the same name as the tutorial chapter.
14. Reduce the barrier to entry
Sometimes OSS programmers can seem hostile.
Aim to only have to answer the same question once.
Write the answer down
In the pod
In the wiki
Teach the bot
15. My most useful factoid
04:45 <@kd> purl, make_schema_at?
04:45 <+purl> make_schema_at is what i want
04:47 <@kd> no purl, make_schema_at is perl -
MDBIx::Class::Schema::Loader=make_schema_at,dump_to_dir:.
/lib -e 'make_schema_at("My::Schema", { debug => 1,
db_schema => "myschemaname", components =>
["InflateColumn::DateTime"] },
["dbi:Pg:host=localhost;dbname=mydbname", "user",
"pass" ])'
04:47 <+purl> okay, kd.
16. Summary:
Always always always provide a working example.
Use your tests as a basis if you want.
Point the users to the tests in the pod if necessary.
Why?
To avoid constantly being asked stupid questions.
17. If you don’t, what happens?
Nobody cares because nobody uses your code.
or: You’re constantly asked stupid questions
or: If you’re lucky, someone like me comes along, asks the stupid
questions, and writes the answers down.
The third option doesn’t happen often.
18. Cognitive Load Theory
An educational technique used in school Maths and Science
Education.
KISS - Keep It Simple Stupid
Working memory has a finite capacity:
7±2 items
We should aim to ensure that only relevant items are presented
to the reader, so their memory capacity isn’t overloaded.
19. The Parts of Cognitive Load
Intrinsic (internal) cognitive load:
Task relevant demands
e.g. Programming logic
Extrinsic cognitive load:
Business logic
Prerequisite knowledge
20. The components of software
Programming logic
Task logic
Business logic
Business logic can be big, complex and poorly defined.
21. Add a dash of chaos theory
e.g. a three parameter model with a
single outcome variable can result in
substantial divergence after a single
change in initial conditions.
It only needs 3 parameters to create chaos.
Business logic always has > 3 parameters
22. How to minimise chaos
Make examples artificial and contrived.
How do we do this without being boring and pointless?
23. Case study. Catalyst Book
LolCatalyst
Translate snippets of text to LolCat.
CPAN module: Acme::LOLCAT
24. Educational purpose
Show how to display a web page
Show how to create a web service
Show that authentication is possible
Catalyst::Helper::AuthDBIC
(or what I spent my time on when I visited Shadowcat to
plan the book)
25. Assumed knowledge
Basic HTTP
GET v POST requests
Basic Perl data structures
What’s an editor and how do I use it?
How do I run a perl script?
How do I install CPAN modules.
26. Assumed knowledge cont.
If the reader doesn’t possess the assumed knowledge the
extrinsic and intrinsic cognitive load are both high.
28. Web service
Catalyst web services are simple
In LolCatalyst/Controller/Root:
sub translate_service : Local {
my ($self, $c) = @_;
$c->forward('translate');
$c->stash->{current_view} = 'Service';
}
In LolCatalyst/View/Service:
package LolCatalyst::View::Service;
use strict;
use base 'Catalyst::View::JSON';
__PACKAGE__->config({ expose_stash => [ qw/lol result/ ] });
1;
29. So far so good.
No business logic
Some programming logic
Basic introduction to some core catalyst concepts
30. A Controller with minimal
business logic
sub default :Path {
my ( $self, $c ) = @_;
$c->response->status(404);
$c->response->body( 'Page not found' );
}
sub translate :Local {
my ($self, $c) = @_;
my $lol = $c->req->body_params->{lol}; # only for a POST request
# $c->req->params->{lol} would catch GET or POST
# $c->req->query_params would catch GET params only
$c->stash(
lol => $lol,
result => $c->model('Translate')->translate($lol),
template => 'index.tt',
);
}
Assumed knowledge
New knowledge
32. We still have room for 4±2
Template View (almost
identical to Service view)
Model:
package LolCatalyst::Lite::Model::Translate;
use strict;
use warnings;
use parent 'Catalyst::Model';
use Acme::LOLCAT ();
use Memoize;
memoize ('translate');
sub translate {
my ($self, $text) = @_;
return Acme::LOLCAT::translate($text);
}
1;
Error trapping (in
Controller::Root):
sub end :ActionClass('RenderView') {
my ($self, $c) = @_;
my $errors = scalar @{$c->error};
if ($errors) {
$c->res->status(500);
$c->res->body('internal server error');
$c->clear_errors;
}
}
Assumed knowledge
Not very different from “normal” programing!
33. The final result
A very simple application
Minimal extra learning
required to understand the
model
Minimal programming logic
features.
What next?
34. Get mst to refactor
Let’s make a generic translation application.
Many more moving parts.
Large conceptual territory to cover
How do we make sure that we only present relevant information
to the reader?
Git based education.
35. Git - the other meaning
Urbandictionary.com:
A completely ignorant, childish person with no manners
Total and utter tosser who is incapable of doing anything
other than annoying people, and not in a way that is funny to
others
Means idiot or rotter. Often used affectionately like bugger,
but when used seriously is probably more potent (but less
rude) than the worst swear words.
36. Git as an educational resource:
the approach
Each commit introduces a single new idea to the reader
Advantages:
Clarity
Disadvantages:
Labour intensive
Need to rewrite history - story telling rather than “real” development
But we can count the number of concepts introduced easily by looking at
the diffs.
38. Case study - Moose Cookbook
The Moose cookbook is generally excellent and comprehensive.
but ...
The early examples are simple, but the become more complex
quickly
Where’s the code?
39. Reducing complexity
Reduce business logic
reduce extrinsic cognitive load
Simplify programming logic
a delicate balance between being meaningful and too
contrived
40. package Point;
package Point;
use Moose;
has 'x' => (isa => 'Int', is => 'rw', required => 1);
has 'y' => (isa => 'Int', is => 'rw', required => 1);
sub clear {
my $self = shift;
$self->x(0);
$self->y(0);
}
41. package Point3D;
package Point3D;
use Moose;
extends 'Point';
has 'z' => (isa => 'Int', is => 'rw', required => 1);
after 'clear' => sub {
my $self = shift;
$self->z(0);
};
42. Where is the code - hidden in
the pod=begin testing
my $point = Point->new( x => 1, y => 2 );
isa_ok( $point, 'Point' );
isa_ok( $point, 'Moose::Object' );
is( $point->x, 1, '... got the right value for x' );
is( $point->y, 2, '... got the right value for y' );
$point->y(10);
is( $point->y, 10, '... got the right (changed) value for y' );
dies_ok {
$point->y('Foo');
}
'... cannot assign a non-Int to y';
dies_ok {
Point->new();
}
'... must provide required attributes to new';
$point->clear();
is( $point->x, 0, '... got the right (cleared) value for x' );
is( $point->y, 0, '... got the right (cleared) value for y' );
# check the type constraints on the constructor
### the remaining test code is not relevant to the example
### and should be elsewhere!!!
45. TIME TO WORK
Contributors should get a copy of:
http://github.com/singingfish/German-Perl-Documentation-Workshop
or
http://xrl.us/bhn6xm
46. Task 1: Moose+DBIC
Lots of interest in how to integrate Moose with DBIC
No example driven documentation on how to do this
No example driven documentation on why you want this
Good starting material:
DBIx::Class::Manual::Example
http://localhost:2963/~frew/DBIx-Class-0.08122/
DBIx-Class-0.08122/lib/DBIx/Class/Manual/
47. Task 2: Better explanation of
Moose Roles
Moose Roles
The existing Cookbook Examples have too much business
logic.
There are inline test examples, but unadvertised
http://localhost:2963/~flora/Moose-1.06/Moose-1.06/
lib/Moose/Cookbook/Roles/Recipe1.pod
48. Task 3: Coercion
Too confusing. Too much cognitive load
Too many ways to do it?
Show the simplest way
Show a more flexible way
Minimise business logic
http://localhost:2963/~flora/Moose-1.06/Moose-1.06/lib/
Moose/Cookbook/Basics/Recipe5.pod
49. Task 4: Better explanation of
metaprogramming
Why metaprogramming?
Why make_immutable
Why not make_immutable
Where’s the simple example working code?
http://localhost:2963/~flora/Moose-1.06/Moose-1.06/lib/
Moose/Cookbook/Meta/Recipe1.pod
50. But ...
I can’t write well
I don’t speak good enough English.
Catalyst Process:
someone writes docs.
kd reviews docs for content (major edits)
the_jester reviews docs for grammar and spelling (minor
edits)
Your writing and language skills don’t matter because
someone else will fix the problems
51. Task 5: Moose::Manual::Index
Let’s crowdsource!
Read a moose perldoc page.
Write down the names of the important concepts
If you want write an explanation
If you can’t work this out, just write the name of the concept
Write a short explanation of the concept.
52. Pod format
Everyone read a Moose man page
Each time you see a new concept, write it down:
=head2 CONCEPT
name of concept
=head3 EXPLANATION
what it does here
=head3 MENTIONS
where it’s mentioned elsewhere in the docs