My Way to PHP: Day 2 of 75

Second day. I woke up early today which is a good sign – I still have the a lot of motivation in me to learn more. I’ve just posted the first day of my journey

I just started reading the chapter about databases. The current page is 207. My goal will still be 50 pages which would be the start of the chapter about PDFs.

Let’s go:


PDO has an execute and prepare function. I quite like the syntax of the placeholders. Example:

$statement = $db->prepare("INSERT INTO cars (modelno, type, price) VALUES" 
                          . "(:modelno, :type, :price)");
    
$statement->execute(array(
    'modelno' => 2835,
    'type' => 8,
    'price' => 23000));

Transaction support is also included. Example of a try ... catch with transactions:

try {
    $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
    $db->beginTransaction();
    
    $db->exec(...); // do all the transactional stuff
    
    $db->commit;
} 
catch (Exeception $error) {
    $db->rollback();
    echo "Transaction aborted {$error->getMessage()}";
}

The chapter about graphics. I remember generating graphics for all kind of different things. Mostly however to implement as a signature – your name, your rank, some picture. This was RADICAL back then :P.


I’m quite pleased about the chapter about security. It captures the most important attacks. I also learned about session_regenerate_id() which creates a new session id (either URL or cookie) and umask() to create a file with the correct permission.

Edit: Interesting enough in the appendix they recommend chmod() when using a multithreaded webserver – that is, pretty much always. Strange.


The output buffering can use ob_start() which takes one parameter a callback. Basically you can create all your content and then write a callback function which edits your output again. Quite interesting.

You can also use it for compression (or encryption theoretically).


Customer error handler with set_error_handler(). Great for frameworks you can run in different modes. E.g. in dev mode all errors are displayed to the browser but in production mode all errors are logged into a file.

error_log() provides the base for that. You can either log the error or even send it by e-mail – which is pretty nice!

And I just read that that is basically build in into PHP. If you go into production, you can set the php.ini to:

 display_errors = Off
    log_errors = On
    error_log = /foo/bar/errors.log

A section on performance tuning. Pretty cool. I also like the introduction which focuses on the futility of a lot of premature optimizations. I think the old philosophy of Make it work, make it right, make it fast still applies today.


The bit about interfacing with COM is neat. I’ve never written code interfacing with COM but I can see use it in – especially if your product is for internal use in an office.


There are functions to interface with JSON. You can also take the JsonSerializable interface and implement it with your classes using the method jsonSerialize(). Otherwise it just returns an associative array with all the fields of the class.


Also pretty nice that the book explains the different stages: dev / staging / production. I like it because even new programmers have the chance to be subject to these ideas and hopefully some will adopt them.


DateTime class for all date handling. The design looks good. Times zone handling and diff is build in.


Now I’m reading through the appendix which covers all build-in functions (without modules).

The first cool one is array_combine(). Which takes two arrays, one for keys and one for values. Pretty useful!

var_dump(array_combine(array("Name", "Age", "Location"), array("Peter", 27, "USA")));

/* 
array(3) {
  ["Name"]=>
  string(5) "Peter"
  ["Age"]=>
  int(27)
  ["Location"]=>
  string(3) "USA"
}
*/

array_count_values() returns a frequency distribution of an array:

var_dump(array_count_values(array(3, 4, 1, 2, 3, 3, 4, 0, 3)));

/*
array(5) {
  [3]=>
  int(4)
  [4]=>
  int(2)
  [1]=>
  int(1)
  [2]=>
  int(1)
  [0]=>
  int(1)
} */

array_filter is just the usual filter function but it keeps the keys.

var_dump(array_filter(range(1,5), function ($x) {return ($x > 2); }));

/* 
array(3) {
  [2]=>
  int(3)
  [3]=>
  int(4)
  [4]=>
  int(5)
} */

array_map is a usual mapping function. One main difference to other languages is that it will use the full length of all array arguments and just pad the other one instead of exiting early.

var_dump(array_map(function ($x) { return $x * 2; }, range(1,5)));

/* array(5) {
  [0]=>
  int(2)
  [1]=>
  int(4)
  [2]=>
  int(6)
  [3]=>
  int(8)
  [4]=>
  int(10)
} */

var_dump(array_map(function ($x, $y) { return ($x * $y); }, range(1,20), range(1,5) ));

/* array(5) {
  [0]=>
  int(1)
  [1]=>
  int(4)
  [2]=>
  int(9)
  [3]=>
  int(16)
  [4]=>
  int(25)
} */

call_user_func_array takes a function name and an array and applies it. Similar to apply. You can also use an anonymous function as the first parameter!

function product($a, $b, $c) {
    return $a * $b * $c;
}

var_dump(call_user_func_array('product', array(1,2,3)));

fgetcsv is in the standard lib. I don’t know how good it is but it’s there! And there’s fputcsv for writing csv files.


There are some interesting functions in there. e.h. hypot who calculates the hypotenuse of a right-angled triangle. Or there are time functions which return when the sun rises or sets.


Done! I read the complete book :). I think it was quite solid. There were some discrepancies and typos but overall solid book and it perfectly fit my requirements! And onwards we go!


Next I wanted to read Expert PHP and MySQL Application Design and Development. Let’s see how good it is.

The intro is super interesting. It seems a bit like a printed apprenticeship. Less ‘syntax here and there’ and more ‘here’s how we work’. Exciting!

The implication is that the success of your application development is entirely determined by whether people are satisfied with it. […] Even if your database is in 3NF, your PHP is OO, your HTML uses CSS to separate form from function, you use the latest Agile processes, and you’ve chased down all the bugs, it won’t matter if the people for whom you built the system aren’t satisfied with it.

Beautiful quote. I like how it expands the view of the people. It’s not just direct users, its the stakeholders, too. Try to maximize the happiness but prioritize. Normally, the most important stakeholder is the person who pays you. The rest depends on the circumstances.

I have to say that I love the war stories. I loved them in Skiena’s book and reading edw519’s comments and reading Dreaming in Code. I wonder if there are more books like that.


I like the idea of a prototype and production phase for new kinds of software. The idea is that if you have to plan the development of some kind of innovation start with the prototype first. Present it to the customer and then do the scheduling.


Interfaces that only communicate with the database are easier to manage.

I was pretty much always inclined to work with the database and let it do as much as possible. I find it cleaner and less complex. It’s good to hear that I’m not the only one.

I think I’ve written about this before but I love the UNIX philosophy of everything is a file. A database is kind of a file but it’s decoupled from the language or tool. That is, you can write your frontend in PHP, your scheduling algorithm in Python, your optimizations in C and it’s no problem because there’s this beautiful thing called a file or database which connects without problem to any of them. Or even better, you don’t have to write much code because you can use existing software!


[…] the team will have to keep track of changes to requirements, bugs found in testing, design questions to be resolved, assorted things-to-do, and the like. I call them all issues and enter them into a database so they won’t be forgotten.

[…] What system you use isn’t as important as that you use it for all issues, so there’s only one place to look. E-mails, scraps of paper, text messages, and oral comments should all be entered into the issues tracker.


Requirements should include (specifically for typical PHP/MySQL projects):

  1. Database and it’s main entities
  2. CRUD
  3. Processing (everything more complicated)
  4. Reports
  5. External interfaces
  6. I18N and L10N
  7. Accessibility
  8. User admin (logins / rights)
  9. Billing
  10. Browsers and platforms
  11. Installation
  12. Capacity
  13. Documentation
  14. Training
  15. Support and maintenance
  16. Conversion (from other systems / databases / etc.)
  17. Use cases

MySQL Workbench looks nice I’m definitely going to check that one out!


I found designing databases not that of a hard task – however I’ve never designed gigantic ones.

Here are the four steps from Peter Chen’s The Entity-Relationship Model:

  1. identify the entity set and the relationship sets of interesting
  2. identify semantic information in the relationship sets such as whether a certain relationship set is a 1:n mapping
  3. define the value sets and attributes
  4. organize data into entity/relationship relations and decide primary keys

That’s a great tip for attributes.

If there’s a standard use it

E.g. postal addresses!


In a section about constraints I learned that MySQL (and MariaDB) don’t support check constraints. Really surprising, considering that SQLite even supports them.


generatedata.com is a pretty useful site for generating example data. Check it out!


Super nice, even talks about two-factor authentication!


What I really liked was an application he developed which allowed users to do simple SQL queries, run them and save them. Super nice!

(the access was of course restricted)


The whole chapter data conversion reminds me of a lot of work I’ve done in the past. Old databases which aren’t really supported without any documentation. Inconsistent naming and dates. Errors over time or data just on paper. But somehow I still found it pretty fun! :D


I’m done! I really liked this book because it was so different and so real. It wasn’t the typical theoretical book but rather here’s what I’ve done. I liked the war stories sprinkled in. I’m also impressed that he published basically his own framework. I knew quite some stuff either because I just read Programming PHP or by books I read before or just by experience. But if you’re new that’s an invaluable book!


I wonder which book I should read next. I have two candidates which both are more on the OOP side which I still lack depth in. I think I’m going with a bit of a controversial one judging by the amazon reviews. If it is too bad I just take a look at the other one.

Hereby I start reading Learning PHP Design Patterns.

In no small measure, this book is for those who felt a certain delight when programming was new to them. This is for the developer who thought nothing of working on a program all night long just because it was interesting, staggering off to bed, only to start on another program as soon as he woke up.

That was pretty much me. I’m intrigued


My first was Fortran II in college, then on to Basic, FORTH, PostScript, and then into assembly and machine language. I was more interested in learning about different languages than I was in good programming.

Could have described me. I started off with Pascal (not much), then to PHP, C, Perl, C++, assembly, Python, Javascript, Haskell, Common Lisp, Scheme and Clojure.

I’ve written most of my code probably in Python, Javascript and PHP. And now, like you probably have guessed I try to get my PHP up to date.

However, I actually learned OOP in school. Still didn’t use it much in my private projects. And in the cases I used it the design were pretty simple I can’t remember using inheritance once when writing my own classes. Yep.


Single Responsibility Principle = a class should only have one responsibility


Once a big complex problem has been modularized into solvable subproblems (interfaces / classes), encapsulation is a way of taking the smaller abstractions and compartmentalizing them.

Interesting way to look at design. First we start think about solvable subproblems and afterwards we take a look at the classes and implementations.


On inheritance: The author also recommends do keep inheritance swallow and often just interfaces.

Also a side note: Most of the OOP stuff I read uses examples like the shape example or animals. I think they hurt OOP. Use stuff people solve in real life instead of some artificial problems.


The day is over. I’m quite pleased with my progress. While learning the last two days I was quickly comfortable in PHP again. It will take me some time to get as good as I’m in Python – probably around two years. But I’m on my way.

Updated Goals (19th October)

  • Relearn the basic syntax, keywords, constructs
  • Learn the intricacies: how does the interpreter work, the OOP system, etc.
  • Get a overview over the standard library
  • Learn the right and idiomatic way to do PHP development today
  • Learn the most important pitfalls
  • Learn a bit more about MySQL
  • Learn more about the PHP OOP and Design Patterns
  • Learn Symfony2
  • Write at least one web app using Symfony2 and its core components (templating, testing, forms, validation, security, caching, i18n)
  • Learn all the array functions
  • Learn about functional programming in PHP
  • Read Patterns of Enterprise Application Architecture

Progress status

Done

  • Relearn the basic syntax, keywords, constructs
  • Learn all the array functions
  • Read Programming PHP by Kevin Tatroe, Peter MacIntyre, Rasmus Lerdorf [done]
  • Read Expert PHP and MySQL Application by Marc Rochkind [done]

In Progress

  • Learning PHP Design Patterns by William Sanders [41 of 362 pages]

My Way to PHP: Day 1 of 75

Ok, first day! I will start with the book Programming PHP. I’ve started to read a previous edition of this book years ago – it was the 2006 release, PHP 5.2 just came out. Then I decided to get more into Python.

My goal for today is to get to page 50 which should be pretty easy. Page 50 just covers the while construct. I decided to start off learning the theory first. I like having an idea before writing code. Also I’ve written PHP and PHP-like code (e.g. in C or JS) enough so that it isn’t detremental for my effort.

PHP is a simple yet powerful language designed for creating HTML content

Interesting that they self-identify like that. I’ve watched a talk by DHH about RoR 4 or so. He basically said that the same RoR. It’s a framework to generate HTML. And he wanted it to be good to create document-like stuff on the web.

almost 78% of usage on all the surveyed websites [is PHP] (W3Techs – May 2012)

I just looked up current statistics and now it’s 82% PHP. Followed by ASP (around 13%) and Java (2%).

Idea: Seasteading old-school browser game

While showering I had an idea for my final project. I thought about making one of those old school browser games. No flash, no animations, just good old multiplayer strategy in real-time.


Nice thing. If you increment a character it wraps around automatically:

$char = "z";
$char++; // is now aa

 


Here’s something dangerous. String comparisons aren’t always lexical. If you have at least one string which is entirely numerical PHP will try to do an numeric cast and compare those strings numerically.

"0.123" == ".123"; // is true

Thankfully, there’s === which doesn’t implicitly do type casting.

"0.123" === ".123"; // is false

Variable parameters are a bit strange. Instead of defining something like

function a($a...) or function($a, &$rest) or whatever, you define the function with any parameters.

You can then use func_num_args() to get the number of arguments and func_get_arg($num) to get the argument. Or get an array of the parameters using func_get_args().


Half-complete type hinting: classes, callable, arrays work but scalars not. It throws a run-time error in case the type doesn’t match which is nice.


var_dump() is preferable to print_r(): better handling of booleans, won’t infinite recure, more details


htmlentities() takes 3 arguments. Inputstring, quoting and charset. I noticed in my IT security time that a lot of people used htmlentities() without the quoting argument. This only converts double quotes into the html entity but not single ones.

If you want to encode both use htmlentities($input, ENT_QUOTES);


list() is quite cool. It’s similar to assigning multiple variables in Python. Example in Python:

a, b, _, d = "1 2 3 4".split()

and in PHP:

list($a, $b, , $d) = array("1","2","3","4");

extract() is great. It can take an associative array (aka hashmap) and create variables. It’s second argument, allows variations, e.g. prefixing all new variable names.

$line = array(
    'name' => 'Peter',
    'age' => 27,
    'location' => 'USA');

function do_something($line) {
    extract($line);
    echo $name, $age, $location;
}

array_walk() is superb. I smiled when I read about that function. It’s nearly a map, nearly. :P

$line = array(
    'name' => 'Peter',
    'age' => 27,
    'location' => 'USA');

$print_pair = function ($value, $key) {
    print("Value: $value, Key: $key\n");
};

array_walk($line, $print_pair);

// Value: Peter, Key: name
// Value: 27, Key: age
// Value: USA, Key: location

array_reduce() is actually reduce, neat.

$multiply = function ($total, $value) {
    $total *= $value;
    return $total;
};

echo array_reduce(range(1,4), $multiply, 1); //24

I just wanted to write a map using reduce but saw that there’s even array_map() – hurray! Also array_filter(). Looking at all the array functions is definitely on my list and also checking out functional programming in PHP.


Updated Goals (18th October)

  • Relearn the basic syntax, keywords, constructs
  • Learn the intricacies: how does the interpreter work, the OOP system, etc.
  • Get a overview over the standard library
  • Learn the right and idiomatic way to do PHP development today
  • Learn the most important pitfalls
  • Learn a bit more about MySQL
  • Learn more about the PHP OOP and Design Patterns
  • Learn Symfony2
  • Write at least one web app using Symfony2 and its core components (templating, testing, forms, validation, security, caching, i18n)
  • Learn all the array functions
  • Learn about functional programming in PHP

array_flip() is also quite handy. It exchanges key with value.

$line = array(
    'name' => 'Peter',
    'age' => 27,
    'location' => 'USA');

var_dump($line);

$flipped_line = array_flip($line);

var_dump($flipped_line);

/* 
array(3) {
["name"]=>
  string(5) "Peter"
["age"]=>
  int(27)
["location"]=>
  string(3) "USA"
}

array(3) {
["Peter"]=>
  string(4) "name"
[27]=>
  string(3) "age"
["USA"]=>
  string(8) "location"
}

*/

The whole chapter on Arrays was pretty interesting. The last few pages were dedicated to use arrays as sets and to implement a stack. It’s kinda funny that arrays are so central to PHP but I’ve never heard somebody talk about it.


It’s nice that accessing methods and fields of objects is exactly the same syntax.

class Person {
  public $name = "Adam";
    function print_name() {
      echo "My name is {$this->name}\n";
    }
}

$a_person = new Person;
$a_person->print_name();

echo "His name is really {$a_person->name}\n";

// My name is Adam
// His name is really Adam

While thinking about different approaches to implement stuff in OOP instead of in a DB layer I thought that I need to read more stuff on that. Therefore, I added Patterns of Enterprise Application Architecture which sounds super enterprisy but isn’t that much.

Updated Goals (18th October #2)

  • Relearn the basic syntax, keywords, constructs
  • Learn the intricacies: how does the interpreter work, the OOP system, etc.
  • Get a overview over the standard library
  • Learn the right and idiomatic way to do PHP development today
  • Learn the most important pitfalls
  • Learn a bit more about MySQL
  • Learn more about the PHP OOP and Design Patterns
  • Learn Symfony2
  • Write at least one web app using Symfony2 and its core components (templating, testing, forms, validation, security, caching, i18n)
  • Learn all the array functions
  • Learn about functional programming in PHP
  • Read Patterns of Enterprise Application Architecture

Traits are interesting. It’s basically like a class with static functions which however gives all it’s functions to the class using it. I wonder how much it is used.


Progress status

In Progress

  • Programming PHP by Kevin Tatroe, Peter MacIntyre, Rasmus Lerdorf [206 of 540 pages]

Conclusion

So the first day is over and I felt motivated again.  I had the same or similar feels like in my youth where I just programmed and created something. Without thinking about the next 100 years. It sounds strange but it felt incredible freeing.

My way back to PHP

Motivation

I decided to bite the bullet. A while ago I started to collect some data about job offerings in this region. The distribution of languages is like that:

  • ~40% Java / C# enterprise stuff
  • ~15% Web frontend (HTML, CSS, JS)
  • ~10% Ruby, Perl, Python, etc.
  • ~35% PHP

After reading Thinking in Java by Bruce Eickel I decided that it’s better for my sanity not to program Java all day. I can do frontend dev but I’m not really hyped about it. I think I did my fair share when I was younger. Writing Python would be superb – however, there were only 2 job ads in the last 30 days.

So I bit the bullet. I’m going to learn PHP again or better relearn. I try to be open-minded about it.

edw519 has of course written about this in the past:

Hey you kids, get off my lawn!

[…]

2000s:
Happiness Language:    Lisp
Hack-it-out Language:  C#
Bread and Butter:      PHP

2010s:
Happiness Language:    Lisp
Hack-it-out Language:  Python
Bread and Butter:      Ruby

Ruby didn’t really arrive here – most Jobs are in Berlin from what I can see. Therefore I’m going to stick with PHP. And I agree Lisp is my happiness language and Python my hack-it-out language. It would be awesome to write lisp all day but there’s this thing called demand.

Framework: Zend vs. Symfony2

While looking through a lot of ads I saw that most required experience in some Framework. These two were mentioned the most. I looked around for reviews and finally settled on Symfony2. From what I heard it seems to be the better choice. If not, I can always relearn the other but for now I’m going to stick with it.

The plan

The first good thing is that I written code long enough so that I can transfer most of my skills. I did web development in Python. Written tons of algorithms in Python, Clojure, C and R. So I got that working for me at least.

The learning objectives

Here’s what I want to learn or accomplish:

  • Relearn the basic syntax, keywords, constructs
  • Learn the intricacies: how does the interpreter work, the OOP system, etc.
  • Get an overview over the standard library
  • Learn the right and idiomatic way to do PHP development today
  • Learn the most important pitfalls
  • Learn a bit more about MySQL
  • Learn more about the PHP OOP and Design Patterns
  • Learn Symfony2
  • Write at least one web app using Symfony2 and its core components (templating, testing, forms, validation, security, caching, i18n)

Resources

Here are my main resources for reaching these goals:

  • PHP Manual / docs
  • Programming PHP by Kevin Tatroe, Peter MacIntyre, Rasmus Lerdorf [540 pages]
  • Expert PHP and MySQL Application by Marc Rochkind [340 pages]
  • Learning PHP Design Patterns by William Sanders [362 pages]
  • PHP Cookbook by David Sklar, Adam Trachtenberg [820 pages]
  • PHP The Right Way by Josh Lockhart, Phil Sturgeon [51 pages]
  • Symfony The Book for Symfony 2.5 [258 pages]
  • Symfony The Cookbook for Symfony 2.5 [446 pages]

That will be 1551 pages cover to cover and 1266 pages of recipes. I obviously won’t read the cookbooks cover to cover but rather skim them and read mostly the things that either interest me or I didn’t knew how to do.

Deadline

I think a great deadline would be the end of this year. That is Wednesday, the 31st of December. Starting today (18th October) I will have 75 days to do it or 2 months and 14 days.

This makes my constraint to read at least 30 pages a day on average – I will aim at about 50 pages so that I have more time for development.

The format

I will make notes along the way. They will probably be a bit unorganized. I will regularly post about my progress.

 

And … go!

The Servant as Leader

The Servant as Leader by Robert Greenleaf

Servant-as-Leader-coverThis was the first book I read in 2013. I was a few months in my job as a project manager. I managed projects before and knew that my kind of leadership style is called servant leadership. Therefore, I picked up that book and began reading it. I can’t really remember how good the book was. I will write it down after I made it through my highlights.

It’s full of metaphors and not the classical management book but nonetheless very interesting and insightful.

The book starts off with Herman Hesse’s Journey to the East.

The central figure of the story is Leo who accompanies the party as the servant who does their menial chores, but who also sustains them with his spirit and his song.

The interesting thing about Leo was that he was a servant but also the leader of the group. Therefore the title.

The prophet grows in stature as people respond to his message. If his early attempts are ignored or spurned, his talent may wither away.

hmm. I can’t remember why I highlighted this part but it makes me curious. I think it’s an analogy that if you can’t establish authority/trust early on you can’t lead the group later on.

One does not awake each morning with the compulsion to reinvent the wheel. But if one is servant, either leader or follower, one is always searching, listening, expecting that a better wheel for these times is in the making.

That’s about being humble and don’t expecting the worst from other people. It’s about trusting other people. For me, it was that I listen to experts on my team and not make decisions I didn’t understand. Also I first looked into existing knowledge before trying to come up with my own stuff. There’s a wealth of knowledge out there about practically anything. Buy or rent a book, extract what you’ll need, and you will grow.

Rather, they will freely respond only to individuals who are chosen as leaders because they are proven and trusted as servants. To the extent that this principle prevails in the future, the only truly viable institutions will be those that are predominantly servant-led.

This is something I experienced over and over again. If you show that you care, people will care about what you care. You are a role-model for your team. You don’t have to perfect but if you expect some quality you should demonstrate it yourself. Aka. Do as I do.

By extending education for so many so far into the adult years, the normal participation in society is effectively denied when young people are ready for it.

This was about developing leaders early on. I had the luck of leading early on. There are places for that but you have to take the initiative which – imho – makes a leader. If you wait until someone gives you permission to lead and shows you the ropes, you aren’t really a leader.

It begins with the natural feeling that one wants to serve, to serve first.

That’s also important. Servant leadership isn’t a cheap trick to get people to trust you. It’s about identity. And different styles of leadership work with different people in different situations.

The difference manifests itself in the care taken by the servant-first to make sure that other people’s highest priority needs are being served.

I talked about that before. You have the responsibility over your team. Look up how leaders of tribes acted. They cared about their tribesmen because without them they would die.

The forces for good and evil in the world are propelled by the thoughts, attitudes, and actions of individual beings.

Or without taking good and evil – everything is propelled by individuals and individuals bring change. You can practically look at every invention or movement, etc. it starts with one or a few people.

“If there is no community for you, young man, young man, make it yourself.”

n.c.

By clearly stating and restating the goal the leader gives certainty and purpose to others who may have difficulty in achieving it for themselves.

Purpose. Purpose. Purpose. Why are we doing that?

A leader does not elicit trust unless one has confidence in his values and his competence (including judgment) and unless he has a sustaining spirit (entheos) that will support the tenacious pursuit of a goal.

Aka. trust is composed of two things:

  • Competence: He can do it?
  • Motive: He wants to do it?

If you lack one of the things, you probably won’t be trusted.

I have a bias about this which suggests that only a true natural servant automatically responds to any problem by listening first.

It is because true listening builds strength in other people.

n.c.

One of the arts of communicating is to say just enough to facilitate that leap. Many attempts to communicate are nullified by saying too much.

n.c.

The servant-leader must constantly ask himself, how can I use myself to serve best?

Even more so: Ask your team or listen to it.

The servant always accepts and empathizes, never rejects. The servant as leader always empathizes, always accepts the person but sometimes refuses to accept some of the person’s effort or performance as good enough.

Acceptance of the person, though, requires a tolerance of imperfection.

I think I’ve written about that one also multiple times. If you have a team, you accept them, you fight for them, you don’t betray them.

As a practical matter, on most important decisions there is an information gap. There usually is an information gap between the solid information in hand and what is needed. The art of leadership rests, in part, on the ability to bridge that gap by intuition, that is, a judgment from the unconscious process.

n.c.

One is as once, in every moment of time, historian, contemporary analyst, and prophet—not three separate roles. This is what the practicing leader is, every day of his life.

I like this description. It highlights the different modes of acting. You have to plan, to research, to review and to be present.

Foresight is the “lead” that the leader has. Once he loses this lead and events start to force his hand, he is leader in name only. He is not leading; he is reacting to immediate events and he probably will not long be a leader.

Incredible important. He who sees the future leads to there.

A leader must have more of an armor of confidence in facing the unknown—more than those who accept his leadership.

n.c.

Leadership by persuasion has the virtue of change by convincement rather than coercion. Its advantages are obvious.

n.c.

“Real life is the final test”

n.c.

Perhaps, as with the minister and the doctor, the servant-leader might also acknowledge that his own healing is his motivation.

I noticed that in retrospective. I wasn’t just a leader in an organisation. I acted unconsciously as some kind of parent that I didn’t have. I wonder how I would lead a team now. Probably quite differently.

Others aspire to distinction (or the reduction of problems) by embracing “gimmicks”: profit sharing, work enlargement, information, participation, suggestion plans, paternalism, motivational management. Nothing wrong with these in a people-building institution. But in a people-using institution they are like aspirin—sometimes stimulating and pain relieving, and they may produce an immediate measurable improvement of sorts. But these are not the means whereby an institution moves from people-using to people-building.

I also talked about that multiple times. Try to solve the cause not the symptoms.

And if a flaw in the world is to be remedied, to the servant the process of change starts in here, in the servant, not out there.

There are tons of quotes with the exact same sentiment but I like the one by Emerson the best:

Everybody tries to change the society and nobody gets any better

Joy is inward, it is generated inside. It is not found outside and brought in.

I like this part. It makes me think. I can see several view points. From the psychological stand point of emotions to the work itself. If your work is no fun it doesn’t matter if you can play volleyball in your breaks.

The only way you can do that in a sustained way is through the empowerment of people. And the only way you get empowerment is through high-trust cultures and through the empowerment philosophy that turns bosses into servants and coaches…

n.c.

Servant-leadership is not about a personal quest for power, prestige, or material rewards. Instead, from this perspective, leadership begins with a true motivation to serve others.

n.c.

An a final quote which summaries the book:

The focus of servant-leadership is on sharing information, building a common vision, self-management, high levels of interdependence, learning from mistakes, encouraging creative input from every team member, and questioning present assumptions and mental models.