markjaquith / feedback

Ask @markjaquith anything!
42 stars 4 forks source link

"Expert" question for Mark and anyone else #42

Open MickeyKay opened 9 years ago

MickeyKay commented 9 years ago

This is not a technical question, so feel free to just close it if you don't think it's a fit for the feedback repo.

Question: when coding, what percentage of the time do know exactly how to do something, can write the code, and have it work first time around?

I've spent a lot of time lately considering what it means to be an "expert" in the world of WordPress, particularly in the eyes of those who consider themselves "beginners". I'll also be delivering a presentation at upcoming WordCamp San Francisco on the topic. One metric I've been curious about is the percentage of the time that a WP developer just knows how to code a specific solution. So when writing any line/block of code, this might translate to any of the following:

So for someone brand new to WordPress and/or coding, this percentage might be right around 0%. My theory is that such "beginners" often presume that "experts" in the field must answer this same question with something like 90-100% - something very high. So this question, for me, is to get a more accurate data set directly from "experts" like you, with a relatively high amount of WordPress experience, to weigh in on what percentage of the time you just know how to do something, and can do it. Certainly this can vary immensely based on the nature of a given project, so I'd love to just hear your best guess average, across the board.

If you're willing, I'd love to know your responses to the following:

Thanks a ton for any input you share!

All the best, Mickey

cdils commented 9 years ago

Interesting questions, Mickey!

1) 40% 2) To me, it's a million times more important to know "how to find out" then it is to "just know it." There's a fair amount of time (hence the 40%) that I know the logic I want to accomplish and the exact code or syntax I need to make that happen. More often, though, I just have a rough idea of the logic/process and go off in search of the right function or resource to make that happen. 3) Obviously the percentage goes way up on rote tasks or things that I consider "easy" because I've done them so many times. Easy gets boring though, so it's fun to look for projects that require me to dig in a little to find the answer. 4) I seldom write bug-free code off the bat - I'm a "push buttons first, go for accuracy second" kind of person. 5) I think I've gotten your questions out of order...Plus, I've had a half cup of coffee and... 6) Newbie advice: Be curious. Seek to understand how things work and dig. Be best friends with Google. Finally - don't be afraid to ask questions, but do your due diligence to find an answer before you ask. Oh yeah, one more thing... Keep coming to WordCamps or your local WP meetups. You'll pick up a ton of helpful tips just by rubbing elbows with other folks in the community. 7) Share away and thanks for asking, Mickey. You'll do fantastic!

MickeyKay commented 9 years ago

Awesome, thanks so much Carrie!

devinsays commented 9 years ago

Hi Mickey. This is a difficult question to answer. My WordPress projects generally contain a mix languages and approaches.

With CSS I am somewhere around 98%. That's thanks years of experience and code editor auto-complete. I only really find myself referencing syntax for CSS properties like "transform" and "calc".

PHP/WordPress functions are a different story. Maybe 50%? All the basic building blocks are in memory: setting variables, working with arrays, looping through values, if/then statements. But I am on the Codex every single time I use WP_QUERY. Even common functions, like wp_enqueue_script, I generally have to copy/paste previous code to make sure I don't miss a parameter. And for items where I have very little familiarity, it can be 90% searching Google for code examples and piecing them together.

I'd have to echo what Carrie wrote: To me, it's a million times more important to know "how to find out" then it is to "just know it." It's absolutely normal to be on the WordPress codex dozens of times throughout the day. I especially love it when I Google something only to find the answer in a post I wrote several months earlier.

No one writes bug free code. The WordPress project has some of the best developers in the world. Nothing gets committed without extensive discussion and peer review. Have you seen the list of open bugs recently?

I think the difference between experts and beginners is simply the amount of experience solving difficult problems. Experienced developers have a library code they've built up over the years which allows them to build something in 15 minutes rather than the 4 hours it took the first time. They've seen certain problems before and don't get stuck as often. They know the best sources to get questions answered and reference existing code.

For those who are new to WordPress, I'd encourage them to share as much as they can. If they found something difficult, and then solved it, write a post about it. You'll likely help someone else out. If you're really lucky, someone will explain and even better solution to your problem. Don't be afraid to put anything on GitHub.

Everyone who is now an expert was once a beginner, and likely, at several points throughout the day, also feels like a humble beginner themselves.

tnorthcutt commented 9 years ago

My answers would parallel @cdils and @devinsays almost exactly (without that CSS percentage, though!).

I'm not great at memorizing stuff in general, but I don't really care; knowing when and how to use some bit of code is more important and valuable IMO than knowing the order of arguments for some arcane function. Looking things up is quick and easy.

Newbie advice: learn to read source code. That may be the single biggest "leap forward" in my experience as a developer. Knowing how to read source code (for WP, a plugin, a theme, or anything else) gives you tons of power.

Also, to go along with what @devinsays wrote re: sharing stuff: haters gonna hate. If you publish something (code, blog post, whatever) and someone leaves a mean-spirited comment, delete it and move on. There are plenty of people willing to help you learn; don't waste time on jerks.

By all means, share my response.

BeardedGinger commented 9 years ago

There are a lot of things that I can setup structurally without referencing previous code for. However, I have some bad habits that I'm more aware of and am able to fix more easily if I'm referencing source or my own previous code.

I spend a lot of time in the Codex or source files because there are very few functions that I actually have the parameters memorized for. It's also nice to visit the Codex regularly even for functions that are relatively simple because there may have been changes that have been made to it that flew under my radar. This happened for me recently with the "add_image_size" $crop parameter.

BTW, I by no means would consider myself an expert. I'm just someone that takes pride in my work and try to get it exposed to people much smarter than myself. I then take the good (and sometimes ugly) feedback and use it to make myself better.

My advice for beginners, particularly if they're developing in their own bubble, If you don't share what you've done, you'll never learn how to make it better.

raphaelkross commented 9 years ago

Hi! Really interesting questions, I work a lot building themes and solutions with WP (integrating plugins and all the work involved), so here are my answers:

1) 35% - I usually don't know how exactly something can or will be implemented, I try think in a solution that may work or not and then I implement a basic version of this, if it works as expected (this rarely happens, really!) then it's ok, else I eliminate a few points that failed and plan again something else.

2) The percentage is really low even I being experienced, but it's really hard you just know something before even trying, it only happens when it's a simple thing or something I already did. Usually the tasks I'm involved are a bit complex and need extensive tests, so almost of these features I don't know how to implement and must research/test in order to achieve the result expected.

3) When I'm building simple websites, my experience allows a higher percentage because I already did. The lowest percentages happens when a high amount of PHP code or big features are involved, in these cases I usually spend several hours trying to do a specific feature work or thinking in how I can do that.

4.1) 100% - I always need check the Codex, I remember that the function exists, sometimes I remember the full function name but always need to check the params and options avaliable to ensure I won't do something wrong.

4.2) 60% - Google is my best friend when I'm trying to think in a solution, it's really useful do some research and see what other devs already tried and why their solutions failed.

4.3) 0-5% - I usually spend several hours just solving bugs and while solving bugs I endup discovering more bugs. I believe all projects have bugs, since even bug fixes can generate more bugs. The bigger the project more bugs, when the project allows multiple options and combinations, more bugs will appear, so I always find bugs in my code. The only exception would be small and simple tasks that must be made, but they are minority in all the projects I work.

5) I believe main difference from an "expert" and a "beginner" is the experience, usually the experts solve complex problems in a few minutes, but only when they already solved these problems in the past (this applies to myself) - beginners have less experience, so when they face a complex task they'll need to spend hours trying solutions, fixing bugs and others. This also means someone can be "expert" in a specific kind of tasks (testing, fixing bugs, e-commerce) and "beginner" in other areas where him hasn't experience.

6) My advice to beginners is try solve hard problems, you'll get experience doing that, even if you fail solving the problem, you will know what don't work. If you find the solution, don't forget to share with the community!

7) Yes, sure.

Kind Regards!

NateWr commented 9 years ago

I would not consider myself an expert at all, but I would add one thing that I think is related but not exactly the same as the "know how to find the right answer" principle that others brought up. One of the biggest leaps forward for me was in learning the importance of finding solutions within the WordPress platform rather than just what I could do with my own PHP knowledge. That came down to understanding the power and pervasiveness of WordPress's hooks system and the problems that can crop up when doing something WordPress is designed to do for you, like current_time().

If you release a product into the wild and actually provide support for it, you quickly find how many problems WordPress has solved that you are likely to unintentionally create by hacking things your own way. WordPress is so extensible that it's very easy to find ways to do what you need without really understanding the deeper implications of your choices.

I am not an expert. But what I typically expect of a "WordPress expert" is a deep knowledge of one or many (but not all) of WordPress's systems under the hood, which gives them a heightened awareness to problems that one or another approach might produce. In addition, I'd hope that they have some sense of the performance implications of different solutions -- scale is one of the big separators between doing something and doing something really well.

amandarush commented 9 years ago

Hi,

I'll comment on these out of order. As far as writing bug-reee code the first time around, for me, that's possible if I'm doing something extremely simple, and by simple I mean adding background image support to a theme. But once the project becomes more complex, that never happens. Maybe by the fifth go-around, but definitely not the first. I'll echo the comments of those who have said that being able to find things is a million times more useful than knowing that you have a solution you don't have to look for, because you may find something that does it better or makes the job easier or does it more efficiently than what you've been using. So I would tell new developers to become blood brothers with Google, and when you find something, make it a point to completely understand what's going on with the code, so you can then do something like write a blog post or teach it to someone else.

GaryJones commented 9 years ago

Your "just know it" percentage (best guess average)

Depends on what "it" is. As others have said, it also depends on the language used, and also the context. Ask me about the inner workings of SimplePie (just know it: 5%), and I'd have to go look it up as it's not something I've dealt with much before. Ask something about how Genesis works, and I could probably give you an answer immediately without opening my editor (80%+). There are still some Genesis questions I'd be more confident in looking up the code first, so I don't give bad advice. I think a summary of beginner vs expert is not necessarily how deep one knows about a code, but how many of these individual contexts they've spent time studying. As a contra though, I'd consider myself to be above average when it comes to setting up Grunt workflows, yet I'd need to lookup what options are available for each new package I'd want to use. Building new Node/Grunt packages is different though, so for that "it", I definitely need to look information up.

What are the sub-percentages for: Not needing to reference the codex

I rarely reference the codex (maybe 5%), but that's not saying I know it all. It means I've got the WP package in Sublime Text that autocompletes (with parameters) function calls. Since Devin mentioned it, here's two options that I'm set up with (via third-party packages) for enqueueing scripts - autocomplete function call, and a snippet:

wp_enqueue

Experts will be more likely to have these standard and custom snippets set up, and know the shortcuts off by heart, which saves them time both writing code and being accurate with parameters, documentation etc.

In terms of learning how WP core works, I'm far more likely to go and read the source code than someone's description of the source code. As Travis said, there's no substitute for learning how to read code.

No Googling required

Again, it depends on the context. If I'm working on a project I know a lot about, then the Googling is going to be low. If I'm pushing myself to learn something new (currently, Functional Programming), then I'm going to exhaust every single search engine result until I find the info I'm looking for.

Bug-free code first round. Second round. Fifth. Tenth.

For just giving small snippets of code to someone else (customising Genesis child theme), then I'll often be right first time. For writing my own code, in a context which I'm not familiar with, then I'll purposely write broken code (my story, and I'm sticking to it) from the outset. New hook? I'll write a function with a wp_die() or echo 'TEST'; in there so I know where exactly the hook is firing. Building up to a full solution can often save time in the long run than writing something wonderful with complex code, then it failing, and having to debug it. Experts will have the experience to better know when to just go for it, or when to approach the problem in stages.

Any other thoughts on what it means to be and "expert"? "Beginner"?

Beginners, for me, only see the code that is in front of them - i.e., if it works, then it's good enough. Experts often know a bit more about what makes code good quality, and how they can avoid future problems. If a function is checking for a specific value, then a beginner might just check against that single value. If an expert knows that the future might have multiple values to check against, then they might values in an array and check with in_array(). When the future comes along, the expert only has to change the data, whereas a beginner needs to refactor more.

Experts also know the little tricks and abstract knowledge that Beginner's don't yet know. Why do we add a trailing comma to the last item in an array? Why do we leave off the trailing ?> in PHP files. Why should classes go into individual new files? Why should class constructors not call add_action() or add_filter() Why should functions not be 100 lines long? etc. All this info takes time to absorb, or have an audit or code mentor who can highlight such things.

Any advice for those new to the world of WordPress?

By all means use snippets that others have written, but take the time to understand what those snippets are doing, and why, and see if you can improve on them. Even if the code logic is fine, could the code standards be improved? Could the documentation be better? Could it be broken down into multiple functions that means more of it is re-usable in another function?

May I share your answers in my upcoming presentation at WCSF? Of course - feel free to paraphrase or edit to fit your points :-)

tommcfarlin commented 9 years ago

Hey Mickey,

Neat idea in doing this! Hopefully you'll get some great feedback :).

Your "just know it" percentage (best guess average)

This is touch to quantify because I think it depends on what you're talking about. We're all going to know certain things more than others and the more we expose ourselves to other things, the more we know them.

For example, I might be able to provide a high-level explanation of custom taxonomies and the differences in a hierarchical taxonomy and a non-hierarchical taxonomy, but if you want me to write down the arguments for the function off the top of my head, I probably couldn't do it.

Contrast that with, say, creating custom meta boxes and going through the sanitization, serialization, and validation process and it's something that I could do relatively easy.

It all depends on how much you not only understand what you're doing, but how much time you spend on a certain area of the application.

Any explanation of how you get this percentage

Ah, I answered this above -- it generally is based on how much time you spend working doing certain tasks in the application, or how much time you spend digging into the Codex and even the source code.

For what type of project that you work on regularly is this percentage highest? Lowest?

I do a lot of work that revolves around custom plugin development, custom web application development, and some theme customization (mostly server-side stuff) so when it comes to certain hooks, filters, and things related to extending WordPress (think custom post types, meta data for users, comments, posts, etc.), then my knowledge is naturally higher there.

It's lowest when it comes to interactive with things like the Rewrite API - it's something that I can do (and most people who read the Codex can do), but it's not something that I'm familiar with. I usually stick to what I know in those situations.

That is to say, most of the work that I do sticks with one of the URL schemes that WordPress has readily available.

What are the sub-percentages for:

Not needing to reference the Codex

I reference the Codex almost every day that I'm writing code, so if I had to put a percentage on it, I'd say it's 70% and above. Probably more. I've never really broken down my hours like that :).

No Googling required

I don't Google as often as I read the Codex and read the source code for WordPress. I'd say I probably spend maybe 10% - 15% of the time Googling, but it's really more of the former rather than the latter.

The danger in Googling is that you can find something that works, but it may not be well written whereas code that's found in the Codex is usually up to par because so many people are watching and reading it. Then again, people could argue that some of WordPress core needs refactoring because of how old some of the code is.

Regardless, I think it helps to read the Handbooks for the coding standards and then use that as a filter through which you determine what's considered "good WordPress code" and what isn't.

Bug-free code first round. Second round. Fifth. Tenth.

Never. Even if you are able to iron out as many bugs as your tests, testers, users, and customers find, there will always be something that doesn't work for someone.

On top of that, because of the nature of code and complexity, it's highly likely that when you fix one bug, you introduce or expose another. Similarly, when you introduce a new feature, it's likely going to introduce new bugs as well.

We can do an excellent job of writing code that's as solid as possible, but if it's completely bug free, then I'd say it's either a variant of "Hello World" or it's not a real program ;).

Any other thoughts on what it means to be and "expert"? "Beginner"?

The more you learn, you more you're going to learn how much you don't know. When you've spent years working with something, you become keenly aware of just how much there is to WordPress and, despite how much you think you know, there's likely more that you don't know.

And that's a good thing.

There's always more to learn, more to change, more to address, and so on. The awesome thing is, you don't have to get "there" before you can start creating things for yourself and for others (where "there" is some arbitrary destination that we often place on ourselves).

Instead, you learn enough to make something happen, you make it happen, you refine the process, and you repeat. And you do this over and over and over and over time, you amass a lot of knowledge for how to accomplish certain tasks while also knowing just how much you've yet to learn.

Any advice for those new to the world of WordPress?

Assuming you're a developer and that you're coming from another background, don't think of it like a platform like .NET or a framework like Rails. WordPress is more of a foundation that can be extended and on which we can build additional tools.

It's not trying to compete with something else that's out there, it doesn't follow whatever MVC framework you're used to using, and it has a lot of functionality provided out of the box along with APIs that help to extend it.

That said, spend a lot of time reading blogs, digging into the Codex, asking others for information, and so on. Study what other people are doing, understand why they are doing it, and move forward from there.

Oh, and don't forget to build stuff and to share it!

May I share your answers in my upcoming presentation at WCSF?

Sure (though I think many here have significantly better answers ;)!

MickeyKay commented 9 years ago

Wow, I am totally blown away by the quality, insight, and kindness of all of your responses. Can't thank you enough for your wisdom. I'll do my best to get to some of it in the 5 minutes I'll have to present!

Thanks again.