Wish Object-Oriented Programming

XverhelstX

Well-Known Member
Licensed User
Longtime User
Hi Erel

At the moment I had to learn different Design Patterns for my exam 'OO Design' and I think it would be interesting to have some more OOP related features to Basic4Android.
It would be great for new programmers to learn those new features and get into OOP or for users familiar with this to incorporate it in their apps.
Also great for bigger companies that could buy B4A as a more OOP related IDE, by still having the simplicity of B4A.

It would be nice to see a couple of the OOP Design Themes into Basic4Android like:

  1. Inheritance (interface, (abstract) class)
  2. Overriding (Annotation?)
  3. Polymorphism (No duck-typing)
  4. Abstraction
  5. Packages
  6. Encapsulation (Already implemented)
  7. Delegation
  8. Optional: Generics
  9. Optional: Unit Testing (Android supports the JUnit Framework)

These would include 2 new modules:
  • Interface
  • Abstract class
These would include 3 new keywords (or more):
  • abstract
  • implements
  • extends

I've written a complete summary about my course (in dutch) about the Design Themes, Design Patterns and Unit Testing which can be found here:
http://rootsoft.barkernetdesign.co.uk/Virtuality/School/SamenvattingOntwerpen.pdf

And if B4A ever gets to the point of implementing this, I will happily translate my summary to English, and port the examples to Basic4Android and write some tuts for it.

Kind regards,
Tomas
 

corwin42

Expert
Licensed User
Longtime User
-1

I don't think we need the most of these features in B4A.

The main reason I use B4A is that it is a very simple language. Most features that make sense are in there but it is not bloated with advanced and complicated features and design patterns. The goal of B4A is to give the developer a tool to write advanced programs in very short time even for the beginning developer.

If I want to use all of these patterns I would program directly in Java.
 

qsrtech

Active Member
Licensed User
Longtime User
-1

I don't think we need the most of these features in B4A.

The main reason I use B4A is that it is a very simple language. Most features that make sense are in there but it is not bloated with advanced and complicated features and design patterns. The goal of B4A is to give the developer a tool to write advanced programs in very short time even for the beginning developer.

If I want to use all of these patterns I would program directly in Java.

I have to respectfully disagree with you. As android becomes more mature and mainstream, there will be alot of pressure to develop/convert a lot of "apps" that will require a lot of "advanced" highly scalable and reusable code. I'm pretty sure the idea of b4a was to attract the millions of VBer's to build android fairly easily and not have to learn a whole new language, I.e. Java. B4a has done a pretty good job at that and since I signed up two years ago it has matured significantly (i.e. hobbyist like before), unfortunately it does have a fair bit to go before it will go mainstream. (b4IOS could be a big part of that. I personally don't like the closed apple model). The more mainstream b4a becomes, the more it will fuel it's growth through larger contributions from the massive user base it could have. Early adopters of b4a could benefit tremendously if it goes mainstream.

Hey I think we should be getting shares! Maybe 1 (one) share for every year?
 
Last edited:

antonomase

Active Member
Licensed User
Longtime User
B4A is usefull because B4A is simple.
If you want to have all the possibilities of Java, use Java.
 

LucaMs

Expert
Licensed User
Longtime User
B4A is usefull because B4A is simple.
If you want to have all the possibilities of Java, use Java.


I do not agree.

The ideal tool should be simple but powerful.
You should be able to use it using its simple functions but also its most complex.

But I think that is very complex to implement what Tomas has required (although it would be useful)
 

qsrtech

Active Member
Licensed User
Longtime User
antonomase, post: 218531, member: 48659"]B4A is usefull because B4A is simple.
If you want to have all the possibilities of Java, use Java.
Lol. B4a is far from simple if you want to do anything usefull. Most of it's underlying power comes from libraries. The only thing really "simple " about b4a is it's syntax and similarity to VB.
 

sorex

Expert
Licensed User
Longtime User
I agree that adding too much of the requested stuff would

1. need a serious rewrite for a few people who would use it
2. make B4A look complex like the rest so people would skip it

if you are a bad coder your apps will still be bad if you add OO or other "theoretically usefull" features.
 

antonomase

Active Member
Licensed User
Longtime User
Lol. B4a is far from simple if you want to do anything usefull. Most of it's underlying power comes from libraries. The only thing really "simple " about b4a is it's syntax and similarity to VB.

Yes. I was talking about syntax. You can start an application with just 3 lines of code.
In Java/Android, you must write dozens of lines just for "Hello World"

If Tomas needs abstract class, final class, polymorphism, try and catch, packages, extends, implements, ... the best way is to use Java. If B4A becomes as complex as Java, with the same possibilities of Java, with the same architecture as Java, I think it's better to use the original rather than the copy.

The first versions of Visual Basic where very simple (and very powerfull) until V6 : but when Visual Basic becomes VB.net; it loose its simplicity and its power.
 

thedesolatesoul

Expert
Licensed User
Longtime User
If I want to use all of these patterns I would program directly in Java.
B4A is usefull because B4A is simple.
If you want to have all the possibilities of Java, use Java.

I keep seeing these comments. Use Java, Use Java, Use Java. ??????
There are so many reasons to use B4A, the answer to every feature request is not to use Java. Its not a valid retort to a feature addition request.

I agree that adding too much of the requested stuff would

1. need a serious rewrite for a few people who would use it
2. make B4A look complex like the rest so people would skip it
This is the most valid concern. When classes were introduced, I thought I would never use them.
But using them refactored my code so far down, I can write reusable code within minutes, and a lot less bugs. I can show you the first versions of my code and the code with classes and there is no doubt in my mind that classes is the way to go.

The real art is to implement the 'advanced' features in a way that it doesnt come in the way of the 'simple' users.
For e.g. I never use Designer Scripts, but its an awesome feature that is there, it never comes in my way.

if you are a bad coder your apps will still be bad if you add OO or other "theoretically usefull" features.
This comment makes no sense. If you are a bad coder, you will still be bad with basic stuff.
The question is what will limit you if you are a good coder?
 

qsrtech

Active Member
Licensed User
Longtime User
You can start an application with just 3 lines of code.
In Java/Android, you must write dozens of lines just for "Hello World"

I can do that right now with delphi and compile it for iOS, android, win32 and MAC so I'm a little torn right now to continue investing in b4a or migrate back to delphi. B4a just needs a little more ide/language/designer enhancements and it would definitely be the clear winner, unless delphi fills in some big holes like "services" and a few others.

EDIT: I should add with android emulators getting better (i.e. genymotion), porting to windows may not be really needed much anymore, now iOS, that could still be an issue.
 
Last edited:

JakeBullet70

Well-Known Member
Licensed User
Longtime User
I admit I would like to see a few of those advanced features but...

I see B4A as RAD for Android. Something Java is not. That's why I use it.
 

qsrtech

Active Member
Licensed User
Longtime User
For those of you that are against evolution you better not add too many features to your apps or you won't get many users cause it will be too complicated for them. Better yet, stick to windows cause android is constantly evolving.

PS. When decked out b4a 4.0 comes out you don't have to upgrade...
 
Last edited:

LucaMs

Expert
Licensed User
Longtime User
Maybe this is not the place to discuss what you wrote.

Follow the technological evolution is not easy, but that's not the question, since the object-oriented programming has now about twenty years!

As I wrote, it would be useful also in B4A, but I do not think that is achievable in a month!

And it would not prevent use the "most basic" functionality of the platform
 

qsrtech

Active Member
Licensed User
Longtime User
you think you got big and numerous problems!?
 

Antony Danby

Member
Licensed User
Longtime User
I've read this whole article and find it all rather amusing; not having a pop at anyone honest. I tend to fall down on the side on desolatesoul and qsrtech. I think B4A still has a way to evolve and it would be nice to see proper polymoric classes, not so sure about abstraction right now. Some nice eventing features would be good. But so far I am fairly happy with what I am seeing. Let's all be patient folks and sit back; relax and enjoy the journey. When I first started coding in Delphi in '95 Delphi 1 was pants in comparison to what we have now; we all get misty eyed and nostalgic, but honestly it was great and ground breaking but had a "long way to go" and this is exactly where I see B4A. None of those features are going to be implemented overnight, so you can all scream and make a fuss all you want but great compilers/IDE's take time to become great. Me, I am in for the long haul. I believe Androind will outlive IOS, but that's just my opinion and I think B4A has started right and will mature over the years to come.
 

FernandoMassa

Member
Licensed User
Longtime User
I can show you the first versions of my code and the code with classes and there is no doubt in my mind that classes is the way to go.

I would like to see. would you send me by email or something?
It's good a language to be able to make a simple code and another striker, that does not mean that someone is forced to use what is advanced.
I'm trying to get better and improve myself every day more. I appreciate your help.
sorry English Google-translator. I understand English well to read but to write'm not very good. If you speak Spanish or Portuguese, I prefer.
 
Top