Starting your journey as a programmer can be daunting and overwhelming. There is so much to learn, so many contradicting sources of information, and so many different opinions about everything. Most of the time we don't get the answers we need or want, but we get vague options that don't really help us all that much. In this talk I discuss the problems we face when teaching others, the problems we face as an industry in a disparity between juniors and seniors and how we can vastly improve the way in which we teach our peers and educate our juniors.
54. 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
76. 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
);
}
}
77. 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());
}
}
}
78. – Alice Wonderland (Code Reviewer)
“Did you know there was a
standard for this?”
82. 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());
}
}
}
83. final class Example implements DoSomething
{
public function doSomething()
{
$this->doAThingThatSometimesFails();
}
}
84.
85. 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)
100. – 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”
101. 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