Category Archives: Opinion

How debugging can make you a better developer

Whether you’re a WordPress developer or not, you’re always looking for ways to improve yourself. That’s the nature of our profession. We’re always looking for ways to improve ourselves.

That said, it’s not uncommon for developers to hate debugging. They’ll get a bug report and cry in exasperation, “I want to build stuff! Not fix bugs!” But that’s not the right attitude to have towards bugs and debugging in general.

That’s because debugging doesn’t only happen when you’re fixing bugs in bug reports. We spend a lot of time debugging when writing brand new code too. How often have you written code that didn’t work on the first try and that you had to debug? (We’ve all had that happen more often than we want to admit!)

That’s why debugging is such an important skill to have as a developer. We spend a ridiculous amount of time debugging. Yet we never think about how getting better at it might also help us write better code.

Continue reading How debugging can make you a better developer

Tips for applying to a WordCamp

Let’s talk about teaching. While not the main topic discussed on this site, it’s still a topic comes up as a topic on a pretty regular basis. That’s because it’s an important and underrated way of growing as a developer.

As a WordPress developer, one way to teach that comes up over and over is speaking at a WordCamp. If you’re not familiar with WordCamps, they’re community-run WordPress conferences. There were 115 WordCamps in 41 countries in 2016 alone.

This means that the odds are pretty good that there’s a WordCamp near you! (Those odds are even better if you’re in North America or Europe.) So all that you have to do is apply and you’ll get in. That’s how it works right!?

Well, that’s not quite true. More and more people are applying each year. I’ve been a WordCamp organizer since 2011 and we saw a record number of submissions this year. (We got 130!)

This can make it hard for you to stand out from everyone else. You’re just one submission out of many. So what can you do to tip the odds in your favour?

Continue reading Tips for applying to a WordCamp

Thoughts on teaching object-oriented programming with WordPress and over-engineering

This site has grown a lot in the last year or so. We’ve spent a lot of time going over object-oriented solutions to WordPress problems. So much so that, we have a small library’s worth of material that you can refer to.

With any type of growth, criticism will arise. This is a good thing. I’m a big proponent of “Strong opinions, weakly held“. But this can’t happen without discussion and debate. In the long run, I always feel it leads to a better outcome. (Well, that’s as long you don’t get stuck just debating!)

Recently, there was a debate on the nature of the solutions that you’ll see on this site. They’re over-engineered. I think this is a valid criticism and I wanted to share some of my thoughts on the whole thing.

Continue reading Thoughts on teaching object-oriented programming with WordPress and over-engineering

Thoughts on WordPress and the MVC pattern

Getting proficient with object-oriented programming can feel like falling down a rabbit hole. You break down problems into more and more classes. You feel like it’s neverending and that you could go on forever. You need guidance to make sense of it all.

This is where architectural patterns come in. They’re similar to software design patterns which you use to solve a specific problem. In contrast, you use an architectural pattern to address a set of them at once.

This confers certain benefits to architectural patterns. You get a higher level view of how your classes interact with each other. You then have an easier time piecing everything together.

This is why it’s not uncommon for developers to skip over software design patterns. Instead, they start looking into architectural patterns right away. This is even something I’m guilty of doing (insert audience gasp).

One of the most important architectural patterns is the “model-view-controller” (known as MVC). It’s used by most modern frameworks from Rails to Angular. But does it have a place in WordPress?

Continue reading Thoughts on WordPress and the MVC pattern

Read more code

As developers, programmers, software builders, solution creators, we tend to focus on the output of our work. It’s the code we write. It’s also the outcomes that we create for ourselves, our clients and/or our work.

How do we get better at it though? That’s what we care about in the end. The obvious answer is to write more code (duh!). What I’ve learned goes against that common logic.

Here’s what you need to do. You need to read more code. Yup, you heard that right. This is what’ll give you the largest skill gains. That’s the secret sauce.

Continue reading Read more code

On becoming a WordPress expert

This all started with a thought experiment about WordPress recruiting. Something I’ve done a fair amount of in the past.

Let’s say I’m looking to hire a WordPress expert. What defines that person as a top tier WordPress developer? What knowledge or characteristics am I looking for?

WordPress powers a large part of the web. It’s also the livelihood for thousands of developers. Those are amazing things, but it also creates problems. One of them is that it’s hard to evaluate your or someone else’s skill level.

So we’re going to look into that. It’s worth noting that there’s no definitive or objective answer to that question. We’re all biased. We have our own opinions on what it means to be an expert.

Continue reading On becoming a WordPress expert

WordPress core as a gateway to better coding

How many of you got into PHP coding because of WordPress?

– Matt Mullenweg

Me and roughly half the room of 200+ attendees raised their hand to that question. That’s pretty incredible mused Matt. He asked that question while answering the larger question asked by 9th grader Lucas Cherkewski which was “How can WordPress be used in an education context to learn coding?”

I have been involved with WordPress for over half its 10 year existence and while I have gone from simple attendee to volunteer to community organizer over that time. I have always been a bit of the crazy one in terms of trying to help the community code better and learn about more advanced programming topics. That’s because I have been coding since I am 7-8 years old so while I learned PHP through WordPress. I had done plenty of programming before then.

Plugin development is like high school

When I was coding in high school, I couldn’t even do something as cool as a WordPress plugin. The web was just starting. I was mostly coding in Basic doing silly things like a text-based RPGs. So I think it’s amazing that someone can solve small problems with a plugin and share it with the world!

For a lot of people, that’s enough. They can solve small problems without knowing a lot of advanced programming concepts. They don’t need to graduate to college level concepts. WordPress has a lot of great APIs that are easy to use and require no advance programming knowledge.

How do you graduate to college level coding?

I did a WordPress meetup on object-oriented PHP recently and I can’t say that I am the best of teachers and a lot of the utility and reason to use object-oriented programming was lost on most because WordPress doesn’t use a lot of objects yet due to its recent PHP4 heritage.

How do I get better at PHP coding?

I don’t get asked that question a lot, but, a few months ago, Michal Bluma asked me how I got into more advanced PHP coding. I told him definitely not with WordPress. I told him I had done a lot of learning looking at the code base Doctrine1, but version1 of Doctrine is mostly discontinued and Doctrine2 is a different beast entirely.

I told him take a look at Symfony, but that’s akin to someone going from high school to college graduate. The knowledge gap is HUGE. The same would be said about Doctrine2, Zend Framework, etc.

Fundamentally, there’s no way easy way for a WordPress developer close the gap.

WordPress core is an ideal candidate for this

WordPress core would be a great place for people to get a taste for advanced programming knowledge. What’s great is that all the APIs already hide most of the internals so, if someone is looking at the core code, it’s because they want to look at it. There’s an opportunity here to allow them to become better coders! Unfortunately, that opportunity is currently wasted.

Core needs stronger coding standard

I am not talking about syntax here, but actual code quality. Core devs need to raise the bar a bit more. I am not talking about super advanced things like Reflection objects or metadata objects, but just better knowledge and use of object-oriented principles. Learning how to do object-oriented programming is really the next step if you want to learn more.

As an example, last night I submitted a ticket to core about the use of final with the WP_Post class. In my opinion, that should have never made it to core in the first place and shows a fundamental misunderstanding of object-oriented coding especially in an open source environment.

What needs to change

Honestly, it would be good if WordPress core at least used some PHP object-oriented best practices. Here are things that would be great for people looking to learn a bit more about being better PHP programmers:

  • Using interfaces where it makes sense to do so like with WP_Widget and WP_Post for example.
  • Severely limit the use of magic methods especially __get and __set
  • Exception handling instead of the white screen of death
  • Proper variable visibility
  • More abstract classes

This is just to name a few. You can find some of these in the code base already, but new code is still being committed where these basic rules are disregarded which is really the point I am trying to get across.

As a core dev, you should be holding yourself up to higher standards because you are indirectly a teacher for thousands of fledgling PHP developpers.

Feel free to leave a comment below or discuss on Hacker News.

Why I am so bullish on health technology

optimistic about something’s or someone’s prospects

bull·ish

This monday I was having a somewhat heated discussion with my mother on the general future of health. It all started when I discussed the future of brick and mortar stores and malls. With the addition of self-driving cars, she felt that people would never go out anymore and lose whatever passive calorie expenditure we have left.

While it’s not an invalid point, I think people probably overstate the caloric importance that walking at the mall would bring. The important aspect is that if you do an effort to get out and walk, you are usually also focusing on other elements like the diet which accounts for the major portion of the calorie deficit required for weight loss. Because companies like Google and Amazon are removing frictions in our lives doesn’t have to imply that we are going to get unhealthier.

Health tech is not popular

Instead of asking “what problem should I solve?” ask “what problem do I wish someone else would solve for me?”

– Paul Graham

The first thing that comes to mind when I think of the health tech space is the essay “Schelp Blindness” by Paul Graham (all his essays are amazing btw!). There are decades of behavioural research and theory to testify to the complexity of the task on top of the fitness industry that has a business model built around the fact that you will most likely drop out of an exercise program within the first 1-3 month(s).

There’s lots of people working to make us LESS healthy – it’d be nice if you could support the people trying to make us MORE healthy.

– Jason Shen

This fact is mentioned in an article PandoDaily ran monday called “All the fitness apps in the world won’t make us thin“. It’s a common article to see in the tech press (there is understandably a lot of doubt), but it did make a few of founders come out of the woodwork to comment. The comment by Jason Shen struck a real chord with me, but a lot of the other comments were good as well. Discussions around health topics are generally very polarizing.

The PandoDaily article did have a few important points. A solution needs to be convenient for the user. I also don’t think that an advertising revenue model is going to work there, but people could make it work. Who knows. I actually disagree with the article’s interpretation of the PEW report. I saw a lot of positive indicators in the report. The fact 60% of people track weight, diet or exercise routine is, in my opinion, very significant. The issue is that people 50% track with their heads because it is more convenient even if we, humans, are terrible at it. This creates a bad feedback for the person.

Convenience and the advent of wearable computing

I don’t know how many times a day I now reach into my pocket to pull out my phone. If I had to guess, I’d guess a hundred. Maybe it’s a lot more.

– MG Siegler

I’m going to back to convenience as this is the cornerstone of everything. Never in history has a device as powerful (sensors, processing power, storage, etc.) as the smart phone been so close to a person. Which is why I am so excited about the fact that devices are getting smaller and closer to you each year.

The writing is on the wall for wearable computing (things like watches and glasses) which reduces the friction of the user with the device even more. Devices like Fitbit and FuelBand are stand-alone devices only because that’s the only way they can exist, but give it a couple more years and developers will be able to incredibly cool things with generic devices like today’s smartphones.

The insanity of it all

Insanity is doing the same thing, over and over again, but expecting different results.

– Albert Einstein

This quote sums up the essence the issue at hand. Each year in a cycle that transcends the cliché into researched behaviour, people proceed to do the same thing, use the same tools and fail in a very predictable way. It is normal for people to doubt that things will change, but they eventually do and it always seems obvious in retrospect.

In that way, I look at most of the behavioural research done in the past and I wonder what impact the smart phone or other devices could have had on their outcome. Eventually, I decided to stop wondering and slowly start working on it.

This is my first health related article. I do plan on doing a lot more in the future! I would like to point out that I would not call myself an expert, but I do spend a lot of time reading on the subject.

Science and Pragmatism

Matt Perryman over at Myosynthesis has been running an incredibly interesting series (Part I, Part II, Part III, Part IV) that he completed this week. The series dwells on some of his views on skepticism, scientific thinking and reductionism in fitness circles. I felt like taking a stab at the topic myself.

Reliance on abstracts

The problem to me isn’t the fact that science is used as a tool, but rather the reverence for, and certainty given to, the findings of published research with no further context.

Matt Perryman

When I started getting into fitness and nutrition research, I found it very hard to digest abstracts as is. Yet they were, and still are, thrown around as a form of justification. I was lucky enough to stumble on Alan Aragon who took the time to dissect and digest some of the relevant literature and explain it simply. It eventually spawned AARR which I have subscribed to for a few years now.

Abstracts are meant as summaries only. You miss out on a lot of information if you consider them as is. You can miss fundamental issues with the research itself such poor methodology which can range from how you perform your tests to the population used (e.g. using athletes from research meant for the general population). Commonly, you can also run into conflict of interests especially in nutrition research where the supplement company are funding their own research.

Let us remember what science is about

I won’t say too much about this here as I’ve previously written about complexity, but it’s helpful to think of your body as more like the weather than a precision-engineered mechanical device.

Matt Perryman

The scientific method is meant to assess cause and effect in a controlled environment. While sports and nutrition research try with various degrees of success to do so, it is currently not an exact science at the same level physics or chemistry. That is why having context is critical because it is what allows you to judge the relevancy of the findings and ultimately their application.

A case for engineering

Engineering is the discipline, skill, and profession of acquiring and applying scientific, economic, social, and practical knowledge, in order to design and build structures, machines, devices, systems, materials and processes.

Wikipedia

I am an engineer by trade and what made me passionate about it was that you are converting theoretical knowledge into something that can be applied in a very pragmatic way. While I wouldn’t say we need a “Fitness Engineering” discipline (We have biomedical after all). There is surprisingly little done to “translate” the increasing body of exercise, sports, nutrition and psychology research and applying them in a practical way. It also doesn’t seem to occur in people’s mind that this could (or maybe should) be done or this is possible.

It’s not impossible either. Arthur Jones was able to do it when he invented the modern exercise machine. However, there’s been little else since then and most of it has been gimmicks. One of the reasons I really liked the 4-hour body by Tim Ferris was that, regardless if you agreed with his conclusions or what he had done, it was the first real attempt I had seen to take nutrition and exercise research and develop it into a practical framework of use for everyone.

It is getting better

Regardless of these issues, there are more and more people who take an interest in all of this and that is good for us all. We need more people looking into the science and how to apply it.

That is how progress happens.