PHP in 2020 it’s not your mama’s PHP

I decided to write this post, because before joining Facebook I thought that PHP is just old, limited language from 2 decades ago when server was responsible for simple form parsing, and generating HTML.

I actually learned web development using PHP in mid-2000s, when I was in middle school. I created my personal blog, and website about very popular back then game Deluxe Ski Jump. I actually still have the source code and recently put it on Azure at – it is in polish, and there is no database:P Didn’t bother to update character encoding from ISO-8859-2 to UTF. Why I used ISO-8859-2? Because my cousin told me to do so! It was real copy/paste programmer back then! Good times 😀

Mark Zuckerberg wrote first version of Facebook around that time using PHP too. LAMP stack was the way to go for web development in 2000s.

A few days after joining facebook I realized that PHP now is full blown OO language. It has classes, interfaces, abstract classes, dependency injection, etc. It is much closer to C# or Java than to PHP that I used to write 15 years ago. At facebook we use Hack (typed PHP). It’s awesome. You have the best of two Worlds: type safety and no compilation! Just save, and refresh to see your changes. Yay! As pure PHP performance is not the best, HHVM performance is an improvement.

In PHP, you can access pretty much every module in the codebase without explicitly referencing it. That’s an extra productivity boost. Or hack:) Intellisense in editors like Nuclide (Atom) or VSCode is pretty good as well. When you add Facebook engineering systems, where everything is so neatly setup to prioritize productivity, you are in heaven 🙂 I know most of PHP devs do not have that luxury, but just sayin’ 😉

If you want to learn more about modern PHP, check out these resources:

As of February 2020, PHP is 5th most popular language on StackOverflow (source)! Just recently taken over by python.

In any means I am not recommending you to learn PHP if you don’t have to. Choose Rust or Go instead! Just wanted to let you know, that PHP changed A LOT! PHP in 2020 is not PHP from Web 1.0 times.

Hello, Startup – 360 overview of running tech business

Hello, Startup

Some time ago, Remo Jansen recommended me to check out awesome book Hello, Startup by Yevgeniy Brikman. I finally got into it, and I need to admit that it is a gem describing startup and tech World end-to-end.

Here are my key take aways:

  • Building successful company requires give or take 10 years (this is short overview why from other source).
  • These 10 years are not 955 work weeks, it’s 996 on the good days.
  • Tip: Have a notebook to write down any idea that comes to your mind. Even the most stupid one! You will be surprised when a few years later someone turn it into the product. Someone, but not you.
  • New business recipe: copy, transform, combine.
  • Initial startup idea requires many iterations. Always! Yevgeniy gives a lot of simple examples including creating resume (from very raw to very nice looking).
  • Doing things that don’t scale is ok at the beginning to validate the idea, you can automate later. Launching business that automates something? Hire vendors that would do it manually, and once it take off hire developers who will automate it. As automation and scaling is usually much more expensive.
  • Metrics to track:
    • acquisition – its sources, conversions and cost
    • activation – how many new users engage with the product, and why
    • retention – how many users stays after week, month, year…
    • referral – channels and conversions
    • revenue – month over month, year over year, CLV (Customer Lifetime Value)
    • magic number – e.g. once facebook user connects with 7 friends within 10 days they usually become highly engaged, for twitter it takes following 30 people, and for Slack – exchanging 2000 messages (how to find insights like that by Andrew Chen)
  • Data-Driven Development: idea -> develop MVP -> A/B Test -> Release (requires well defined metrics and measurement tools)
  • Distribution channels for startups:
    • word of mouth
      • build better product
      • great customer service
      • build viral loops into your product
    • marketing
    • sales
      • automated – website checkout
      • inside – sales representatives at the store, or by phone
      • outside – “traveling salesmen”
    • branding (Apple = “Think different”, Red Bull = extreme sports, Nike = great athletes)
  • Use OSS and buy SaaS solutions for everything, but your competitive advantage (“secret sauce”).
  • Align tech stack with current market trends (in 2020 it’s much easier to hire React developer than Backbone developer).
  • Against Joel Spolsky opinion that rewrite is worst thing you can do, these days startups often change technologies (Twitter migration from RoR to Scala, Coursera moved from PHP to Scala or AirBnB is moving from React Native to pure native). Thus do not worry too much about stack choice – treat it as it will eventually be rewritten. Microservice architecture over monolith helps with that!
  • Keep code clean! Good naming, conventions, DRY, SRP, tests. It can bite even within first year. Especially because at  Startup you will be constantly evolving existing code!
  • Company culture (mission and values) helps to avoid processes. People can trust each other to do the right thing.
  • First 5-10 hires can kill or make your company successful. Look for: “smart and get things done“, culture fit, communication skills and “would you be ok reporting to them?”.

This book is GOLD! I strongly recommend everyone to read it. Besides awesome 360 overview of startup World, there is a lot of great insights into everyday developer’s life. It’s worth to remember that pretty much every tech company is a startup…just in different phase.

If you are still in doubt, this book has 4.9/5 rating on Amazon and 4.45/5 on goodreads!

There is one quote from the book that I would like to finish this summary with:

I started asking, “What are the important problems of your field?” And after a week or so, “What important problems are you working on?” And after some more time I came in one day and said, “If what you are doing is not important, and if you don’t think it is going to lead to something important, why are you at Bell Labs working on it?”

Richard Hamming, You and Your Research

Don’t hate the player! Hate the game!

Over years, I noticed that people develop a grudge against coworkers or their bosses.

Often, if not always, this is caused by others goals and job constraints.

Example: “I deserved a promotion, but I didn’t get it because HE/SHE THINKS I DIDN’T DESERVE IT”. Usually this is caused by manager having budget and needing to play bonus allocation tetris AKA calibration. Probably (most likely) if he didn’t have these constraints it would look differently.

Another example: “I hate this guy. He is always against me.”. The reason why somebody oppose an idea is usually because of reasons. Reasons are caused by constraints a person operates in, and past experiences.

Of course somebody may just not like you. That happens too.

Maybe I’m the luckiest employee in the World, but over 7 years I didn’t have boss that sucked. Did I work with some people who didn’t like me? Probably, but I was always focused on solving problems, and cared less about their personal feelings. It also happened to me that I didn’t get promotion/bonus when I deserved it. However, after digging in, I understood why, and it was because of constraints others operated in.

A few years ago, while learning about AI from Peter Norvig (director of research at Google), I learned about Paradox of Rationality – people making rational decisions often end up with worse outcome if they would make irrational decisions. This is foundation of game theory, and obviously happens in life. Did you see irrational outcome coming out of congress lately? Do you think it’s because politicians are stupid? Maybe it’s because of how the game is setup?

Don’t hate the player! Hate the game! Your life will be better 🙂

Facebook Bootcamp is the best thing in the World

After 5 years at Microsoft I joined company, which product I’ve been using for last 12 years :O

12 years at facebook

Before I forget how amazing it was, I wanted to drop a few lines about Facebook Engineering Bootcamp.

When you are about to join typical company you have to make a decision whether it’s a good fit for you. Usually it’s based on 4 or 5, hour long LeetCode sessions with different members of the team. Of course you talk to your future manager, HR is telling you how great it’s gonna be etc.

Facebook does it differently! Your are being interviewed by people from different teams across the company. Not necessary from the team that you are going to join. It’s actually very unlikely that you gonna end up working with any of them. This allows to remove bias, and make interviewing a fair game. Microsoft and Amazon have huge variation between teams. Somebody who wouldn’t pass interview in one team can be a rockstar in other team.

After you pass the interview and join Facebook, you start as bootcamper. You have usually 6-8 weeks to learn facebook engineering systems, and to find a team. You can to talk to as many teams in the company as you want. These are not interviews, but informal chats. Usually short 30 mins meeting, quick coffee or lunch. Some people call it “Facebook Dating” 😀

Once you determine that there is “chemistry” between you and your future manager, or somebody from the team, then you usually work with that team for a couple of days or a week. Like a real work! They give you desk in their open space area, you get some easy task that is related to what they are working on, and you are a team member for the time being.

Don’t worry about good and bad teams. At Facebook there are only different teams 🙂 I was surprised how everybody I met during bootcamp had slightly different interests and all of us decided to join different teams :O

Usually you want to “try” a few teams to have comparison, and to make connections that might help you in the future. E.g., when you will need to work with different team, or when you will be changing teams. This is the best part of the bootcamp. You can literally give you future job a trial run.

I graduated from bootcamp last week and joined Facebook Marketplace Growth team.

I’ll probably drop a few lines about Facebook Engineering systems in separate post, but I’ll just tell you this: imagine that you can have all your wishes regarding engineering systems fulfilled, and it’s better than that 🙂

If you want to learn more about bootcamp check this note 🙂

Leaving Microsoft…

reseting Microsoft PC

Last Friday, September 13th was my last day at Microsoft. Coincidence was that it was Programmers’ Day = 256th day of the year 🙂

It’s been awesome 5 years! I helped to ship the new Azure Portal, turned hackathon project into Microsoft product announced at //build keynote, helped SeeingAI with a few features, and for last two years helped to grow Azure Search. When I joined the team it was a startup. Now, it’s a mature Azure Service. Along with my everyday job I had awesome opportunities to speak at conferences and meetups around the World about my work. During my time at Microsoft I delivered almost 30 technical talks!

Along that journey I met a lot of awesome and inspirational people. Thanks to them my job was my passion. I was very lucky to have awesome bosses. I want to thank Andrew Birck, Ian Carbaugh, Madhur Joshi, Janusz Lembicz and Pablo Castro for everything they did for me. If you end up working for them, consider yourself very lucky!

Special thanks to Steve Sanderson, Scott Hanselman and Scott Guthrie! Their technical talks made me want to join Microsoft, when I was still in college!

Stay tuned for what’s next!