Archived from groups: rec.games.frp.dnd (
More info?)
Keith Davies <keith.davies@kjdavies.org> wrote:
>Dave Butler <ci915@freenet.carleton.ca> wrote:
> (h) Nondeterministic behavior. You have *no idea* when the GC will
> reap a particular object. You therefore have no idea when
> finalize() will be called. Or even *if* it will be called, since
> IIRC the spec doesn't guarantee it will.
My notes indicate that you're correct. OTOH, use of finalize() is
supposed to be rare.
> So: acquire resources, and clean them up yourself *anyway*
> because you have no other way to ensure that it happens. Okay,
> memory may be reclaimed, but that file handle will remain open
> for an unknown time, unless you close it explicitly yourself.
I'm more used to C; doesn't C++ have some analogue to fclose()? I
suspect you've chosen a poor example, because most languages I'm
familiar with use the "close the file as soon as you're done with it"
paradigm.
>That one is one of my biggest turn-offs for Java.
What did you need finalize() for, if you're free to talk about it? I've
never had to touch it, but I'm not about to claim that I've done any
"great works" in Java.
>> It's possible to write Java code that's within a hair of C++ code in
>> terms of execution speed. It's even possible to benchmark numerical
>> code that, once Hotspot messes with it, runs *faster* than C++ code
>> (troll around the comp.lang.java.* groups, if you're interested).
>I suspect that it may run faster for specific code after Hotspot's
>messed with it, because Hotspot can rearrange the calls and whatnot...
>at which point you're technically not running the same code. If you've
>got a good optimizing compiler and decent choice of algorithm I suspect
>C++ would move back into the lead.
*shrug* It's an argument for the ages. Hotspot has the advantage that
it works to optimize the code as it sees data. C++ forces you to write
more general algorithms or really know the data that you'll be working on.
As for "not the same code", it's just another level of optimisation in
the compile process. It's odd, I'll grant you, that the work continues
even after the program has started running (and isn't saved), but it's
all in aid of getting down to machine instructions.
>> It's just work -- like doing anything well -- and it seems that many
>> have the view that, because Java is simple to write code in, it should
>> be simple to write _good_ code in, and that seems to not be true.
>If you've got a simple language that isn't simple to write good code in,
>something's wrong.
[snip]
>C++ is at least honest about the complexity. It doesn't pretend to be
>easy. It does take greater knowledge to use. It also requires some
>more discipline (or at least learned discipline, since once you've got
>the habits it's not really noticeable). Experience counts for much.
And yet, it's easy to write a program in C++. Tens of thousands of
university students do it every year. Some even hack together
projects of moderate size. Likewise Java.
(Now, you're right, Java lies like a rug about complexity. The vastly
funny part is that a big part of the learning curve deals with memory
management (threading and GUI stuff round out the top three).)
>I'm biased. I'm comfortable with C++, and feel (in general) that dumb
>tools are for dumb people. I *appreciate* expertise and tools that
>require expertise.
The "problem" is that Java requires a different bundle of expertise.
It's a different language with some of the same heritage. You wouldn't,
typically, write C++ code using precisely the same techniques as for
writing C code, yet I see a fair number of folks pounding away at Java
as if it were C++.
It's funny where people find their programing comfort level. My learning
route went something like [BASIC and Logo] -> Forth -> [C, some Pascal] ->
[Java and assembly (x86, primarily)] -> C++. I picked up Postscript and
Perl along the way someplace, and I'd really like to find the time to
learn Lisp/Scheme. Of those languages, I'd have to say that the one I'm
happiest coding in is assembly.
>> ObD&DCharacter Sheets: Pen and paper's best; for computer-aided stuff
>> I'd just go with text files (using vi, but your editor's your choice).
>I use Perl a lot when running numbers.
How much number running is there to do, really? I've used Java for the
couple of times I've needed strange math done (e.g., make a random set
of stats based on 25-point-buy), or to automate the dog work (treasure
generation), but I wouldn't say that I've found a real need (or want)
for number crunching.
>I still want to find (or build) a designer's Wiki. Nice, simple text
>editing building decent-looking webpages, with certain features that'd
>make my life easier than standard Wiki (such as the ability to create
>'data types' that provide me with a suitable form for entry, ideally
>with some ability to double check certain things.
Funny, really. I've never seen the attraction to Wikis (Wiki? Wikies?
Wikae?).
--
--DcB