worden.john at gmail.com
Mon Nov 16 01:37:56 UTC 2009
I made the changes suggested by Bert and used StandardFileStream. Yes it
fixes the speed issue.
As I said previously this has been interesting but it does leave me with
mixed feelings which while off topic Ill express. As I said at the start of
this I am a beginner. I can write a simple program and make it work and
have done (PHP/Python/VisBasic/VBA).
I came to Squeak/Smalltalk and started having a play. There is something
addictive about it but at the same time there are things like the speed
issue above that don't make it "easy" for the learner. As an exercise I
started to convert the excellent Cincom VW Tutorial to work in Squeak and at
the same time I was converting it into Python. End result is that I had
less difficulty getting it to work in Python than simply converting to
Squeak. I wasn't expecting that. (For interest the other big problem I had,
in addition to the speed one, was with the CrLf handling)
I am *not* trying to compare one language to another. Neither is it a
judgement call on whats right or wrong all have their fit I'm sure. My
question is whether people feel Squeak really is suitable for someone who
just enjoys scripting simple programs? I can see the value in it from an
educational perspective but for someone like me (who to be honest doesn't
even want to worry about what things like UTF8 Support are all about) is it
a good choice?
On Mon, Nov 16, 2009 at 8:26 AM, John Worden <worden.john at gmail.com> wrote:
> Thanks to all.
> Interesting and educational.
> On Mon, Nov 16, 2009 at 12:17 AM, Bert Freudenberg <bert at freudenbergs.de>wrote:
>> On 14.11.2009, at 23:07, John Worden wrote:
>> > So are you saying that my example is slow because of the time taken to
>> process the text data files in Squeak? (I was using 3.10)
>> > Not that it matters in this case but how would I work around this if it
>> were a real application that needed to handle data in this way?
>> > John
>> If you do, e.g.,
>> FileStream readOnlyFileNamed: myFileName
>> it creates a MultiByteFileStream nowadays (see #concreteStream). It would
>> be nice if we could just set a no-op converter in a MultiByteFileStream.
>> However, that class has not been optimized for speed yet, even without an
>> expensive converter it is much slower. It reads characters one-by-one
>> instead of block-wise, which obviously isn't speedy exactly, as you noticed.
>> Instead of the abstract FileStream use the stream class you want
>> explicitly. StandardFileStream is the old class that does no conversion. So
>> you would open your file like this instead:
>> StandardFileStream readOnlyFileNamed: myFileName
>> - Bert -
>> Beginners mailing list
>> Beginners at lists.squeakfoundation.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Beginners