Be gentle with me....

ajmayo at my-deja.com ajmayo at my-deja.com
Tue Dec 7 08:21:39 EST 1999


In article <slrn84oa56.pev.wtanksle at hawking.armored.net>,
  wtanksle at hawking.armored.net (William Tanksley) wrote:
> On Mon, 06 Dec 1999 10:49:25 GMT, ajmayo at my-deja.com wrote:
> >  ajmayo at my-deja.com wrote:
>
[snip]
> >In fact, I don't necessarily *want* to make that
> >client-side code easy to read - code obfuscation is actually a
feature
> >when you're trying to protect your intellectual property from the
> >browser's View Source feature.
>
> I don't buy this.  You're not getting enough value from this trivial
bit
> of obfusication, and you're losing a LOT.
>

er, I meant obfuscating the *client-side* code, not the server-side
code. But let's not get too excited about that. IE5, for instance,
supports client-side code encryption which is probably a better idea
than relying on obfuscation. I just meant really that there didn't seem
to be any way in Python of abbreviating the code so that (in pseudocode)

begin
   if something then
       begin
           more code with more nested blocks...
       end
   end if
end

could be output as a 'one liner' when producing dynamic client-side
code from the server. It looks to me like you have to (a) include the
line separators (b) use n spaces at the start of each block at level n.
This is just plain wasteful of communication line bandwidth, as well as
being a bit of a pain when you are writing the code.


[snip]
> >Secondly, I am afraid I gasped when I read that variables don't
require
> >declaration. This is a useful feature for tiny 'throw-away' programs
> >but please, please tell me there's the equivalent of Visual Basic's
> >Option Explicit or perl's Use Strict.
>
> You're telling us that you use obfusication but don't like the idea of
> variables not requiring declaration?
>
> Anyhow, Perl's use strict mode has essentially the same effect as
Python's
> normal operation (modulo a few minor behaviors).
>

As I said, I don't want to obfuscate the *server-side* code. No, I want
it to be a marvel of clarity and wit for the generations of programmers
who will maintain it. The server-side code doesn't go out to the
client, remember. I must admit I kinda feel mandatory variable
declaration has proven to be a *good* feature of modern programming
languages though I accept Javascript could do with the equivalent
of 'use strict' too.

So I guess you're telling me that you can't mandate variable
declaration in Python. Ah well, as long as I know, I guess.

[snip]

re Zope - yup, I will certainly be checking it out. Thanks again for
all your help.


Sent via Deja.com http://www.deja.com/
Before you buy.



More information about the Python-list mailing list