Embarcadero CodeRage 2019 is Here !

CodeRage 2019 Full

Embarcadero’s annual on line series of webinars is back again !

This time they’ve changed the format to make it a large number of smaller videos, allowing you to dip in and out much more easily.

There is an overall theme for each week.

 For more about CodeRage 2019 (including the list of each of the active weeks and how to register) go to Jim’s CodeRage2019 Blog

 

Naming arguments and variables: Index and Number

It’s very common to have integers that are used to count objects. It’s also very common to have integers that are offsets into arrays (or similar structures).

Humans tend to count from 1 to n. In almost all cases when software uses offsets it makes sense to design the offset to run from 0 to n-1. Sometimes it is obvious which applies to a variable or function parameter. Sometimes this starts off being obvious but with the passage of time and the increase in the code complexity it becomes less obvious (even to the original code author). I know because I’ve been there.

There are also cases where it may not be so obvious from the start. Suppose you have a function which is passed the user response to the question “which one in this list of items do you want?”. Does the function return “1” if the user want’s the first one in the list or does it return zero?

I strongly encourage the use of the words “Index” in variable names which are expecting 0 to n-1 values and “Number” in variable names which are expecting 1 to n variables.

Thus you might declare the above function as

int GetUserSelectedNumber(void);

if the function returns 1 if the user selects the first item, or

int GetUserSelectedIndex(void);

if the function returns 0 if the user selects the first item.

Similarly if you have three things to control stored in an array, you might write:

const int NumberOfWidgets = 3;
TWidget Widgets[NumberOfWidgets];

and you could have a function somewhere that is declared as

void DoSomethingWithWidget(int WidgetIndex);

This is then immediately clear to everyone that the integer passed must run from 0 to n-1 (ie 0 to 3).

It’s a simple naming convention but it can save you hours when supporting your older (ongoing) code..

Android 64 bit compilation requirements – a possible way around the limitation

As in my posting of Posted on 29th May 2019 it seems that Embarcadero have dropped the ability to compile for 64bit Android from the road map completely.

 This seems disastrous for all C++ Android / Firemonkey developers.

 One of the big names in Embarcadero C++ programming is Remy Lebeau.

He has offered a work around for C++ Android / Firemonkey developers at the following link.

How to get Android 32 bit apps onto google play store

It’s worth pointing out that this is only a short term solution and every C++ Android / Firemonkey developer should still be doing their best to pressurise Embarcadero to reconsider their decision.

 

Embarcadero Latest Road Map (May 2019)

 The latest road map for Embarcadero RAD Studio, C++ Builder and Delphi is now available at the link below.

 Multi-device Delphi users will be impressed with soon-to-be-with-us options and multi-device C++ users may be less impressed with the failure of the C++ side of multi-device development failing to keep up…..

 It’s an interesting read, here’s the link.

Embarcadero Road Map (May 2019)

 

C++ / Delphi with SurveyMonkey and Twilio

Embarcadero RAD Studio (C++ and/or Delphi) provides a convenient set of tools for interfacing to many third party web based APIs. These tools are known as “Enterprise Connectors”.

 In an effort to publicise these useful technologies Embarcadero are running a series of webinars on some of the more common ones

In May 2019 its the turn of the (disparate) pair: SurveyMonkey and Twilio

Click here for more information