-
MODX Staff
- 12,272 Posts
A migration guide would indeed be good. For example, "To make your existing ditto calls work the same, add extenders=`blah, blah2`, and change the following templates: ..."
Ryan Thrash, MODX Co-Founder
Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
i am having same problems like you ryan.
i am totally confused - and i thought i would get stuff like that. ;-)
Does this idea seem like something that might help people in this and other similar situations?
Quote from: ZAP at Mar 10, 2007, 10:06 AM
You know I was thinking that it might be a good idea if all snippet developers started dealing with backwards-compatibility the same way. There are a ton of changes between ditto 1 and 2 for example, and it can mean that you need to make a lot of changes to all of your snippet calls if you upgrade. At the same time, as a developer it’s a drag to have to be saddled with supporting all past versions when you probably had good reasons for making the changes in the first place.
What if all snippet developers started adding a common parameter (&backwardsCompat=`1`) to all snippets that would when set run a function with a standard name that did all of the variable conversion and whatever else were necessary to make things work the old way. Then developers could keep the vast majority of this code in one standard place (keeping the new code neater), and users who don’t need the old methods would not set that parameter. If you had a site with a lot of old snippet calls and you wanted to upgrade them all you could set this parameter in the new snippet itself and that way avoid having to change all of your snippet calls throughout your site).
What do others think of this idea?
-
MODX Staff
- 12,272 Posts
I think it honestly adds a lot of bloat to snippets. Documenting the changes is entirely reasonable, though I would think that changing the snippet name (e.g., Ditto2) would also be a good solution. There is a boatload of stuff that needs to change with Tiny MCE 2.10 for example, and it’d be a lot easier to make a new one than worrying about upgrades. Snippets that are functioning should be able to be more easily excluded from upgrades.
Ryan Thrash, MODX Co-Founder
Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
I was actually thinking that this might reduce the bloat. A lot of the major snippets already include backwards-compatability code (including Ditto), but it’s scattered throughout the snippet and therefore difficult to debug and maintain. If it were all in one place then developers could keep track of it better and users could decide whether to include it (add bloat) or not (it could even be a separate included file if people think that would make it more efficient).
As an example, if this parameter were set people wouldn’t need to set the summary extender or remove the tv prefixes or change hiddenTVs to hiddenFields, etc. The backwardsCompat funtion would just set those variables and then pass them on to the snippet as if they’d been set the new way. Other more complex conversions could also take place in this function, but the snippet itself wouldn’t need to have all that code mixed in.
I already do this myself when there are major changes in new versions of snippets. I create some quick parameter-translation or other update code and add it to the beginning of the snippet. If you have a site with a whole lot of snippet calls, this can save you a great deal of downtime in the update process.
To quote from er16004;
He’s already provided plenty of great documentation to a great product and if I were in his shoes, I’d be spending time perfecting the product rather than writing documents and answering silly requests.
I respectfully disagree. On the contrary, the documentation lacks one essential ingredient; how to use the product. If there were good examples of how to use the syntax there would be fewer questions in the forum. It is no use to document a piece of software and leave out the how-to-use-it.
For example, if I sat you down in a 737-800 cockpit and said "execute a fullly automated cat.3 approach - and everything you need is in front of you" - you wouldn’t have a clue how to start - clear as glass to me though.
It’s the same with software. Good tools require instructions from the creator on the use.
Cheers,
HalD
"Today’s headlines are nothing more than whispers of history"