Re: generics and arrays and multi-class collections
- From: xen <xen@xxxxxxxxxx>
- Date: Tue, 02 Oct 2007 09:02:37 +0200
On Mon, 01 Oct 2007 20:21:17 -0700, Daniel Pitts
<newsgroup.spamfilter@xxxxxxxxxxxxxxxxxxx> wrote:
I'm not against performance optimizations at all, I'm just saying you
should do it as a last step after you've created the "perfect" design
(perfect being relative). And you should only do it with the help of
profiling tools. In any case, it sounds like you're particular problem
needs optimization. Is there some form of time-limit?
Yeah, the program has 30 seconds for the entire game, which can last
for 200 moves, so I have to fit 100 moves in 30 seconds.
Java is a lot of fun to program in :-). But whats wrong with C? You can
write really elegant programs in C if you know what you're doing. Gotta
love function pointers! :-)
Well, I haven't finished the book I was reading on C so my opinion
might not be final, but....
I don't like the way the variable declarations have their type mixed
with the variable name, that is, a pointer is not char* p, but char
*p, and an array of char ptrs is char *p[], and a ptr to an array is
char (*p)[], but it kinda makes sense because that's also the way
you're going to use the variable.
Also, it's stupid that you dereference by *p instead of p* or p^. I
think that's the main reason they needed to introduce p->field because
you get pretty tired of writing (*p).field.
And then there's the lack of nice basic string manipulation.
Everything is so bloody low-level. It's like you have to make fire
with firestones when you're used to using matches. String ought to be
a type, not a bloody pointer to a piece of memory that may or may not
have a zero somewhere to terminate it.
It's quite cool that you can set up dynamic 3-dimensional arrays but
writing the code is a major headache. I've coded in basic, in pascal,
in assembler and in java, but i'll never code for fun in C, or even
C++.
Well, good luck on your bot competition.
Thanks.
.
- References:
- Re: generics and arrays and multi-class collections
- From: xen
- Re: generics and arrays and multi-class collections
- From: Daniel Pitts
- Re: generics and arrays and multi-class collections
- Prev by Date: Re: Eclipse 3.3 on AIX
- Next by Date: Re: Eclipse WebService
- Previous by thread: Re: generics and arrays and multi-class collections
- Next by thread: Re: OT: C declaration syntax Re: generics and arrays and multi-class collections
- Index(es):
Relevant Pages
|