Textpattern Forum

You are not logged in. Register | Login | Help

#1 2005-11-28 23:10:06

minusf
Member
Registered: 2005-02-15
Posts: 104

whitespace in the source

hi there,

ot: i am new to this project, is there a dev’s mailing list, or everything
is done thru the forum?

i was wondering if this project considers (any) priority to removing
the excessive unneeded whitespace in the pages.

yes, i know it’s probably not a real speed issue, but you know,
a bit saved (disk + bandwidth)…

and

<pre><code>$ cd site/
$ egrep -nr “[[:space:]]+$” * | wc -l
</code></pre>

spits out quite a list.
on a virgin install of txp 4.0.2 on my machine around 3251 lines.
and most of the time there is more than 1 whitespace on a line…

if using vim, this snippet will highlight whitespace in front of EOL
<pre><code>” syntax highlight whitespace at end of line
highlight WhitespaceEOL ctermbg=red guibg=red match WhitespaceEOL /\s\+$/
</code></pre>


we is experts™

Offline

#2 2005-11-28 23:23:25

ramanan
Plugin Author
From: Toronto
Registered: 2004-03-12
Posts: 323
Website

Re: whitespace in the source

I think the white space is there in the source because it helps with the readability of the source code. You’re only downloading the install files once, so I don’t see what the issue is.

Offline

#3 2005-11-28 23:29:56

Mary
Sock Enthusiast
From: Canada
Registered: 2004-06-27
Posts: 6,235

Re: whitespace in the source

Textpattern does not add whitespace, whitespace is there because you put it there. Remove it from your forms and pages, and it will be gone. Textpattern could remove it for you, except that it would also remove whitespace you did want there.


My email address has changed recently. If you need to contact me, use the forum contact form.

Offline

#4 2005-11-28 23:37:32

minusf
Member
Registered: 2005-02-15
Posts: 104

Re: whitespace in the source

none of you understood what i am talking about.

i am not talking about the indenting

i am talking about white space like this

<pre><code> } else {“_______”
</code></pre>

i used underscore instead of whitespace and put it inside quotation marks.

this whitespace after command is not useful at all.
when the php interpreter runs, it must process this whitespace also
and makes the files bigger by the way.

if you have vim installed on your machine, paste the snippet i showed
you into your .vimrc and open any txp php source to see what i am
talking about.


we is experts™

Offline

#5 2005-11-28 23:56:35

Mary
Sock Enthusiast
From: Canada
Registered: 2004-06-27
Posts: 6,235

Re: whitespace in the source

There is indeed a dev mailing list.

Whitespace within PHP doesn’t affect your bandwidth in the slightest. It’s not useful, but I also really doubt the amount of whitespace in Txp has any effect, negative or otherwise, on anything at all.


My email address has changed recently. If you need to contact me, use the forum contact form.

Offline

#6 2005-11-29 00:02:57

minusf
Member
Registered: 2005-02-15
Posts: 104

Re: whitespace in the source

yes, silly me, bandwith scratched.

well, i didn’t say it’s the first thing to do tommorrow morning:
get rid of the not needed whitespace or the sky falls down.

that’s why i was asking in the first place.

some dev’s just don’t like these byte leeches around here ;-)

on the other hand, there is not project on earth which does not have these…


we is experts™

Offline

#7 2005-11-29 15:24:08

ramanan
Plugin Author
From: Toronto
Registered: 2004-03-12
Posts: 323
Website

Re: whitespace in the source

Ah, I get what you mean now minusf, but as Mary pointed out, that still shouldn’t matter much at all, beyond simple aesthetics.

Offline

#8 2005-11-29 15:27:06

minusf
Member
Registered: 2005-02-15
Posts: 104

Re: whitespace in the source

well, the sources would be at least 3kb shorter ;-)


we is experts™

Offline

#9 2005-11-30 00:20:45

ubernostrum
Member
From: Lawrence, KS
Registered: 2004-05-05
Posts: 238
Website

Re: whitespace in the source

Just wait until I re-implement TXP in Python…


You cooin’ with my bird?

Offline

Board footer

Powered by FluxBB