[wp-trac] [WordPress Trac] #37699: Death to Globals Episode #1: A Registry, A Pattern

WordPress Trac noreply at wordpress.org
Thu Sep 1 18:51:37 UTC 2016


#37699: Death to Globals Episode #1: A Registry, A Pattern
----------------------------+------------------
 Reporter:  wonderboymusic  |       Owner:
     Type:  enhancement     |      Status:  new
 Priority:  normal          |   Milestone:  4.7
Component:  General         |     Version:
 Severity:  normal          |  Resolution:
 Keywords:                  |     Focuses:
----------------------------+------------------

Comment (by MikeSchinkel):

 Replying to [comment:62 schlessera]:
 > No, there's no technical conflict, but we might want to plan for
 conventions ahead of time and avoid confusion.

 I see absolutely no potential confusion here.  I think you clearly
 understand the difference, no?

 > With the above example, most people will not need to write any code like
 this,

 To me "most" is not sufficient.  Let's make it all.  Inconsistency in
 programming is a blight on productivity and reliability IMO.

 > But it opens up the possibility to do so, for unit tests, for dependency
 injection or more advanced scenarios.

 Unless and until ~95% of WordPress developers actively use unit-tests, I'd
 say this is not a viable solution.

 > ...that's what we do as developers!

 I am realizing that I need to write an essay layout out one of the
 fundamental flaws in developer-think that I have witnessed over my many
 years; the belief that theoretical perfection is always the ideal and as a
 fallout of that that the skills required for all programming should be
 equal, or if not those with lesser skills either need to learn or be
 forsaken.  All too often developers who are skilled think that all
 developers should always be square pegs whereas there are round holes,
 triangular holes, etc.

 The reality is that we have developers at '''all'' skill levels, and we
 produce the ''best'' platform when we recognize and empower all those
 skill levels to be successful, especially when they align with well-known
 roles.  Here is one way to slice up the different roles and different
 skill sets in WordPress, all of which can be labeled "developer", in
 roughly increasing order of skills required:

 1. Custom Theme developer
 2. Custom Plugin developer
 3. Commercial/Open Source Theme Developer
 4. Commercial/Open Source Plugin Developer
 5. WordPress Core contributor
 6. WordPress Core committer

 The problem I see is that too many people advocate that we only use
 techniques that are appropriate for #4-6 and some of #3 but that is way
 beyond what is needed for #1 & #3 and often #2, and that are often over
 the heads of the first three people.

 Yes, those techniques may be appropriate for WordPress core developers and
 commercial plugin developers, but the requirement to use them should be
 limited to that set of developers, not forced on everyone, even the least-
 skilled custom theme developer who only know copy-and-paste PHP.

 Let's put it another way, pushing for everything to require top skill
 levels ultimately results in far less adoption and shows no empathy for
 the vast number of people who just program for a living ''(on non-
 enterprise level systems)'' as opposed to programming for art. I even
 [http://mikeschinkel.com/blog/willmicrosoftmeetoccupationalprogrammersneeds/
 blogged about it] in a prior life.

 So please, let's stop thinking that every developer has to be Picasso.
 Frankly, most of them do not want to be great programmers, they just want
 to get shit done.

 > (well, unless we avoid classes and stuck everything in global namespace,
 which is "probably a good idea")

 Not sure if you are quoting that for irony or you mean it, but I agree
 with that.  Except I think the global namespace should be a pseudo
 namespace and not PHP's poorly architected version of namespaces that
 requires significant develop skill to work with.

 > I consider this to be a hack.

 The are many things in life that are very effective in reality that
 purists view as a hack.  I'd rather have something that is very usable vs.
 something that is intellectually pure.  And I think WordPress as-is is a
 great example of the former. Show me an intellectually pure that is 1/10th
 as successful as WordPress?

--
Ticket URL: <https://core.trac.wordpress.org/ticket/37699#comment:66>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list