Re: do I incur a penality on compile time if I explicitly declare default behavior ?

2021-06-22 Thread max haughton via Digitalmars-d-learn
On Monday, 21 June 2021 at 04:12:55 UTC, someone wrote: I mean, coding as following: ```d int intWhatever = 0; /// default being zero anyway foreach (classComputer objComputer, objComputers) { ... } /// explicitly declaring the type instead of letting the compiler to figure it out struc

Re: do I incur a penality on compile time if I explicitly declare default behavior ?

2021-06-22 Thread frame via Digitalmars-d-learn
On Monday, 21 June 2021 at 22:56:30 UTC, someone wrote: This might happen even though you wrote the actual type at the time -- sometimes library code changes the type, and just uses alias this to allow original code to compile. For what I was reading a couple of days ago while navigating

Re: do I incur a penality on compile time if I explicitly declare default behavior ?

2021-06-21 Thread someone via Digitalmars-d-learn
On Monday, 21 June 2021 at 08:06:06 UTC, frame wrote: Even if it would have an impact ... Furthermore, regardless of the impact, one of the pros of explicitly coding like this is to help future-portings of the base code to another language if need so, the team porting the code won't be

Re: do I incur a penality on compile time if I explicitly declare default behavior ?

2021-06-21 Thread someone via Digitalmars-d-learn
On Monday, 21 June 2021 at 13:23:04 UTC, Steven Schveighoffer wrote: For sure there is a difference in what the compiler has to do. Indeed. But I think the check is likely trivial, and inconsequential as far as compiler runtimes. D is going to already figure out the types of expressions

Re: do I incur a penality on compile time if I explicitly declare default behavior ?

2021-06-21 Thread someone via Digitalmars-d-learn
On Monday, 21 June 2021 at 08:06:06 UTC, frame wrote: Even if it would have an impact - it may change with a new compiler release. I personally use explicit declaration in a foreach loop, because the IDEs don't get the type and it cost me more time to figure out the method signature on

Re: do I incur a penality on compile time if I explicitly declare default behavior ?

2021-06-21 Thread Steven Schveighoffer via Digitalmars-d-learn
On 6/21/21 12:12 AM, someone wrote: I mean, coding as following: ```d int intWhatever = 0; /// default being zero anyway foreach (classComputer objComputer, objComputers) { ... } /// explicitly declaring the type instead of letting the compiler to figure it out struc Whatever {    public

Re: do I incur a penality on compile time if I explicitly declare default behavior ?

2021-06-21 Thread frame via Digitalmars-d-learn
On Monday, 21 June 2021 at 04:12:55 UTC, someone wrote: I mean, coding as following: Even if it would have an impact - it may change with a new compiler release. I personally use explicit declaration in a foreach loop, because the IDEs don't get the type and it cost me more time to figure

do I incur a penality on compile time if I explicitly declare default behavior ?

2021-06-20 Thread someone via Digitalmars-d-learn
I mean, coding as following: ```d int intWhatever = 0; /// default being zero anyway foreach (classComputer objComputer, objComputers) { ... } /// explicitly declaring the type instead of letting the compiler to figure it out struc Whatever { public doSomething() { ... } /// explicitly