Will converting to API 2 be mandatory in next future?

Painting :grin:

1 Like

Coding without autocomplete would be like going back to coding so many years ago it would not be fun or productive. Maybe there is a secret switch.

2 Likes

PaintingAt :slight_smile:

8 Likes

Let’s talk about differences between CellLostFocus and CellFocusLost… amazing :smiley:
Seriously, I’m still asking what are the real benefits around that migration… but we have to do sooner or later.

That is pure genius. Love it!

2 Likes

Would you be doing bad spirit? :smiley:

I converted all my 12 projects to API2, some are big, but not very big.

And yet is how several of us experienced Xojo users are programming nowadays.

2 Likes

Seems like a counter intuitive decision on Xojo Incs part in my opinion. I’m not using Xojo for my current project(s) but the thought of no autocomplete on legacy projects in a new version makes me inclined not to renew and not run newer versions. Is there a feedback request to reinstate this functionality?

3 Likes

There were many talks about it, it was a Xojo decision as an incentive to people to move to the new standards. I guess that a FB request will be closed as “Won’t implement. This feature is as designed” or something.

At some point everyone will need to move to newer versions as the host OSs evolve and your UI gets dated or things break or your old IDE does not support the new host, as an ARM version of it.

1 Like

At that point, since I’m now 75, either I’ll be gone, or by then I won’t care anymore.

1 Like

Maybe they are targeting the less than 75yo public, kind of make sense such choice.

1 Like

This is my fear, so I think I’ll migrate in one of the next weeks… I’ll roll up my sleeves!

Clone your project, keep the stable one ready for whatever need that appears, meanwhile work on the renewed one without stress at the pace it takes.

3 Likes

Although I do not intend to convert to API 2.00 controls for the moment, I find myself using the new API 2.00 syntax quite easily. A project can use indifferently the old and the new. And as usual, if needed, the LR is my friend.

1 Like

There are plenty of good things to like about API2. I think my favorite is the iterable dictionaries. It’s so much nicer to write

For Each Entry As DictionaryEntry In Dict
  If Entry.Key = "Target" Then
    MessageBox(Entry.Value)
  End If
Next

Than it was to write

Dim KeyBound As Integer = Dict.Count - 1
For I As Integer = 0 To KeyBound
  Dim Key As Variant = Dict.Key(I)
  If Key = "Target" Then
    MsgBox(Dict.Value(Key))
  End If
Next

(Ignoring the potential for typemismatch of course.)

There’s a handful of things that just feel more natural and I think the language is better for it, despite the growing pains. There are others (such as the aforementioned inline formula issue) that are a step backwards, but those are rare. I struggle to think of another example actually.

I’m not so satisfied with the new control events though. There’s next to nothing to be gained and a whole bunch of pitfalls, such as not being able to iterate over both old and new controls on a window. Mix and matching is perilous.

5 Likes

But that could have been coded perfectly well in API1
This is probably the very first and only example of API2 code I have seen to date that is smaller and easier to understand than the API1 equivalent.

2 Likes

You are not wrong, and why I’ve always been in favor of smaller targeted changes, rather than throwing the baby out with the bathwater.

2 Likes

Most are, e.g.

Var s, api1, api2 As String

s = "ab.bcdef.cdefghij.defghijkl"

api1 = Right(Replace(nthField(s, ".", 3), "g", "x"), 4) // mess

api2 = s.NthField(".", 3).Replace("g", "x").Right(4) // reads much better

To me, neither of those is particularly easy to read
…both suffer from ‘I will write this on one line of code if it kills me’

v1 = nthField(s, ".", 3)
v1 = replace(v1,"g","x")
v1 = right(v1,4)

or

v1= s.NthField(".", 3)
v1 = v1.Replace("g", "x")
v1 = v1.Right(4)

but to each their own.

3 Likes

This existed before API 2!

2 Likes