• Register
    • Help

    striker  0 Items
    Currently Supporting
    • Home
    • News
    • Forum
      • Try XenForo Demo
      • New Posts
      • FAQ
      • Calendar
      • Community
        • Groups
        • Albums
        • Member List
      • Forum Actions
        • Mark Forums Read
      • Quick Links
        • Today's Posts
        • Who's Online
      • Sponsor
        • Sponsor a Feature
        • List of Donors
    • Wiki
    • Support
    • What's New?
    • Buy Now
    • Manual
    • 
    • Forum
    • VaultWiki How-Tos
    • VaultWiki Questions
    • Numerous places with duplicate code from core vBulletin

    1. Welcome to VaultWiki.org, home of the wiki add-on for vBulletin and XenForo!

      VaultWiki allows your existing forum users to collaborate on creating and managing a site's content pages. VaultWiki is a fully-featured and fully-supported wiki solution for vBulletin and XenForo.

      The VaultWiki Team encourages you to join our community of forum administrators and check out VaultWiki for yourself.

    Results 1 to 5 of 5

    Thread: Numerous places with duplicate code from core vBulletin

    • Thread Tools
      • Show Printable Version
    1. March 12, 2010 #1
      kmike
      • View Profile
      • View Forum Posts
      • View Blog Entries
      • View Articles
      kmike is offline
      Junior Member
      Join Date
      March 3, 2010
      Posts
      16
      Rep Power
      171

      Numerous places with duplicate code from core vBulletin

      I went to check why some of our attachment changes didn't work in VaultWiki 2.5.7 and was unpleasantly surprised to found that VaultWiki uses a lot of vBulletin code, but not in the shared manner - the vB code is just copied to a VaultWiki script or class. For example, the discussion code is actually 95% showthread code. Granted, to make the discussions appear in a tab you indeed have to rip out the main code from showthread, it really couldn't be helped.

      But the article postbit class (vB_WikiPost_Factory), why it's defined on its own, why doesn't it inherit from vB_Postbit_Post? Probably a dozen of vB_Postbit_Post class functions such as process_attachments() (my main gripe) had to be duplicated because of that. There had to be a very important reason behind this decision - what was it?

      I haven't checked version 3.0, does it follow the same route?
      Reply With Quote Reply With Quote

    2. March 12, 2010 #2
      pegasus
      • View Profile
      • View Forum Posts
      • View Blog Entries
      • Visit Homepage
      • View Articles
      pegasus is offline
      VaultWiki Team
      Join Date
      March 28, 2004
      Location
      New York, NY
      Posts
      2,934
      Blog Entries
      18
      Rep Power
      659
      Version 3 is going to follow the same route. The reason this was done originally was because, like you mentioned, a lot of the main code was needed, but a lot needed to be changed in order to do what we wanted it to do. Granted, in some cases the classes COULD have inherited from existing classes, but in most cases, essentially EVERY function was modified in some way.

      Even in the case where some weren't, we decided it would be better for memory management to include the 1 or 2 duplicate functions in a NEW class, rather than load both the PARENT AND CHILD classes during run-time (the difference between including 1 file or 2 files).
      - lead developer for VaultWiki
      Reply With Quote Reply With Quote

    3. March 12, 2010 #3
      kmike
      • View Profile
      • View Forum Posts
      • View Blog Entries
      • View Articles
      kmike is offline
      Junior Member
      Join Date
      March 3, 2010
      Posts
      16
      Rep Power
      171
      IMHO it was the most unwise decision. Now you have to track changes to the corresponding core vBulletin files in each new vB patch and apply them to your copied code. If you don't, the copied code may miss some fixes and as a result, the forum functionality provided by the copied code may perform differently in the wiki area than in the forum area.

      And subsequently we have to apply our custom changes to your code as well.
      Reply With Quote Reply With Quote

    4. March 12, 2010 #4
      kmike
      • View Profile
      • View Forum Posts
      • View Blog Entries
      • View Articles
      kmike is offline
      Junior Member
      Join Date
      March 3, 2010
      Posts
      16
      Rep Power
      171
      Forgot to add that your argument about memory savings from having a different class instantiated instead of instantiating a child of existing class is wrong on so many levels. Even if these savings did exist, they'd be absolutely insignificant unless the class had a thousand or more instances instantiated at the same moment of time.
      Reply With Quote Reply With Quote

    5. March 12, 2010 #5
      pegasus
      • View Profile
      • View Forum Posts
      • View Blog Entries
      • Visit Homepage
      • View Articles
      pegasus is offline
      VaultWiki Team
      Join Date
      March 28, 2004
      Location
      New York, NY
      Posts
      2,934
      Blog Entries
      18
      Rep Power
      659
      Quote Originally Posted by kmike View Post
      IMHO it was the most unwise decision. Now you have to track changes to the corresponding core vBulletin files in each new vB patch and apply them to your copied code. If you don't, the copied code may miss some fixes and as a result, the forum functionality provided by the copied code may perform differently in the wiki area than in the forum area.
      This is not a refusal to inherit some classes out of stubbornness. This is just something that cannot really be improved upon. In many cases, we tend to fix things before vBulletin - there were many parser inconsistencies in vB 3 that performed differently in the wiki parser, because we fixed them and vBulletin didn't for a while (e.g. problems with capitalization in BB-Code tags when used with NOPARSE).

      As I said, almost every method was modified in many of these classes. The wiki postbit factory is almost completely unique and inheriting from the standard postbit factory would be pointless. The only class that COULD be changed into a child is the wiki BB-Code parser, but the benefits would be minimal - because only a few methods have not been modified.

      This is an issue that has been revisited several times over the course of VaultWiki's development.

      Here are the improvements that should be made: http://www.vaultwiki.org/issues/1265/
      - lead developer for VaultWiki
      Reply With Quote Reply With Quote

    Similar Threads

    1. vBulletin 4.2
      By ricktas in forum General Discussion
      Replies: 4
      Last Post: June 13, 2012, 6:01 PM
    2. Convert Legacy Code to BB-Code
      By Rik Brown in forum VaultWiki Questions
      Replies: 8
      Last Post: August 3, 2010, 2:29 PM
    3. vBulletin 4.0.3
      By Mokonzi in forum General Discussion
      Replies: 4
      Last Post: April 11, 2010, 12:17 AM
    4. vBulletin 4.0.2
      By freexav in forum General Discussion
      Replies: 3
      Last Post: April 3, 2010, 12:35 PM
    5. vBulletin 4
      By tscargo in forum Pre-Sales Questions
      Replies: 14
      Last Post: December 23, 2009, 9:55 AM

    Tags for this Thread

    about, article, attachment, because, been, before, better, between, bit, but, cannot, changed, changes, check, class, code, completely, core, could, defined, did, different, discussion, discussions, don, duplicate, each, example, existing, factory, few, files, follow, for, found, from, functions, has, having, here, http, important, including, into, its, load, main, make, man, many, method, more, most, now, numerous, only, out, own, places, postbit, process, quote, really, revisited, same, script, should, show, showthread, some, something, tab, ted, that, them, things, this, vaultwiki, vbulletin, version, very, was, way, were, where, while, wiki, with, work, would, www, you

    View Tag Cloud

    Bookmarks

    Bookmarks
    • Submit to Digg Digg
    • Submit to del.icio.us del.icio.us
    • Submit to StumbleUpon StumbleUpon
    • Submit to Google Google

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •  
    • BB code is On
    • Smilies are On
    • [IMG] code is Off
    • [VIDEO] code is
    • HTML code is Off

    Forum Rules

    • Contact Us
    • License Agreement
    • Privacy
    • Terms
    • Top
    All times are GMT -4. The time now is 3:00 PM.
    This site uses cookies to help personalize content, to tailor your experience, and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Learn more… Accept Remind me later
  • striker
    Powered by vBulletin® Version 4.2.5 Beta 2
    Copyright © 2023 vBulletin Solutions Inc. All rights reserved.
    Search Engine Optimisation provided by DragonByte SEO (Pro) - vBulletin Mods & Addons Copyright © 2023 DragonByte Technologies Ltd.
    Copyright © 2008 - 2013 VaultWiki Team, Cracked Egg Studios, LLC.