{Wish} Consistency

Vader

Well-Known Member
Licensed User
Longtime User
Can we have some consistency applied to the language?

What I mean is that like they did with .NET, all string properties that were the text displayed, were renamed to "Text"
And all integer properties that were used to show the length or size, were changed to "Length"

I realise that these would be breaking changes, so can we have additional properties added to correct this deficiency (this time around), and sometime in the distant future you could remove the deprecated properties (maybe version 3.0?).

To assist people with this change, I would then put in the comments for the deprecated properties something like [DEPRECATED - Use 'Length' instead]

The benefits of this is the same as .NET - we wouldn't have to think "Oh, this type expects "Size" to tell me the number of elements it has, whereas this type needs "Length" to show me how long it is.
/End rant

Dave
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
What I mean is that like they did with .NET, all string properties that were the text displayed, were renamed to "Text"
And all integer properties that were used to show the length or size, were changed to "Length"
C#:
ArrayList.Count
String[] s; s.Length

Java:
ArrayList.Size
String[] s;s.length

B4A:
List.Size
Dim s() As String : s.Length
 

Vader

Well-Known Member
Licensed User
Longtime User
C#:
ArrayList.Count
String[] s; s.Length

Java:
ArrayList.Size
String[] s;s.length

B4A:
List.Size
Dim s() As String : s.Length

Touché

Ok, so other than the fact you made me look like an idiot there ( :signOops: :p) you don't agree that it is a good idea?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Breaking existing code is never a good idea...

As Basic4android is close to Java, I decided to use the same methods as in Java in this case. It could have been Size for both arrays and lists. However once it was designed this way it cannot be changed.

Can we have some consistency applied to the language?
I admit that I don't like such statements. Is Basic4android generally an inconsistent language / framework? I don't think so.

You can say this specific feature is inconsistent.
 

Vader

Well-Known Member
Licensed User
Longtime User
Thanks for being honest. I'll try and shutup and just put up with it
:sign0013:
 
Top