[ale] Organizing data
Jeff Hubbs
hbbs at comcast.net
Wed Apr 28 11:10:43 EDT 2004
I just recently tried writing some Python recently and, since I was
heavily dependent on a book I bought some time ago, one of the things I
came across in there was a statement to the effect of "if you want to
write procedurally in Python, you can, but it's meant to be an OO
language."
I'm old-school, so procedurally is how I'd tend to write. What I was
writing was a utility to take a CSV text file and make HTML from it.
You'd invoke it with <utilityname.py> <inputfilename>
[<outputfilename>]. If you didn't supply an outputfilename, it would
make one for you and if you didn't supply any arguments at all or if the
input file wasn't found, it would make an error message and exit.
What I found myself doing is bracketing pretty much the whole thing in
an exception dealing with the no-argument case. I got all of this to
work but I had to wonder if I was doing it screwed-up in part because I
wasn't using an OO approach.
- Jeff
On Wed, 2004-04-28 at 09:51, Jason Etheridge wrote:
> Fletch wrote:
> > perldoc perlreftut, perldoc perlref.
>
> Yeap. I missed it the first time around:
>
> Using a reference as a string produces both its referent's
> type, including any package blessing as described in the
> perlobj manpage, as well as the numeric address expressed in
> hex. The ref() operator returns just the type of thing the
> reference is pointing to, without the address. See the ref
> entry in the perlfunc manpage for details and examples of
> its use.
>
> It doesn't warn against using a reference as a string though. What's
> the fear there?
>
> > Granted an object would probably count as a value in the situation at
> > hand this wouldn't be what you'd want, but it's nice to know.
>
> Would Perl be a good language for me to learn object oriented
> programming? Or would I be better served with something like Python or
> Java? It's been ages since I messed with C++ or Smalltalk (or
> especially Turbo Pascal 5.5), and I never really did anything on a scale
> where I could see an advantage to using OOP with all those neat
> buzzwords like polymorphism and stuff.
>
> -- Jason
>
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://www.ale.org/mailman/listinfo/ale
More information about the Ale
mailing list