Auto to Text

Definitely a drawback. Is there any information from Xojo as to when/if that will happen?

[quote=355493:@Norman Palardy]Karen
At this point in time I can certainly understand why you feel this way.

The verbosity using the new framework is an interim measure while both old and new frameworks need to co-exist in projects.
[/quote]

It sounds like you think I am talking about having to use hierarchical namespaces … While I don’t like that ( the walls of text that tends to generate are hard to read) I can deal with it and USING helps and I understand the necessity… that is not what I am referring to… It’s the the level of nit picking that necessitates deeper knowledge,

Take the old posts in this thread for example… In the old framework I pretty much ignored introspection as I very rarely needed it (maybe once or twice since it’s introduction) …

But I do use variants and with those I often use the type property… but those type of applications REQUIRE that I use introspection if I want to do similar things with Autos. More to learn and more code and the code is slower to boot from what was posted above!

Can I figure it out? Sure … despite not being an IT professional I have coded for enough years in enough different languages with different phillosophies that I can deal with it…

But I don’t have to do that with the old framework … And having to do it makes the learning curve that much higher for newbies.

The new framework makes me feel like I am writing a pharmaceutical SOP for a GMP process with a VERY nit picking QA department looking over my shoulder… and I can tell you back when I was in pharma , while I could do it, it was not very enjoyable!!!

The old framework is far from perfect, but in general the balance between convenience and safety is more to my liking than it appears to be with the new framework.

  • Karen

I’ve used Auto enough now to prefer it over Variant.

The only place where it can get bizarre is when you have JSON arrays and dictionaries embedded in other JSON. It becomes a crazy mess trying to navigate through it because dictionary values might be another dictionary or might be an array of Auto which means you have to do further manual conversion each level down.

Variant gives you a false sense of security that the framework knows how to handle whatever you just fed it. It may or may not. There are subtle bugs that can be hidden in those auto-conversions. Auto makes no effort to convince you it knows anything so you have to code a bit defensively. This is probably better overall.

I feel the same way about xojo.core.date/dateinterval. Old framework is easier to approach.

I agree. the old date framework seems to work much easier and better than the new one (for me).

Let me reiterate

[quote=355493:@Norman Palardy]
We need to get more of the new framework fleshed out so a “new framework only” project is possible and very similarly featured to what everyone has used for the last 15+ years[/quote]

And far easier to get really wrong in many ways

Dates are not handled nearly as well in the old framework and VERY easy to get really wrong
For instance take any date and find out if daylight time is in effect (been there done that and its a horrid hack to do)

Or take any date and find the date that is 1 year 1 month and 1 day in the future
You MUST do this in the right order or you get a VERY incorrect result

Neither of these issues exist in the new framework

And once we

[quote=355493:@Norman Palardy]
get more of the new framework fleshed out so a “new framework only” project is possible and very similarly featured to what everyone has used for the last 15+ years[/quote]
then it should make it easier for you to write code that has no weird bugs because you did things in the wrong order on a date object etc
It should make it easier to write correct code

Oh yes - just a couple of days ago I found this in Feedback: <https://xojo.com/issue/49953>

Dim x As Variant = 0.568 Dim i As Integer = x*100*-1 MsgBox Str(i)
You probably assume that this results in: i=-56
However, it is: i=0

You wonder why…? Because of implicit type conversion.

That’s why I it is good advice to always tell the Variant which value-type you want (or be forced to do so with Auto).
In the example above it would be safe(r) to write this (and you “Auto-manually” get the expected result):

Dim i As Integer = x.DoubleValue*100*-1

Yes. Something I showed at XDC 2016

[code]Dim v1 As Variant = 5
Dim v2 As Variant = “3”

Dim result1 As Variant = v1 + v2
Dim result2 As Variant = v1 - v2
Dim result3 As Integer = v1 + v2
Dim result4 As String = v1 + v2
Dim result5 As String = v1 - v2[/code]

What do you expect for results?
.
.
.
.
.
.
.
.
Answer:
result1 = “53”
result2 = 2
result3 = 53
result4 = “53”
result5 = “2.0”

In that code, you wouldn’t know what to expect. However, knowing that it’s a variant you’d actually use v1.integervalue and v2.stringvalue in those result calcs. The great thing about variants is that you can extract in the type you know it is, like from API calls.

That’s harder to do with Auto which makes me prefer the old framework. The new framework is way less obvious. :frowning: Many Xojo devs can handle creating methods to get around not having Auto conversion methods like Brock’s method, but new users to Xojo won’t gain that advantage until after they are committed to Xojo. Same thing with xojo.core.date/date interval. Just need to make a method to reduce the new framework complexity. It just a bummer that every dev has to go thru that process.

But they dont if there was a “common additions” shared project or something hosted on Github and then anyone could use it and those who felt inclined could add to it

But “citizen developers” staring out would not know about such things… If it’s not built in , at least at first, it does not exists… and such things are not guaranteed to not to break with new Xojo versions.

IMO the new framework is not as easy to use as the old because of the philosophy behind it. Unless that changes it will never be as easy and as “fun” to use as the old.

  • Karen

That is indeed important (but not the way you meant it).

The hours I struggled ten years ago learning RB. I constantly was solving issues which with Auto, Xojo.Core.Date, etc. would not have been issues at all because they would have popped-up immediately and not at runtime. The faster the old framework is gone the better.