API1, API2 & Xojo.Core Question

The extension method style which gives you the dot notation isnt bad as far as readability goes BUT since you cannot replace every instance of an olld non-extension method with a dot notation one you end up with a mish mash of them

A simple example is something like checking if a key pressed is number key
In old style you could do

   if instr("0123456789", key) .....

and there’s not replacement for that using something like

   if "0123456789".Instr(key) .....

So the API 2 style only improve some readability

Renamed properties is, IMHO, not that nbig a deal and in some cases improves things and in some cases makes thing less clear and in some cases improves them

1 Like

Norm… are you advocating the 2nd Instr syntax?
I find that much less readable / intuitive than the 1st

1 Like

The revised folderitem code is basically the code from Xojo.io.Folderitem
Its been updated a bit but still mostly that code

I would expect that many items from the Xojo namespace will, where it makes sense, migrate to the global name space

1 Like

No
Just saying that API had use cases that API 2 cant cover because of how its done
They’d need to make some compiler related changes to make the second form work

And IF they did then API 2 might be slightly more consistent and read nicer than it does now

Currently that second use case requires you to add a string variable or constant that you can then use in that expression and THAT is a potential source of new bugs

1 Like

Geoff mention the new controls in desktop

And Geoff mentions this in the Q & A Video

He never said that, as Garry said, He just made up his mind and the rename is going to happen. He just decided to do it with new API2 classes, deprecating all the current controls. Just like web 2.0 is API2 only, looks like we are going to have a Desktop 2.0 :rofl: :rofl: :rofl: :rofl:

1 Like

API 1.0 is still usable within the IDE with autocomplete & everything
Make a template project in 2019r1.1 and simply name it as show in
http://docs.xojo.com/UserGuide:Project_Types#Changing_Default_Projects
Done and done and API 1.0 works just fine

There are VERY few things that are API 2.0 ONLY

1 Like

Wow, I didn’t mean to open a can of worms here. Thanks to all for the comments and input.

I’m still lost though. What the heck is Xojo.Core? Is this the “modern” framework in between API1 and API2? Is this now deprecated/EOL’d? Can I simply go “back” to FolderItem?

1 Like

Xojo.Core is part of the Xojo framework that came AFTER API 1 and before API 2 as part of iOS and had some portions on desktop etc

At this point since Xojo has said everything will be API 2 you might as well go back to that

Not really a can of worms but there are definitely some strongly held opinions
For anyone that had/has to use old IDE’s and newer ones to support a wide range of customers / client on a wide rang of OSes API 2 is a non-starter.
As soon as you adopt any of it you cannot go back to any old IDE which limits how far back you can support. If you have clients that still use old versions of Windows like XP of old versions of Windows Server, old linux distros which is somewhat common, or old versions of macOS you have to avoid API 2.
You’ll find there are a decent number of people that do have to do this for their customers.

Beyond that there are ancillary issues like :

  • all the code samples in every issue of xDev up to mid 2019 are now out of date
  • all the non-Xojo provided samples etc are out of date
  • even a lot of the posts & replies in Xojo’s own forum are, up to mid 2019, API 1 code that will require updating to be API 2 compliant

Xojo has chosen to proceed with renaming properties and events anyway

1 Like

Ah this makes more sense now.

How does one determine which classes are part of this interim framework? Is it just everything off of the Xojo namespace or are there other areas to avoid as well?

And therein lies the difficulty as SOME things in API 2 are in the Xojo namespace
Things like Xojo.Point, Xojo.Rect etc will probably remain
If you move away from Xojo.IO, Xojo.Core, and the other sub namespaces in Xojo you’ll be “mostly” ok but not 100% again because some of that IS part of API 2

Its messy as heck

1 Like

Don’t forget there are a number of 3rd party tools, controls and add-ons that don’t play well now due to the changes beyond 2019r1.1

Which is why I pulled all of mine, it wasn’t worth the effort for the little $$ return

1 Like

I am awaiting mor changes like the API1 removals in Xojo 2021 (or so): what will not works anymore in API1 with Apple Silicon hardware will be removed sooner.

A company cannot support two technologies (in that case API1 and API2).

And I suppose that Xojo 2019r1.1 will not works with Apple Silicon.

So, if you want to continue to use Xojo, go the API2 route or start to learn a different tool: do not waste your time with the hope of a return to API1.

I never started to use Xojo New Framework because each time I went there in the LR, I read iOS… and I do not wanted to program for iOS: I still do not have an iOS hardware. This may change in the future, but knowing their prices, I do not believe that.

Sorry to be so realistic.

Have you read the questions from newbies that do not read the LR… lately ?
(in the other forum)

Hmm, I haven’t seen any LR questions in the other forums, but I’ll keep and eye out for them. I actually looked in the LR before posting here and there was info regarding API1 and API2 but not this interim framework.

That is contradictory. You never used the New framewor but now you recommend to adopt the New New framework ASAP?

Is not hope to a return. Is waiting some years to see if stays, or at least to wait for a more stable version.

API 1 is unlikely to be removed
Xojo has said that it will remain in place for years
BUT the IDE will try & steer you to usng API 2 in any NEW projects (unless you override the default project template with one from 2019r1.1 and then you’ll get API 1.0 autocomplete as well)

Years starts with 2 (2 years). Imagine API1 does not works in Apple Silicon ?

They will not update it and then they will remove it.

Of course, it you stay with an Intel based Mac and Xojo 2019r1.1, you will be able to continue “for years” as some do with Carbon or PowerPC…

Xojo have to get new comers AND keep (some) current customer (even if this is not obvious).

New Framework (for me as I can see reading the documentation) was for iOS: that was why I never used it. No contradiction here.

I do not imagine it will be a matter of API1 NOT working with ARM, since Xojo shouldn’t have to rewrite the entire product, just recompile with an ARM LLVM , which they already have. This would be the easiest thing for them, since to “remove” API1 without a great deal of planning (not an Xojo strong suit evidenced by the previous years), it would break more than it would save in the long run.

API 2 would not work either then :slight_smile:

I could explain WHY this is the case but it would take a while

Not really it just started with iOS and never grew as fast or as broadly into desktop etc as it was planned to

That was just your interpretation. Xojo always said that the New framework was for all platforms and users should adopt it asap. iOS being the New platform back then, it was kind of New Framwork only.

This is the same as if you now understand that API2 is just for web just because Web2.0 is anounced to be API2 Only.