My wishes for future versions of B4A

IanMc

Well-Known Member
Licensed User
Longtime User
I'd like to see advances in the syntax much as seen in the C# language.

For example, when Dimming variables we usually do

Dim i as Int

but really just

Int i would be enough information for B4A to do it's job.

The same with the other types

String myString

etc. Then we could populate the variables in one go, while we can already do this:

Dim myString AS String : myString = "This is my string"

it would be a lot less typing to simply do:

String myString = "This is my string"

Taking this further you can declare a whole load of variables and populate some of them.

Int i, j, k = 5, l, m = 200

String monday = "monday", tuesday = "tuesday", wed, thu, fri

Then there is concatenation, many of the other languages (including PowerBASIC) allow the use of the plus sign + to add two strings together (instead of only using the ampersand '&' as B4A currently does) then we could have the function 'plus-equals' which really cuts down on typing so instead of something like:

myVeryLongStringName = myVeryLongStringName & " a bit more string"

we can simply type:

myVeryLongStringName += " a bit more string"

or

i += 10

Optional parameters:
The 'old' way of programming classes mean't overriding methods each and everytime you wanted to provide a different method signature, that is if you for example had a method like:

MyClass.MyMethod(int, int, boolean)

but then you wanted one with (int, int, string, boolean) well then you'd have to make a new override for that method. You end up with some methods having lots of overrides.
Indeed we can see in B4A that we're getting things like SubName2 SubName3 etc.

Then later versions of some of the more advanced languages have the Optional parameters, basically when you write the method you dictate if any of the parameters may be optional with the Opt keyword so
MyMethod(i as int, Opt j as int, Opt s as string, b as Boolean)
Then you can figure out which 'override' method is wanted (how to run the method) by which parameters have been provided instead of making lots of almost identical override copies of the method.

I think what could really make B4A stand out and have employment agencies start asking for B4A programmers is if B4A could excell in the graphics department.

As it stands I think the choice of 'views' in B4A is rather limited, just a few of the basic views available, no snazzy graphics unless you program them yourself or use someone else's code, such as code for vertical seekbars etc.

Programming new controls (views) is a bit advanced for the newbie, even using other's views is a bit advanced.

It would be nice to have built-in snazzy views, seekbars, meters, wheels lots of ideas there :) It would be nice if each time Erel released an upgrade for B4A there were one or two more views for us to play with :)
 

sorex

Expert
Licensed User
Longtime User
I would stick to the dim'ing like it is now.

but I also mis some operants like

myvar++
myvar+=2
myvar*=-1

etc as used in actionscript (Flash) and most C variants, it's indeed a time saver typewise when you're used to it.
 

IanMc

Well-Known Member
Licensed User
Longtime User
Ah, didn't realise you could assign a value in the same statement :)

cool.

I have read the beginners guide, honest ;)

still s += "a bit more string" would be nice, and

String s = "abc" is two keywords shorter than present :)

just a few ideas for you to ponder.
 

NeoTechni

Well-Known Member
Licensed User
Longtime User
Id kill for optional parameters

I even made an equation evaluator in B4A for a scripting engine that supports optional parameters
 
Top