API 2.0 more difficult?

Definitely a lot of things should have happened with the Xojo framework but they didnt for a myriad of reasons
And that did make life harder than it should have been

1 Like

I’d say don’t bother with Text or xojo.anything. Since API2 I’ve dumped all that.

1 Like

Much as I dislike it this is decent advice
Xojo is moving back to the “everything in a global namespace” model and is “fixing” the underpinnings of some, like folderitem and string, to newer api’s

1 Like

I’d argue that a lot of this comes down to poor documentation. Blog posts are all very well, but you have to know they are there. Much better to distill the essence and update the docs accordingly. The examples are often poor, too. The docs should perhaps have FAQ sections or user contributions rather like the PHP docs. As for define/convertencoding, do they modify the string they’re applied to or are they just properties of the string? Why do I need them? The docs do a poor job of explaining such Q’s as these. IMO.

With datetime, I got rid of my own subclass of date to which I’d added SecondsFrom1970. And by only using String, I was no longer converting to/from Text/String all the time, just because one or the other was missing some useful method. Instead, I’ve simply implemented my own, such as decodeQP and decode64. And realised that a String doesn’t actually have to have a TextEncoding, until it needs one. :wink:

Personally I’d say it comes down to the data type being dual natured.
That it can be treated as a bag of raw bytes & as textual data at the same time is where most of the bugs come from.
You can intermix Chr() and ChrB() with string and they have very different meaning and effect
Same with all the other B and non-B methods

Text and memoryblock got rid of that - bytes were bytes and NOT textual data unless you converted it, explicitly, to BE some kind of textual data and vice versa

String is dual natured. But my data (emails) comes in without encoding and I need to make nicely encoded result. I would need all string functions also for memoryblock. There isn’t even a regex for memoryblock or an API2 version of regex. And my algorithm for parsing emails is really really complex.

sure - I’m just saying that some of the most common bugs we’d get reported had everything to do with this dual nature
if you understand it you can make it work

in your case your taking “runs of bytes” and turning it into “properly encoded TEXTual data”

I downloaded Swift for Windows recently…

Swift for any platform other than an Apple one is still to immature to create a fully working app, without resorting to other means to build and connect the GUI portions