# API1, API2 & Xojo.Core Question

**URL:** <https://ifnotnil.com/t/api1-api2-xojo-core-question/831>\
**Category:** General Programming\
**Created:** [8 August 2020 22:40 UTC](https://ifnotnil.com/t/api1-api2-xojo-core-question/831 "2020-08-08T22:40:42Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![npalardy](https://ifnotnil.com/user_avatar/ifnotnil.com/npalardy/32/10_2.png) [@npalardy](https://ifnotnil.com/u/npalardy)\
**Post date:** [9 August 2020 16:26 UTC](https://ifnotnil.com/t/api1-api2-xojo-core-question/831/21 "2020-08-09T16:26:34Z")

</div>

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

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

and there’s not replacement for that using something like

```auto
   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

---

<div class="post-metadata">

**Author:** ![DaveS](https://ifnotnil.com/user_avatar/ifnotnil.com/daves/32/79_2.png) [@DaveS](https://ifnotnil.com/u/DaveS)\
**Post date:** [9 August 2020 16:28 UTC](https://ifnotnil.com/t/api1-api2-xojo-core-question/831/22 "2020-08-09T16:28:39Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![npalardy](https://ifnotnil.com/user_avatar/ifnotnil.com/npalardy/32/10_2.png) [@npalardy](https://ifnotnil.com/u/npalardy)\
**Post date:** [9 August 2020 16:29 UTC](https://ifnotnil.com/t/api1-api2-xojo-core-question/831/23 "2020-08-09T16:29:44Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![npalardy](https://ifnotnil.com/user_avatar/ifnotnil.com/npalardy/32/10_2.png) [@npalardy](https://ifnotnil.com/u/npalardy)\
**Post date:** [9 August 2020 16:31 UTC](https://ifnotnil.com/t/api1-api2-xojo-core-question/831/24 "2020-08-09T16:31:52Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![npalardy](https://ifnotnil.com/user_avatar/ifnotnil.com/npalardy/32/10_2.png) [@npalardy](https://ifnotnil.com/u/npalardy)\
**Post date:** [9 August 2020 16:40 UTC](https://ifnotnil.com/t/api1-api2-xojo-core-question/831/25 "2020-08-09T16:40:34Z")

</div>

Geoff mention the new controls in desktop  
https://www.youtube.com/embed/oi5MCrDlpsg?feature=oembed&wmode=opaque&list=PLPoq910Q9jXiPu7F9x8C6gtAmDbb26oWR&start=776

And Geoff mentions this in the Q & A Video  
https://www.youtube.com/embed/0QVRI2hEezE?feature=oembed&wmode=opaque&list=PLPoq910Q9jXiPu7F9x8C6gtAmDbb26oWR&start=1179

---

<div class="post-metadata">

**Author:** ![ivan](https://ifnotnil.com/letter_avatar_proxy/v4/letter/i/df788c/32.png) [@ivan](https://ifnotnil.com/u/ivan)\
**Post date:** [9 August 2020 17:34 UTC](https://ifnotnil.com/t/api1-api2-xojo-core-question/831/26 "2020-08-09T17:34:02Z")

</div>

> [@DaveS](#):
>
> The fact that Geoff ultimately agreed, and is now rescinding that … well I’m at a loss as to what to say.

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** 🤣 🤣 🤣 🤣

---

<div class="post-metadata">

**Author:** ![npalardy](https://ifnotnil.com/user_avatar/ifnotnil.com/npalardy/32/10_2.png) [@npalardy](https://ifnotnil.com/u/npalardy)\
**Post date:** [9 August 2020 18:37 UTC](https://ifnotnil.com/t/api1-api2-xojo-core-question/831/27 "2020-08-09T18:37:53Z")

</div>

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](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

---

<div class="post-metadata">

**Author:** ![PatrickSalo](https://ifnotnil.com/user_avatar/ifnotnil.com/patricksalo/32/670_2.png) [@PatrickSalo](https://ifnotnil.com/u/PatrickSalo)\
**Post date:** [9 August 2020 21:01 UTC](https://ifnotnil.com/t/api1-api2-xojo-core-question/831/28 "2020-08-09T21:01:03Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![npalardy](https://ifnotnil.com/user_avatar/ifnotnil.com/npalardy/32/10_2.png) [@npalardy](https://ifnotnil.com/u/npalardy)\
**Post date:** [10 August 2020 01:39 UTC](https://ifnotnil.com/t/api1-api2-xojo-core-question/831/30 "2020-08-10T01:39:21Z")

</div>

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

> [@](#):
>
> Wow, I didn’t mean to open a can of worms here.

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

---

<div class="post-metadata">

**Author:** ![PatrickSalo](https://ifnotnil.com/user_avatar/ifnotnil.com/patricksalo/32/670_2.png) [@PatrickSalo](https://ifnotnil.com/u/PatrickSalo)\
**Post date:** [10 August 2020 01:44 UTC](https://ifnotnil.com/t/api1-api2-xojo-core-question/831/31 "2020-08-10T01:44:10Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![npalardy](https://ifnotnil.com/user_avatar/ifnotnil.com/npalardy/32/10_2.png) [@npalardy](https://ifnotnil.com/u/npalardy)\
**Post date:** [10 August 2020 01:48 UTC](https://ifnotnil.com/t/api1-api2-xojo-core-question/831/32 "2020-08-10T01:48:35Z")

</div>

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](http://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

---

<div class="post-metadata">

**Author:** ![DaveS](https://ifnotnil.com/user_avatar/ifnotnil.com/daves/32/79_2.png) [@DaveS](https://ifnotnil.com/u/DaveS)\
**Post date:** [10 August 2020 02:08 UTC](https://ifnotnil.com/t/api1-api2-xojo-core-question/831/33 "2020-08-10T02:08:32Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Emile](https://ifnotnil.com/letter_avatar_proxy/v4/letter/e/58956e/32.png) [@Emile](https://ifnotnil.com/u/Emile)\
**Post date:** [10 August 2020 06:01 UTC](https://ifnotnil.com/t/api1-api2-xojo-core-question/831/34 "2020-08-10T06:01:02Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![PatrickSalo](https://ifnotnil.com/user_avatar/ifnotnil.com/patricksalo/32/670_2.png) [@PatrickSalo](https://ifnotnil.com/u/PatrickSalo)\
**Post date:** [10 August 2020 06:43 UTC](https://ifnotnil.com/t/api1-api2-xojo-core-question/831/35 "2020-08-10T06:43:27Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ivan](https://ifnotnil.com/letter_avatar_proxy/v4/letter/i/df788c/32.png) [@ivan](https://ifnotnil.com/u/ivan)\
**Post date:** [10 August 2020 14:28 UTC](https://ifnotnil.com/t/api1-api2-xojo-core-question/831/36 "2020-08-10T14:28:09Z")

</div>

> [@Emile](#):
>
> 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

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

> [@Emile](#):
>
> do not waste your time with the hope of a return to API1.

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

---

<div class="post-metadata">

**Author:** ![npalardy](https://ifnotnil.com/user_avatar/ifnotnil.com/npalardy/32/10_2.png) [@npalardy](https://ifnotnil.com/u/npalardy)\
**Post date:** [10 August 2020 14:41 UTC](https://ifnotnil.com/t/api1-api2-xojo-core-question/831/37 "2020-08-10T14:41:38Z")

</div>

> [@Emile](#):
>
> 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.

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)

---

<div class="post-metadata">

**Author:** ![Emile](https://ifnotnil.com/letter_avatar_proxy/v4/letter/e/58956e/32.png) [@Emile](https://ifnotnil.com/u/Emile)\
**Post date:** [10 August 2020 14:47 UTC](https://ifnotnil.com/t/api1-api2-xojo-core-question/831/38 "2020-08-10T14:47:19Z")

</div>

> [@npalardy](#):
>
> Xojo has said that it will remain in place for years

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.

---

<div class="post-metadata">

**Author:** ![DaveS](https://ifnotnil.com/user_avatar/ifnotnil.com/daves/32/79_2.png) [@DaveS](https://ifnotnil.com/u/DaveS)\
**Post date:** [10 August 2020 15:01 UTC](https://ifnotnil.com/t/api1-api2-xojo-core-question/831/39 "2020-08-10T15:01:58Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![npalardy](https://ifnotnil.com/user_avatar/ifnotnil.com/npalardy/32/10_2.png) [@npalardy](https://ifnotnil.com/u/npalardy)\
**Post date:** [10 August 2020 15:30 UTC](https://ifnotnil.com/t/api1-api2-xojo-core-question/831/40 "2020-08-10T15:30:11Z")

</div>

> [@Emile](#):
>
> Years starts with 2 (2 years). Imagine API1 does not works in Apple Silicon ?

API 2 would not work either then 🙂

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

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

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

---

<div class="post-metadata">

**Author:** ![ivan](https://ifnotnil.com/letter_avatar_proxy/v4/letter/i/df788c/32.png) [@ivan](https://ifnotnil.com/u/ivan)\
**Post date:** [10 August 2020 16:09 UTC](https://ifnotnil.com/t/api1-api2-xojo-core-question/831/41 "2020-08-10T16:09:23Z")

</div>

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

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.

[Previous page](https://ifnotnil.com/t/api1-api2-xojo-core-question/831.md?page=1)

[Next page](https://ifnotnil.com/t/api1-api2-xojo-core-question/831.md?page=3)
