Hi Wolfgang,
yes, of course this is a possible issue ;-0)
just because a method is STATIC does not say that it MUST be housed / kept in a class library outside of the current Project.
After all, a STATIC method is really just a function.
Can you think of any other useful properties which are project dependant and likely to need my attention ?
Regards,
Phil.
Zero / One based arrays - finding out which !?
- Phil Hepburn
- Posts: 743
- Joined: Sun Sep 11, 2016 2:16 pm
Zero / One based arrays - finding out which !?
Hi Phil,
Change it in a working application and the application will not work anymore....
Wolfgang
If I look at all the compiler options, this one seems to be the only dangerous one.Can you think of any other useful properties which are project dependant and likely to need my attention ?
Change it in a working application and the application will not work anymore....
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
-
- Posts: 178
- Joined: Sat Dec 05, 2015 10:44 am
- Location: Germany
Zero / One based arrays - finding out which !?
Phil,
Wolfgang
as long as you have your unit tests working there is nothing dangerous.
Phil, during the time your are searching a solution you could have changed hundreds or thousands lines of code to the zero based approach. I bet in most cases it is from
for i := 1 to count
to
for i := 0 to count-1
only.
Count the key strokes. Then you know what is faster. And think about compiler pragmas. They are not spported now but I hope in the next future. Wait until this. Then you can change class for class, entity for entity, switching az on and off within your code.
All other approaches lead into confusion I think and make it bit harder to change to collections. I would avoid any tricks even I said cool! to Wolfgangs solution. But thinking a while on it: who knows in a few years what's behind FirstIndex? Is this only the zero thing or does it have context dependend meaning? From my point of view it makes code less readable.
Frank
Wolfgang
as long as you have your unit tests working there is nothing dangerous.
Phil, during the time your are searching a solution you could have changed hundreds or thousands lines of code to the zero based approach. I bet in most cases it is from
for i := 1 to count
to
for i := 0 to count-1
only.
Count the key strokes. Then you know what is faster. And think about compiler pragmas. They are not spported now but I hope in the next future. Wait until this. Then you can change class for class, entity for entity, switching az on and off within your code.
All other approaches lead into confusion I think and make it bit harder to change to collections. I would avoid any tricks even I said cool! to Wolfgangs solution. But thinking a while on it: who knows in a few years what's behind FirstIndex? Is this only the zero thing or does it have context dependend meaning? From my point of view it makes code less readable.
Frank
- Phil Hepburn
- Posts: 743
- Joined: Sun Sep 11, 2016 2:16 pm
Zero / One based arrays - finding out which !?
Frank, Wolfgang, all,
I appreciate that this is an issue which needs some careful thought, however, as a start I can't see anything too wrong with what I have working in the sample shown in the two images below. It should work for all types of .NET array.
Polymorphism works in our favour on line 209
Have a nice evening,
Phil.
P.S. please realise that the inserted code is still just work in progress for the Cologne conference sessions in April 2018.
I appreciate that this is an issue which needs some careful thought, however, as a start I can't see anything too wrong with what I have working in the sample shown in the two images below. It should work for all types of .NET array.
Polymorphism works in our favour on line 209
Have a nice evening,
Phil.
P.S. please realise that the inserted code is still just work in progress for the Cologne conference sessions in April 2018.