Python for large projects?

Darrell news at dorb.com
Sun Jun 27 01:29:01 EDT 1999


>
>   buf = open(file).read()
>   doTheBigJob(buf)
>   del buf
>
> No need to introduce new passing schema or wrap the buffer object in
> another object at all; this will clean it up for you.
>
My point was this isn't cleaned up until you return from doTheBigJob.

>
> If the only thing you're doing with the content of file is passing it
> to doTheBigJob, then its even /better/ to simply call it as:
>
>   doTheBigJob(open(file).read())
>
No doubt this is a clean way to open the file. But it doesn't work if you
wanted to act on the buffer before passing it on. I'm not attacking python
or reference counting here and agree that for most programs these aren't
even concerns. But when your shinny new application comes together and eats
200meg, you start to wonder. Tracking though everyone's code trying to
understand who has all this memory is real fun. My point was to think about
this stuff from the start, keep an eye on memory usage. Reference counting
can give a false sense of security.


> >6. No const or private.
> >    You have to trust everyone.
>
> This always struck me as a really /odd/ concern.  If you don't trust
> the people on your programming team, why are they on your team?  If
> you're afraid the hooks into your inner-code are visible, then rethink
> why you're concerned.  Mathods/slots on Python objects can be prefixed
> with _ and __ to make them harder to casually examine, but I've always
> equated 'reference hiding' with 'security through obscurity,' it
> doesn't protect you and it lends a false sense of hope.
>
Good or bad, this is one C++ guys aren't comfortable with. The project I'm
on now will allow people with minimal programming experience to write a
little python to control the larger application. One of my primary concerns
is performance and an optimization relies on them not changing a large
buffer, only look at it. So the people I don't trust aren't on my team. What
was it Murphy said ? "If it can go wrong"
I'm tempted to do this object in C++.
Agreed using __ to hide a name doesn't seem worth while.

I appreciate your reply because I'm still seeking the truth of these
matters.
--Darrell







More information about the Python-list mailing list