Thread overview | ||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
May 05, 2004 Deprecating C style casts | ||||
---|---|---|---|---|
| ||||
Currently, D supports C style casts: (type)expression as well as D style casts: cast(type)expression The C style casts are tricky to parse right, and I think will cause increasing problems down the road due to the syntactical ambiguities with it. The D style cast has no such problems, and it has the advantage of being greppable (as some programming styles consider an explicit cast to be a bug, and being able to find and check them all to be a Good Thing). What do people think about first deprecating, then removing, the C style cast? |
May 05, 2004 Re: Deprecating C style casts | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | Walter wrote:
> Currently, D supports C style casts:
>
> (type)expression
>
> as well as D style casts:
>
> cast(type)expression
>
> The C style casts are tricky to parse right, and I think will cause
> increasing problems down the road due to the syntactical ambiguities with
> it. The D style cast has no such problems, and it has the advantage of being
> greppable (as some programming styles consider an explicit cast to be a bug,
> and being able to find and check them all to be a Good Thing).
>
> What do people think about first deprecating, then removing, the C style
> cast?
>
>
just do it,
D has no intention of compiling C code, and it will certainly mark the spots where something funny is going on
roel
|
May 05, 2004 Re: Deprecating C style casts | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | Walter wrote: > What do people think about first deprecating, then removing, the C style > cast? +1 -- Julio César Carrascal Urquijo http://jcesar.f2o.org/ -----BEGIN GEEK CODE BLOCK----- Version: 3.12 GCS$ d- s+:+ a-- C++> ULS++ P++ L+> !E W+++ N+ o? K? w++> O---@ M V? PS+ PE Y+ PGP t+ 5- X+++@ R- tv+(++) b++> DI! D++> G e+> h-- r- y+ ------END GEEK CODE BLOCK------ |
May 05, 2004 Re: Deprecating C style casts | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | Yea rip em out there. I vote yes, take away C style casts. C On Wed, 5 May 2004 10:04:08 -0700, Walter <newshound@digitalmars.com> wrote: > Currently, D supports C style casts: > > (type)expression > > as well as D style casts: > > cast(type)expression > > The C style casts are tricky to parse right, and I think will cause > increasing problems down the road due to the syntactical ambiguities with > it. The D style cast has no such problems, and it has the advantage of being > greppable (as some programming styles consider an explicit cast to be a bug, > and being able to find and check them all to be a Good Thing). > > What do people think about first deprecating, then removing, the C style > cast? > > -- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/ |
May 05, 2004 Re: Deprecating C style casts | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | please do deprecate in the next release, remove in the one after that. Fix is trivial enough to warrant such a short period "Walter" <newshound@digitalmars.com> wrote in message news:c7b6vn$1o0h$1@digitaldaemon.com... > Currently, D supports C style casts: > > (type)expression > > as well as D style casts: > > cast(type)expression > > The C style casts are tricky to parse right, and I think will cause > increasing problems down the road due to the syntactical ambiguities with > it. The D style cast has no such problems, and it has the advantage of > being > greppable (as some programming styles consider an explicit cast to be a > bug, > and being able to find and check them all to be a Good Thing). > > What do people think about first deprecating, then removing, the C style cast? > > |
May 05, 2004 Re: Deprecating C style casts | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | i dont see what's wrong with C style casts. Exactly how would this proposal reduce my D-coding bugs? In article <c7b6vn$1o0h$1@digitaldaemon.com>, Walter says... > >Currently, D supports C style casts: > > (type)expression > >as well as D style casts: > > cast(type)expression > >The C style casts are tricky to parse right, and I think will cause increasing problems down the road due to the syntactical ambiguities with it. The D style cast has no such problems, and it has the advantage of being greppable (as some programming styles consider an explicit cast to be a bug, and being able to find and check them all to be a Good Thing). > >What do people think about first deprecating, then removing, the C style cast? > > |
May 05, 2004 Re: Deprecating C style casts | ||||
---|---|---|---|---|
| ||||
Posted in reply to imr1984 | imr1984 wrote:
> i dont see what's wrong with C style casts. Exactly how would this proposal
> reduce my D-coding bugs?
I don't think it will.
What it will do is make the compiler simpler, and the language easier to parse. That means that the compiler will be faster, and code analyzing tools will be better.
-- andy
|
May 05, 2004 Re: Deprecating C style casts | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | Walter wrote:
> What do people think about first deprecating, then removing, the C style
> cast?
+1
D-style casts: great. C-style casts: lame.
|
May 05, 2004 Re: Deprecating C style casts | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andy Friesen |
The closer D will remain related to C and Cpp, the more likely people are willing to have a closer look at D and programm with it and switch to it. D has to be intuitive for D-newbies. I merely tried D because it looked and felt so familiar.
I'd be more than disencouraged if C/Cpp style casts were missing, because I'm simply used to them; I like them.
>
> I don't think it will.
>
> What it will do is make the compiler simpler, and the language easier to parse. That means that the compiler will be faster, and code analyzing tools will be better.
>
> -- andy
|
May 05, 2004 Re: Deprecating C style casts | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | "Walter" <newshound@digitalmars.com> wrote in message news:c7b6vn$1o0h$1@digitaldaemon.com... > What do people think about first deprecating, then removing, the C style cast? +1 |
Copyright © 1999-2021 by the D Language Foundation