What don’t you like about PHP?

Answered in Quora:

Q: What don’t you like about PHP?

It’s a ball of nails with almost no logic to it. From the perspective of software language design — as Tim Bray, co-creator of XML and at the time Directory of Sun Microsystems’s Web Technologies division, once said — “PHP is soul destroying.”

To take one of the most notorious examples: strpos and in_array.

In one, the order of variables is $needle, $haystack in the other it is $haystack, $needle. I challenge even the best PHP developers to remember which it is without a reference. Also, even though they both serve the same purpose they return different things and don’t obey a consistent naming convention: they should be named strpos/arrayin, posinstr/inarray or `str_pos`/`array_in`. That’s three terrible design choices in one single example!

Another example is the namespace separator in PHP is what is an escape sequence everywhere else \\. Why? Because by the time PHP added namespaces, they had run out of ASCII symbols for the lexer.

I could go on and on, but I won’t.

I love the language sometimes because I hate it so much. 😉

Come see my talk in February 2019 at SunshinePHP in Florida!

After being constantly bothered by your automated help

Let’s just say when my phone buzzes at 10:30pm and again at 12am. I turn into Statler or Waldorf

Dear DoorDash support,

I did not do this support request. I’ve never used your service. (I believe many at a previous company I worked at would use you when catered lunch wasn’t ordered that day, but I’m among those that subscribed to the theory of “Learned Laziness.”) In fact, initially I thought this was phishing or spam because we have no previous business relationship or customer interaction.

If the person who whined to you to create this support ticket provided a phone number or other contact information —which I’m sure they did if there was a real order attached — please contact them through that order and tell them to not mistype their email in the future. I can understand how not receiving their hot pockets or whatnot on time can be stressful (in my younger years I’d have probably blown up for less if ordering-shit-from-my-iPhone-because-I’m-too-lazy-to-walk-downstairs were a thing), but that’s no excuse for not double-checking what one is typing in the contact field(s).

If I keep receiving these e-mails , I’ll simply train my mail filters to ignore and and all future e-mails coming from you.

I wish you all the best! Thank you.

terry

P.S. There is an apostrophe in “youve.” I normally wouldn’t mention it, but it’s in e-mail template you have probably sent out more than 10 million times and I’d have think it’d be a little embarrassing that the $970 million in venture capital you took in didn’t pay for a spell-checker.

Begin forwarded message:

From: “support@doordash.com” \<support@doordash.com>
Subject: Thanks for contacting DoorDash Support!
Date: September 17, 2018 at 10:30:31 PM PDT

Hello,

Thanks for contacting DoorDash!

This email is to confirm that we have received your request. Our team will be following up with you shortly.

If you do not receive a response within the next 48 hours, please make sure to check your spam or junk folder to ensure our messages can reach you.

In the meantime, check out our Dasher Help Center! We have curated answers for your most asked questions.

Your reference number is xxxx.

Sincerely,
DoorDash Support
DoorDash Help

Begin forwarded message:

From: “support@doordash.com” \<support@doordash.com>
Subject: DoorDash Inquiry
Date: September 18, 2018 at 12:11:54 AM PDT

Hi ,

Thank you so much for reaching out to us regarding your inquiry. We’re happy to look into this for you; however, we need more information regarding the issue/concern you’ve encountered.

In line with this, can you please provide us details of your inquiry, the name/email on the account so that we can have it checked and verified from our end!

Hoping to hear from you soon,! Thank you for your patience and understanding in dealing with this matter.

Take care and be safe!

Your reference number for this request is xxxx.

Best,
Allan
DoorDash Support
DoorDash Help

ref:_00D1aKEiH._5001ajJUcj:ref

Back Kill Merlin!

My former CTO started to develop a board game with his kids back when I started working there. He just posted it on Kickstarter and you need to back it right now!

It’s pretty amazing seeing it evolve from just a bunch of handwritten cards and a board to what it is today.

But if you don’t believe my review, you can always check out independent reviews on BoardGameGeek.

It was a struggle balancing this game with his wonderful family and a startup to boot. I remember discussing with him the struggles of whether to go to GenCon and still making his kids’ events.

Personally, I wish the title of the game was someone else than Merlin , but other than that, I’d have given the game more thumbs up if I could.

And, Dave, if you are reading this. Yes, I was backer 139. I would have been a lower number but… well you know what’s happening on my end 😉

Which has better packages, Python or PHP?

Answered in Quora

Q: Which has better packages, Python or PHP?

It depends on the target utility. In the Python world, the most common package installer is pip; the PHP world didn’t settle on a dominant format/installation for packages until composer, and that was relatively recently (last 4 years).

The reason for this is because PHP is a language almost exclusively designed for websites, and the economy of the open-source world has found that a dedicated application, instead of a framework or library could serve the bulk of most commercial needs. For instance, a single application, WordPress, four years ago (2014) accounted for nearly 20% of all websites and 50% of all blogs. There is little need package management when a single download and install (or a single click during ISP/hosting account creation or visit to site like Bitnami) can set up everything a typical website might need, fully under your control, with its own package infrastructure (plugin and theme ecosystem) where the underlying language (PHP) is pretty much irrelevant to the user.

Other languages like Ruby (with gems) or Go (import) or Javascript (with npm) which matured later and are more general purpose had a more robust package management and installation system. PHP Composer, in fact, is most modeled on npm.

Python, like Perl, predates these languages, but its general purpose demanded package management early in its development. However, because of this, pip takes less advantage of web conventions that npm does. Python has the added headache of version compatibility with its core runtime. Still pip is perfectly workable and relatively seamless and easy to use.

So which has better packages? The answer is it depends on the domain. In nearly any language you can find an adequate package for any of your needs, but overall you will find the packages are higher quality, more up-to-date, and sometimes just better overall in the domain the language seems to target well.

In my opinion, packages for data science/AI/ML applications, Python packages are second to none. As a PHP expert, I wouldn’t even bother looking in Composer for them and would instead find a PHP extension that binded to a dedicated engine optimized for the problem area or write a dedicated solution/web service in Python/flask and call it from PHP. If, for some crazy reason, I needed to do this entirely within PHP, I would search for the best solution in Python and see if someone has a port for that in PHP.

I would expect the same in DevOps for Python, but right now that space, like blogging (WordPress), seems to have dedicated solutions where a domain-specific language has abstracted one from the language-specific package management solution. For instance, in the configuration management space the top four applications are: Puppet, Chef, Ansible, and SaltStack. Of those four, I believe only one (Chef) exposes the underlying language (Ruby), and it does this to the DevOps engineer no more than WordPress exposes PHP to a blogger.

For server-side web-based packages, I feel PHP and Composer are going to have a solution for any problem PHP itself is capable of solving. That is a restricted set, however, as more and more work for web applications is being done on the client-side in Javascript and there is already an adequate toolchain for that (as well as a package management system in npm). Other web-based languages will probably have adequate solutions in this space with decreasing order/quality: Ruby (on Rails), Javascript (NodeJS), Python, Go, Perl, Java… The web problem is now pretty discovered at this point so there is less a need to adopt the bleeding edge in the web problem.

Light L16

After over two years of waiting…

The Light has arrived
Sab Francisco, California, United States

Apple iPhone X, Apple iPhone X back dual camera 6mm f/2.4
Live photo thumbnail

The CFL bulbs in the background are because a Phillips Hue kit arrived on the same day.

Around ten years ago, Hubert told me about a new light-field camera technology that he saw demoed. When that was productized as the Lytro camera, I pre-ordered it. After a bit of thought, I cancelled my pre-order. Why didn’t I do that this time?

It’s because back then, I thought original Lytro was marketed for non-photographers and capturing light fields meant that it would be a long time before it was ready for serious photography. This time, even though the L16 is poorly marketed and may flop, I sincerely feel that this camera is meant for someone like me.

It’s worth a shot (pardon the pun).

Continue reading and seeing a few photos after the jump

Tijuana

From my aunt’s e-mail thread.

I sent this photo to Francis already but I thought you may like to take a look. It was taken in Tijuana, Mexico during my freshmen year at Berkeley. Francis wanted to eat authentic Mexican food and bought something from a food cart vendor. He kept enticing us with smacking and yum-yum noises as he ate.

Then that night he was visited by Montezuma’s revenge.

Tijuana.jpg

My uncle, my aunt, and my mom.

KEN:
Hi-larious!

Voting in America redux

I wrote about voting in a historic election eight years ago. Since then, California has become more blue, there are even more political fliers, and the only thing the left wing can seem to agree with the CAGOP on is what this state needs is even more propositions on the ballot.

Even though, back then, I strongly suspected I’d be casting this vote eight years later for Hillary Clinton, I didn’t realize how this day would hit me.

Marie got dressed in a pantsuit and we walked across the street to the community center to vote. Unlike me, she was homeschooled as a Christian conservative and voted for George W. Bush in 2004—her vote is more meaningful than mine.

Marie voted in her pantsuit

But my vote wasn’t mine, it was Mom’s—not to celebrate or affirm women’s right to vote or anything like that, but because I love her, she always admired Hillary Rodham, and, most importantly, because she only would go to the polls to cancel out Dad’s vote. ?

Not this time! I called Dad yesterday and he said he’s with her—quite possibly his first vote for a Democratic candidate for President of the United States, definitely his first vote for a woman for that position.

I started blogging with the purpose to “write to create context for another to think” just after argument with my father about politics in 2004. He said:

“Nobody said democracy is perfect. It’s just the best thing we’ve got. Terry, maybe you’re right, and I’m wrong. But if you are, then have some faith in our system that the truths will come out. Have some faith that people can change. They just don’t have to change on your timetable.”

I honestly never thought Dad would change. But my father, with his vote with mom now, and a lifetime of past votes against, finally won an argument with “mom’s lawyer”: I have faith, and people can change.

No matter the outcome, this election reaffirms that faith in the conversation that is our democracy.

One Bad Hombre and one Nasty Woman (in a pantsuit) went to the polls and voted!
San Francisco, California, United States

So lucky she and I can split the workload of sifting through all those ballot propositions. Now that’s love. ??

I don’t care who you support, if you can vote, Vote!

NaNoWriMo 2016

Ever since Marie wanted to learn to program in 2009, I’ve wanted to write a book to help her. But I never could get started.

The National Novel Writing Month is November every year for just this purpose: to motivate people to put 50,000 words on paper (about the size of the novel, Slaughterhouse-Five), editor be damned.

I first heard about it in 2007, when I started using Scrivener, but dismissed it because the requirement that a novel be fiction. I only just found about NaNo Rebels, which allows you to customize the “50,000 words” into nearly any other creative exercise, including non-fiction. So yesterday, this was born:

NaNoWriMo 2016 Participant Badge

Nowadays, I use Ulysses. I simply created a group in the software and set a 50,000 word goal and started typing away!

NaNoWriMo 2016 Day 2

Goal setting on my iPad.

I don’t know if I can finish since it’s about a good sized blog article each and every day. We’ll see how it goes. So far it’s been a bit strange writing a book. For instance, I can’t use my WordPress shortcode macros lest I ruin the word count.

Periodically, I’ll dump the output to my blog, which you can track here. Wish me luck!

If you want to buddy up, I’m “tychay” there.