Re: What is "evil" about casting?
From: Jacob (jacob_at_yahoo.com)
Date: 09/29/04
- Next message: Andrew Thompson: "Re: laundry room help!"
- Previous message: Michael Borgwardt: "Re: Empty stack trace/method call from nowhere?"
- In reply to: Jonck: "What is "evil" about casting?"
- Next in thread: Sudsy: "Re: What is "evil" about casting?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 29 Sep 2004 16:37:30 +0200
Jonck wrote:
> Today I was reading through some discussions about the new functionality
> in Java 1.5 and there I read more than once that casting was considered
> "evil" and that generics would solve all this (or not, as others argued).
>
> Could someone give me a brief explenation as to what is wrong with
> casting and how generics in Java 1.5 will solve this? Personally I don't
> see what's wrong with casting, in all the books I've read on Java casts
> are used all the time...
Casting may cause errors that are not caught until runtime.
Purists wants as many errors as possible to be caugth during
compilation.
I've never understood the fuss about it. It is peanuts
compared to the extensive XML-"programming" and SQL-processing
which is common inside Java programs nowdays.
Actually I prefer the simple error prone "classic" syntax over
the more robust (but more complex) Generics syntax.
- Next message: Andrew Thompson: "Re: laundry room help!"
- Previous message: Michael Borgwardt: "Re: Empty stack trace/method call from nowhere?"
- In reply to: Jonck: "What is "evil" about casting?"
- Next in thread: Sudsy: "Re: What is "evil" about casting?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|