Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2008-07-01 12:06:48

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,273
Website GitHub

Re: You know you've been using TXP too long when...

… your next plugin is so ambitious it exceeds the plugin size limit and you’re faced with a dilemma:

  1. chop the plugin into two bits
  2. go thru the source, delete all comments / extraneous spaces, and reduce variable names to single letters to squeeze it all under 64k ;-)

What to do… what to do…


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#14 2008-07-01 13:05:35

redbot
Plugin Author
Registered: 2006-02-14
Posts: 1,410

Re: You know you've been using TXP too long when...

Bloke wrote:

… your next plugin is so ambitious it exceeds the plugin size limit and you’re faced with a dilemma:

  1. chop the plugin into two bits
  2. go thru the source, delete all comments / extraneous spaces, and reduce variable names to single letters to squeeze it all under 64k ;-)
    What to do… what to do…

chop… chop…

Offline

#15 2008-07-01 13:06:31

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: You know you've been using TXP too long when...

3. make the plugin contain a chunk of compressed code that is extracted and eval-ed each time the plugin is loaded ;) [this wins me the award for most ugly programming solution ever]

Offline

#16 2008-07-01 13:09:57

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,273
Website GitHub

Re: You know you've been using TXP too long when...

ruud wrote:

3. make the plugin contain a chunk of compressed code that is extracted and eval-ed each time the plugin is loaded ;)

Oooh, hadn’t thought of that! Keeps the amateurs out :-D


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#17 2008-07-01 13:52:09

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,273
Website GitHub

Re: You know you've been using TXP too long when...

Since this is a frivolous topic anyway, it reminds me of a story. When I was coding back at my old job we used to use one of several variants of method 2 to make the job more fun.

I used to do a lot of script work in ksh and awk (brilliant language) and we’d decide on a Theme-of-the-day to write an entire script using themed variables; e.g. all variable names must be aquatic in nature. Made for some interesting constructs like:

if (cod == sturgeon) {
   squid = herring++;
}

A variant on that was to use these random themed variable names to turn the code into something as close to prose as possible. So a scan of the code might reveal:

for (lady in waiting) {
  cook(dinner[lady]);
}

Also had the bonus of keeping the amateurs out and making for some interesting support calls… ;-)

Last edited by Bloke (2008-07-01 13:52:54)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#18 2008-07-01 15:15:13

iblastoff
Plugin Author
From: Toronto
Registered: 2006-06-11
Posts: 1,197
Website

Re: You know you've been using TXP too long when...

when you’ve set up firefox quick bookmarks so that when you type “txp tagname” in the url bar it automstically searches textbook for ‘tagname’

Offline

#19 2008-07-01 15:57:14

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: You know you've been using TXP too long when...

iblastoff wrote:

when you’ve set up firefox quick bookmarks so that when you type “txp tagname” in the url bar it automstically searches textbook for ‘tagname’

Or you make a bookmarklet for textbook to search the tag reference…

Offline

Board footer

Powered by FluxBB