Skip to:
Content
Pages
Categories
Search
Top
Bottom

Buddypress.org needs a common place to share code snippets

  • Avatar of Lance Willett
    Lance Willett
    Participant

    @lancewillett

    Issue: BuddyPress developers need a common place to share code snippets.

    As we discussed today on IRC, we can’t have group forums here yet (Andy needs to enable them yet) and we can’t add a new blog yet (for the same reason).

    I was tasked to research possible snippet bin solutions and get back to you all with my findings.

    Suggested solutions:

    Here are six possible ways to solve this issue.

    1. New blog on buddypress.org

    A new blog on buddypress.org for sharing code snippets and solutions would be a great solution since each snippet would have a post (title, author, etc) and could take comments from other people. The posts would be searchable and archivable, and have permalinks for sharing in forums and IRC.

    This would also leave the main blog to share non-technical stories and ideas about BuddyPress as a whole.

    2. Group forum for snippets

    Burt\\\’s original idea for this — and still a good one. This has to wait until Andy gets the group forums up and running on buddypress.org. The advantage to this is a nicely organized set of topics (one per snippet) that can be commented upon and linked to.

    Right now we can post on the Code Snippet Solutions group’s wire but that is not optimal since wire posts don’t have URIs, can’t be commented upon themselves, and don’t allow enough HTML formatting to show code snippets well.

    3. Post snippets to a self-hosted snippet library here on buddypress.org

    We could roll our own snippet library using open source projects such as pastebin.com (you can download and reuse the code with a GPL license) or bin.cakephp.org (MIT license, I have an enquiry out about using it). It would probably run on a subdomain (like “bin.buddypress.org”) and be linked from the site itself.

    The advantage to this is that we’d control the data and be able to tailor the snippet bin to the exact needs of BuddyPress.

    4. Post snippets to another snippet site

    There are a lot of snippet sharing sites out there, like pastebin.com, pastie.org, codesnippets.joyent.com, etc.

    With this option we would simply tell everyone to use a hosted bin site (we’d recommend one and stick with it) with a certain tag or category (like “buddypress”), then paste the link to the code snippet in their forum topic, blog post, etc.

    The hosted solution is not a great option, in my opinion, since we won’t have control over the look-and-feel and wouldn’t have access to dump the snippet contents at a later date if we move it to a new home — all the data that was entered by BuddyPress users would stay on that other site.

    5. Codex pages

    Each snippet or solution would have its own Codex page. This option is probably the least compelling since it takes a lot of effort to create and manage the pages. Also, the rigid hierarchy of contents and the way the navigation works would not lend itself to a growing, changing set of snippets over time.

    6. Sticky forum post

    Burt started this topic today, and it’s a great start — especially for new people hitting the site or the forum for the first time. It gives them solutions to common problems and answers to common questions right away.

    This won’t be suitable long-term though as the list will be long and will get hard to scan or search. I do think this sticky post should be kept up for the top 5-10 most asked questions, though. That way it’s a kind of “did you read this stick post first?” that has pointers to common topics.

    We could also extend the current forum to add a category for “Code Snippets and Solutions” as a new top-level “theme” that would encompass all these snippets as “topics” within that theme.

    Please comment / vote on what you think would work best.

Viewing 20 replies - 1 through 20 (of 20 total)
  • Avatar of Jeff Sayre
    Jeff Sayre
    Participant

    @jeffsayre

    Lance, thanks for doing this!

    I prefer option three (3), the self-hosted code snippet library. I agree with your assessment of the benefits of controlling our own snippet repo. Also, I think that we should use pastebin.com since, like WordPress, it is licensed under GPL.

    Avatar of Burt Adsit
    Burt Adsit
    Participant

    @burtadsit

    Thanks Lance. Nice job.

    I don’t like idea of permanently using outside paste bins right off the bat for the reasons you outlined. We’re already using them from time to time for temporary things. It’s just that, transient and temporary. I do like the idea of stuffing code on one for sharing and collaborating. Forums and blogs seem to hate code. A paste bin has lovely things like line numbers and syntax hilighting. Isn’t there a code editor built into wp itself? The regular one. I’ve never seen it since I’ve only worked with wpmu where it’s insanity to hand over the source code to a theme to all blog admins and give them a ‘save’ button.

    I think the Codex pages should be sources of documentation and education not guides to implementation. That little tutorial I wrote today outlining how to mod the admin bar would be better suited as a blog post on that tech blog you mentioned.

    I completely agree about the new FAQ sticky forum post. It only really solves my frustration at having to hunt the damn things down all the time.

    A bp group forum like the one that exists would be an asset once Andy fires up the actual group forums. One problem/solution one thread.

    So, it looks like I’m voting for all of the above.

    Avatar of Jeff Sayre
    Jeff Sayre
    Participant

    @jeffsayre

    Burt, there is no all of the above on this test ;)

    Avatar of Burt Adsit
    Burt Adsit
    Participant

    @burtadsit

    I didn’t know we were being graded. Is there a curve? Seriously though. I see value to each approach. We’ll probably wind up using a combination of some if not all.

    Avatar of Jeff Sayre
    Jeff Sayre
    Participant

    @jeffsayre

    I agree. A technical blog is different than a codex page is different than a code snippet. I like the idea of using whichever makes the most sense. I also think a dev group forum would be very useful.

    However, I believe we are specifically talking here about where to host a code snippet library.

    Avatar of Burt Adsit
    Burt Adsit
    Participant

    @burtadsit

    Oh. bin.buddypress.org of course.

    EDIT: I said that with just a knee jerk reaction. Kind of a ‘not invented here’ thing. Now that I’ve had time to think why, I realize it’s because we do need to control it. In case nobody has noticed, we’re have the opportunity to *not* follow the rules for technical support and software development. The nature of buddypress, it’s social nature, gives us the opportunity to invent something truly different and useful.

    Don’t ask me yet what that is yet but signs of it are beginning to appear.

    Complaints about the bp.org group forums not being live yet. They aren’t just complaints. They seem to be us, struggling to accomplish something in a certain manner and knowing that the tools are dangling before us.

    We’re discussing code collaboration, commenting, sharing solutions to user problems and questions. Solving things in front of people. How best to accomplish that with code paste bins.

    Suggestions and approval of a ‘technical blog’ that will show people, by example, how to do things.

    It’s like we’re all suffering some vague malaise and we sense where to find the remedy.

    Having thought about it more – my vote would be another blog on this site.

    For a few reasons:

    1. People can use the same login, and therefore comment without being spammed or moderated.

    2. We can promote regular BuddyPress community members to \”snippit creator\” status.

    3. We can track all the snippets in activity streams.

    4. We get nice buddypress.org permalinks for every snippet.

    5. RSS.

    Avatar of Plrk
    plrk
    Participant

    @plrk

    I too am in favor of the “another blog on this site” option.

    It would make sense to have a searchable blog for such code snippet creations. The restrictions on proper searching in bbPress makes it difficult to find things. I get better results searching google to find things I know exist in these forums. That is where a blog would be way better :)

    Trent

    Avatar of Lance Willett
    Lance Willett
    Participant

    @lancewillett

    Thanks for the great replies and discussion! If the snippet blog is a possibility, one thing we’ll need to clearly document for the snippet authors is how to show syntax highlighting in their posts.

    Paste bins make you choose from a dropdown menu, but that works for that one snippet. A blog post detailing a technical fix for something might have 3 or 4 such snippets in different languages (PHP, Apache file, INI file, CSS, HTML, etc).

    I guessed by looking at the other Codex pages (and at the names of the included JavaScript files) that the Codex was using a syntax highlighter plugin that accepted the following shortcode:

    [sourcecode language='php']

    Andy, if you could confirm a few of those “authoring” details it will be a big help I think. The most common languages needed would probably be something like:

    • Plain text
    • Apache
    • Bash (command line)
    • CSS
    • HTML
    • INI file
    • Javascript
    • MySQL
    • PHP

    The bash, Apache, and INI would probably be displayed OK with “plain text” — but we should just make sure that the plugin the blog uses for syntax highlighting does the other languages well.

    Avatar of Jeff Sayre
    Jeff Sayre
    Participant

    @jeffsayre

    The issue was initially presented as a well-defined problem:

    BuddyPress developers need a common place to share code snippets

    Now, the conversation has transformed into a bigger-picture discussion. That is always good in my mind.

    Burt and Andy bring up valuable points. As Burt points out, we are on the verge of something interesting. We have an opportunity to use the social-networking tools of BuddyPress to create something unique and wonderful in the developer community. Andy offers very specific, compelling reasons on why and how we should indeed use those tools.

    So, I propose that we need to reframe the originally-stated issue like this:

    What is the best way for BuddyPress developers to leverage the power of BuddyPress to create a vibrant, useful developer resource?

    Avatar of Burt Adsit
    Burt Adsit
    Participant

    @burtadsit

    Now we’re talking Jeff.

    Avatar of Jeff Sayre
    Jeff Sayre
    Participant

    @jeffsayre

    Okay, all you developers out there. I’m sure you have an opinion. We’ve only heard from six members and I know there are more of you lurking behind the code somewhere!

    Come on out. Tell us your thoughts and opinions!

    :)

    Avatar of Burt Adsit
    Burt Adsit
    Participant

    @burtadsit

    Instead of talking, which we don\’t seem to be nicola created this while we were arguing on irc: http://buddypress.pastebin.com

    I’m using that until whatever happens, happens. I started it with wpmu to wp abstraction functions. Functions that exist only in wpmu but have wp counterparts: get_blog_post($blog_id, $post_id) gets implemented as get_post($post_id). Things like that.

    Avatar of Burt Adsit
    Burt Adsit
    Participant

    @burtadsit

    I added Andy’s bp-core-wpabstraction.php file to the bp pastebin for discussion.

    http://buddypress.pastebin.com/f578203cb

    I suggest *not* abstracting is_site_admin() because it’s a commonly used mechanism for detecting wpmu. if (function_exists(‘is_site_admin’)) should return true on wpmu and false on wp. I know that the abstraction file is so that we don’t have to care, but….

    Avatar of Jeff Sayre
    Jeff Sayre
    Participant

    @jeffsayre

    Burt-

    Thanks for reminding us of the buddypress.pastbin and for pasting in Andy’s WP abstraction functions. This will be handy.

    Avatar of Burt Adsit
    Burt Adsit
    Participant

    @burtadsit

    I thought about the actual utility of pasting it there. One thing it does is get me thinking about the difference between programming for wpmu and wp.

    Avatar of John James Jacoby
    John James Jacoby
    Keymaster

    @johnjamesjacoby

    I missed this party somehow, but wanted to offer my support.

    Wherever this party moves to, I’m there. :)

    Avatar of Jeff Sayre
    Jeff Sayre
    Participant

    @jeffsayre

    JJJ-

    The party was great! But, it ended last night. ;)

Viewing 20 replies - 1 through 20 (of 20 total)

You must be logged in to reply to this topic.