SlideShare ist ein Scribd-Unternehmen logo
1 von 103
Downloaden Sie, um offline zu lesen
PHPDay 11-05-2018
The way we teach tech Jeroen van der Gulik
About me
❖ Software Architect/ Consultant
❖ Co-Founder Isset
(https://isset.nl)
❖ Señor Developer
❖ Organizer DDDNL
❖ Builder of Artificial Stupidity
❖ @n0x13
shōnen
少年漫画
boy
少年漫画
cartoon or comic
少年漫画
boys' comic
少年漫画
<html>
<head>
<title>My first project</title>
</head>
<body>
<?php echo '<p>Hello World<p>'; ?>
</body>
</html>
Parse error: syntax error, unexpected
'echo' (T_ECHO), expecting ',' or ‘;'
in hello_world.php on line 6
Medior
Senior
Stages of Problem Solving
❖ I just want to solve my problem
❖ I want to understand my problem
❖ I want to be pointed into the right direction and given
options
Context depends on
❖ Knowledge
❖ Experience
❖ Time
❖ Pressure
❖ Interest
No Knowledge
Some
Knowledge
Knowledgable
Just solve my problem √
Understand my problem √
I want options √
final class Example
{
public function doSomething()
{
$this->doAThingThatSometimesFails();
}
}
– John Doe (Jr. Developer)
“I want to log errors”
– Sansa Stark (Sr. Developer)
“Great ! Have you thought about ELK,
Syslog, Splunk or Kafka ?”
final class Example
{
public function doSomething()
{
try {
$this->doAThingThatSometimesFails();
} catch (Throwable $throwable) {
file_put_contents(
realpath('var/log/my.log'),
$throwable->getMessage() . PHP_EOL,
FILE_APPEND
);
}
}
}
final class Example
{
public function doSomething()
{
try {
$this->doAThingThatSometimesFails();
} catch (Throwable $throwable) {
file_put_contents(
realpath('var/log/my.log'),
$throwable->getMessage() . PHP_EOL,
FILE_APPEND
);
}
}
}
final class Example
{
public function doSomething()
{
try {
$this->doAThingThatSometimesFails();
} catch (Throwable $throwable) {
file_put_contents(
realpath('var/log/my.log'),
$throwable->getMessage() . PHP_EOL,
FILE_APPEND
);
}
}
}
final class Example
{
public function doSomething()
{
try {
$this->doAThingThatSometimesFails();
} catch (Throwable $throwable) {
file_put_contents(
realpath('var/log/my.log'),
$throwable->getMessage() . PHP_EOL,
FILE_APPEND
);
}
}
}
– Alice Wonderland (Code Reviewer)
“What if we want to
change the location?”
Code Review
– Alice Wonderland (Code Reviewer)
“Ok much better !
But global variables are
tricky…”
– Alice Wonderland (Code Reviewer)
“What if we want to log to
something else than file?”
interface Logger
{
public function log($message);
}
final class FileLogger implements Logger
{
private $pathToLogFile;
public function __construct(string $pathToLogFile)
{
$this->pathToLogFile = $pathToLogFile;
}
public function log($message)
{
file_put_contents(
realpath($this->pathToLogFile),
$message,
FILE_APPEND
);
}
}
final class Example
{
private $logger;
public function __construct(Logger $logger)
{
$this->logger = $logger;
}
public function doSomething()
{
try {
$this->doAThingThatSometimesFails();
} catch (Throwable $throwable) {
$this->logger->log($throwable->getMessage());
}
}
}
– Alice Wonderland (Code Reviewer)
“Did you know there was a
standard for this?”
– Alice Wonderland (Code Reviewer)
“Do you know about
decorators?”
interface DoSomething
{
public function doSomething();
}
final class LoggableExample implements DoSomething
{
private $example;
private $logger;
public function __construct(Example $example, LoggerInterface $logger)
{
$this->example = $example;
$this->logger = $logger;
}
public function doSomething()
{
try {
$this->example->doSomething();
} catch (Throwable $throwable) {
$this->logger->error($throwable->getMessage());
}
}
}
final class Example implements DoSomething
{
public function doSomething()
{
$this->doAThingThatSometimesFails();
}
}
We explained
❖ Why global variable (state) is bad
❖ Why Dependancy Injection is good
❖ Why Interfaces are good
❖ Why Single Responsibility is good
❖ Why Decorator is useful (sometimes)
Learning or Teaching opportunities
dev-books.com
Pair Programming
Meetups
The Pac-Man Rule
EventStorming
Conferences
Small Controlled Experiments
Absolutes
– Robert Martin a.k.a. Uncle Bob
“The number of programmers doubles
every 5 years. That means, at any time,
half the world's programmers have less
than 5 yrs experience”
The way we should teach tech
❖ People learn best 1 step at the time
❖ Find opportunities to learn or teach
❖ Find mentors/mentees
❖ Create your own Seniors
❖ Never stop learning
Feedback
❖ https://joind.in/talk/d51ab

Weitere ähnliche Inhalte

Was ist angesagt?

Dart, Darrt, Darrrt
Dart, Darrt, DarrrtDart, Darrt, Darrrt
Dart, Darrt, Darrrt
Jana Moudrá
 
Javascript Basics by Bonny
Javascript Basics by BonnyJavascript Basics by Bonny
Javascript Basics by Bonny
Bonny Chacko
 

Was ist angesagt? (20)

Dart, Darrt, Darrrt
Dart, Darrt, DarrrtDart, Darrt, Darrrt
Dart, Darrt, Darrrt
 
Javascript Basics by Bonny
Javascript Basics by BonnyJavascript Basics by Bonny
Javascript Basics by Bonny
 
Web technology html5 php_mysql
Web technology html5 php_mysqlWeb technology html5 php_mysql
Web technology html5 php_mysql
 
Drupal 8 customized checkout system
Drupal 8 customized checkout systemDrupal 8 customized checkout system
Drupal 8 customized checkout system
 
PHP variables
PHP  variablesPHP  variables
PHP variables
 
PHP-Part1
PHP-Part1PHP-Part1
PHP-Part1
 
Introduction to php php++
Introduction to php php++Introduction to php php++
Introduction to php php++
 
Php oop (1)
Php oop (1)Php oop (1)
Php oop (1)
 
Value objects
Value objectsValue objects
Value objects
 
Control Structures In Php 2
Control Structures In Php 2Control Structures In Php 2
Control Structures In Php 2
 
Perl bhargav
Perl bhargavPerl bhargav
Perl bhargav
 
Class 8 - Database Programming
Class 8 - Database ProgrammingClass 8 - Database Programming
Class 8 - Database Programming
 
Starting Out With PHP
Starting Out With PHPStarting Out With PHP
Starting Out With PHP
 
Intro to OOP and new features in PHP 5.3
Intro to OOP and new features in PHP 5.3Intro to OOP and new features in PHP 5.3
Intro to OOP and new features in PHP 5.3
 
Xml dom & sax by bhavsingh maloth
Xml dom & sax by bhavsingh malothXml dom & sax by bhavsingh maloth
Xml dom & sax by bhavsingh maloth
 
Php Tutorials for Beginners
Php Tutorials for BeginnersPhp Tutorials for Beginners
Php Tutorials for Beginners
 
Advanced PHP Simplified
Advanced PHP SimplifiedAdvanced PHP Simplified
Advanced PHP Simplified
 
Defensive Coding Crash Course Tutorial
Defensive Coding Crash Course TutorialDefensive Coding Crash Course Tutorial
Defensive Coding Crash Course Tutorial
 
7.1.intro perl
7.1.intro perl7.1.intro perl
7.1.intro perl
 
Our local state, my, my - Understanding Perl variables
Our local state, my, my - Understanding Perl variablesOur local state, my, my - Understanding Perl variables
Our local state, my, my - Understanding Perl variables
 

Ähnlich wie 2018 05-11 the way we teach tech - phpday

Ähnlich wie 2018 05-11 the way we teach tech - phpday (20)

Building Custom PHP Extensions
Building Custom PHP ExtensionsBuilding Custom PHP Extensions
Building Custom PHP Extensions
 
Drupaljam xl 2019 presentation multilingualism makes better programmers
Drupaljam xl 2019 presentation   multilingualism makes better programmersDrupaljam xl 2019 presentation   multilingualism makes better programmers
Drupaljam xl 2019 presentation multilingualism makes better programmers
 
Living With Legacy Code
Living With Legacy CodeLiving With Legacy Code
Living With Legacy Code
 
So S.O.L.I.D Fu - Designing Better Code
So S.O.L.I.D Fu - Designing Better CodeSo S.O.L.I.D Fu - Designing Better Code
So S.O.L.I.D Fu - Designing Better Code
 
PHP 8: Process & Fixing Insanity
PHP 8: Process & Fixing InsanityPHP 8: Process & Fixing Insanity
PHP 8: Process & Fixing Insanity
 
PHP CLI: A Cinderella Story
PHP CLI: A Cinderella StoryPHP CLI: A Cinderella Story
PHP CLI: A Cinderella Story
 
Php on the Web and Desktop
Php on the Web and DesktopPhp on the Web and Desktop
Php on the Web and Desktop
 
OOP
OOPOOP
OOP
 
Php basic for vit university
Php basic for vit universityPhp basic for vit university
Php basic for vit university
 
OOP is more than Cars and Dogs
OOP is more than Cars and Dogs OOP is more than Cars and Dogs
OOP is more than Cars and Dogs
 
Current state-of-php
Current state-of-phpCurrent state-of-php
Current state-of-php
 
Framework agnostic application Will it fit with Symfony? - Symfony live warsa...
Framework agnostic application Will it fit with Symfony? - Symfony live warsa...Framework agnostic application Will it fit with Symfony? - Symfony live warsa...
Framework agnostic application Will it fit with Symfony? - Symfony live warsa...
 
php
phpphp
php
 
Perl basics for Pentesters
Perl basics for PentestersPerl basics for Pentesters
Perl basics for Pentesters
 
Objects, Testing, and Responsibility
Objects, Testing, and ResponsibilityObjects, Testing, and Responsibility
Objects, Testing, and Responsibility
 
Fatc
FatcFatc
Fatc
 
Hardcore PHP
Hardcore PHPHardcore PHP
Hardcore PHP
 
PHP: The easiest language to learn.
PHP: The easiest language to learn.PHP: The easiest language to learn.
PHP: The easiest language to learn.
 
PHP in one presentation
PHP in one presentationPHP in one presentation
PHP in one presentation
 
Symfony CMF - PHP Conference Brazil 2011
Symfony CMF - PHP Conference Brazil 2011Symfony CMF - PHP Conference Brazil 2011
Symfony CMF - PHP Conference Brazil 2011
 

Kürzlich hochgeladen

Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
chiefasafspells
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
masabamasaba
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
masabamasaba
 

Kürzlich hochgeladen (20)

WSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaS
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
 

2018 05-11 the way we teach tech - phpday