Updating deprecated code

I decided to turn on the Project | Analysis Warnings for deprecated code items and was surprised to find that my program had around 400 bits of deprecated code in it. My initial reaction was “yikes!” but I wanted to familiarize myself with API-2.0 so I dove in and made all of the necessary changes.

In retrospect, I really like the changes made in API-2.0. The naming conventions are more consistent and the code reads well.

Has anyone else made the transition to API-2.0? What are your impressions?

-Wes

I’ve transitioned all but two of my projects and also like the API2 conventions. It was a chore doing the conversions but having the old code to verify functionality against made things go fairly smoothly, if lengthy. Plus, it “forced” me to rethink some of my code and got me to utilize Try/Catch more consistently. I do miss the ability to change the Date object values directly, but that’s minor. It would be nice to be able to add two DateIntervals together without an intervening step but, again, that’s minor. Now to be honest, I’m talking about projects in the low 10Ks of lines, not million row projects.

The only two of my projects I haven’t transitioned have to be compiled for 32-bit mode (I do exclusively 64-bit now) which along with a few other quirks make it unlikely I’ll do them.

400 deprecated items aren’t very much. I think I started with 10k. How large is your project? Do you also have “Item 1 is deprecated. You should use item 2” on?

Changing most of the code isn’t a problem. Date to DateTime is quite annoying. I need to bother the Valentina folks so that they add DateTime.

Wow I’d kill for 10K
Have one client code base that is slowly being updated using 2019r3.1 and its still well over 30K deprecation warnings

My memory muscle has now adjusted to the new nomenclature and I now start typing Var, RowSet, SelectSQL and Ubound with ease.

I’m now also using most of the hew stuff with easy. But why is anyone using the silly var?

Because changing dim, Dim, followed by one or more spaces was easy to normalise to Var followed by two spaces. And because it’s what I use in my javascript stuff.

I recently updated all the database (MySQL) related code in my large app. Took about 2 days to get though it all. It was also a good opportunity to review and fix where needed all the code for proper error handling.

Honestly , I just … dont wanna… :frowning:

Its a very large app
Probably more code in it than the IDE itself (based on my recollection of the IDE code base)

I do since it goes back to the dark ages of my programming where VAR was used to declare variables and DIM was used to dimension arrays. I still use it that way.

Thanks… now I’m suffering from small application size anxiety. :frowning:

Yes, I have the warnings turned on. How do I get a measure of the size of an application? Is there a line-count somewhere in Xojo that tells you the size of your application?

My application warnings included: file, database, serial, string and date issues. Some where really easy to correct while others where head-scratchers that required some code restructuring. But in the end, I liked the results.

Well, others have reported that their apps take 5-7 minutes to build.

You can do a line count in Arbed with a script called “Statistics”.

Here is my main project:
Code lines: 74402 (34142 distinct ones)
Comment lines: 19204
Empty lines: 19184
Total lines: 112790