It is currently Sun Jun 25, 2017 8:46 pm

Welcome to rfobasic

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. In addition, registered members also see less advertisements. Registration is fast, simple, and absolutely free, so please, join our community today. **You are not required to provide truthful information to any registration questions. Be whomever you wish to be.!

Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: RFO Designer - quick question
Unread postPosted: Fri Feb 03, 2017 6:03 pm 
User avatar

Joined: Sat Mar 26, 2016 9:23 am
Posts: 94

Simple question with a probably difficult answer.
And if the answer is no way - no how, I'll accept it as a valid honest answer...

Question is this -
would it be possible to have RFODESIGNER remove excess unused source code in a generated program?
I don't know the program well enough to be able to tell what a generated program uses.
And, as we discussed before ( :) ) there is a bit of it...

Just wondering if it could automatically delete (or not write?) things it doesn't actually use.

Not picking - just asking, okay?


 Post subject: Re: RFO Designer - quick question
Unread postPosted: Sat Feb 04, 2017 4:14 pm 
User avatar

Joined: Sat Oct 04, 2014 5:45 am
Posts: 653
There can be no short answer because the request could be user dependent.
So my reply is not so much to answer Richard but rather to give some depth to
other users as to why RfoDesigner generates the Framework as is today.

One reason for a NO answer could be seen that I am just lazy :)
But hey my job is to be lazy. It is not easy to be retired !

Some Background :
RfoDesigner is a tool for BASIC! and the purpose is to generate quick working apps by the novice and the pro.
I learned BASIC! by developing RfoDesigner which is written in RapidQ Basic for Windows.
I feel more for the needs of the novice because they are the future pro's for BASIC!
I have a flood of emails from non registered users for help/support, young, old, novice, engineers etc.
In the process I pick up a lot of tips as well and my hindsight is widened regarding RfoDesigner's success/failure.
The FRAMEWORK is a trade off and tested. The framework does have some bloated code and this is what the
subject is about what Richard refers to.

Description of the Framework format :
The graphics is initialized for Portrait/Landscape/Sensor mode scaled at a designer screen size as required
by the user. Drawing of the UI objects is on an element per line basis so as to expose the coordinates and DISPLAY LIST
for the user's eye to be able to refer back and modify those elements without creating new ones. Then the
application goes into the main program loop that contains the polling of scaled screen touches and strategically
placed GoSub directives that would branch to user code that is unique to the user's app. A polling of screen
touches is used because BASIC! does not have real interrupts thus preventing some unexpected "hangs". The user
would apply further touch routines at strategic positions to further his goal. Thus he could use the "ONGRTOUCH"
interrupt to try get himself out of a tight spot where he painted himself into. Advantage of polling touches is that
you are sure that every touch is recorded and every BASIC! function or command is serviced.

Why remove bloat code :
Bloated code is extra and unused code that is not needed for the application and serve no purpose other than
giving you more lines of code to scroll through. The bloated code in RfoDesigner comes to the same as if you
had an "INCLUDE" file included. So effectively we can say RfoDesigner has a built in include file.
This bloated code's purpose is to have as many options available in the main program loop. I can not predict
what the user require unless I make a RfoDesigner with a unfriendly learning curve.
Bloated code could also be seen as for example

If MyGrandMothersAge = TheAverageOldAgeReached Then
   RiskOfDying = Possible
End If


If MyGrandMothersAge = TheAverageOldAgeReached Then : RiskOfDieing = Possible : End If


If Age = Average Then : Risk = Pos : End If


If a = b Then : c = d : End If



It is obvious which version is more readable and a trade off is thus required that will depend on the user's
skills and intellect.

The user is a NOVICE :
Typically for a newbie his first experience will be the deciding factors if he would pursue using RfoDesigner.
Same would apply for using plain BASIC! in any editor.
The Novice would put a few objects (Buttons Bitmaps Text) on the design screen with his mouse and modifying
the colors and sizes and compile the APK with RFO2APK with the compile button. He would now be taken to the APK
file which he could send to his phone via Bluetooth or run on BlueStacks if it is installed. So he has immediate
results and feels proud and accomplished. He has no idea of bloated code. He only sees his fantastic app and
is ready to go for his first major one. Some novices only have the intention to program games and is soon
disappointed and will also be with other languages than BASIC! because to program a game is not for the novice.
This is sad but true.

The user is NOVICE upgraded :
He reads and followed the path of the RfoDesigner generated code and understands what must be done to create
multiple screens (Switching between Display Lists) and can display "Hello World" when touching a button etc.

The user likes RfoDesigner :
He copies and paste sections of the example code included in BASIC! app. He gets to display time in Hrs:Min:Sec
He is able to read the phone sensors. He will discover GPS and fail because he is inside a building and he is confident
the code is the culprit. He discovers that there is bloated code. But for now he is happy because he is getting somewhere
He sends me emails for support. I help where I can but encourage all to join the forum.

He is making apps for just about anything requiring a UI. RfoDesigner helps to get him going in a snap. The bloat code
still has no impact on him but only serves as a nuisance to scroll past them. He soon realize but there is built
in features in RfoDesigner that is not documented to jump/navigate to the sections he is working with. He understands
that RfoDesigner Framework is based on modular programming, being the extensive use of Subroutines. He wonders why
Functions does not feature in RfoDesigner. He soon discover that variables are global in
all of his code except in Functions. He discover the Bundle Nr1 trick. He uses this in exceptional cases.
He makes use of Functions included in an "INCLUDE FILE" under the appropriate Subroutine.

The user is a PRO :
It does not matter if he uses RfoDesigner or not. It all depends on what he wants to do. He is capable of programming games
He is capable of removing bloat and understands the consequences. He would often write code consisting of just a
few lines with not that many other users coming to grip what is happening. He is able to modify the PRJ file
by hand to his requirements because RfoDesigner does not give him an option to do that.
He runs 2 or 3 RfoDesigners at the same time and cut and paste between them to do the impossible in the eyes
of the "HAVE SEEN THE LIGHT". He does no more worry about screen width and height. He knows his code fits all whether
it was designed for a samll or a large screen.

What about the ANSWER :
When YES I mean that once you understand the workings of RfoDesigner, you require no effort to remove Bloat code manually.
You understand that you will have a backup copy that is bloated so as not to break your code when you maintain it.
You understand that I have reasons for the bloat and that laziness is not one of them.
When I change RfoDesigner to remove bloat by means of an option setup then the code framework will alternate
between just a GUI drawing tool and the Framework as is today. But cant we have something different where we can choose
what to do ? Then Rfodesigner would become so complex that it would serve no purpose for the majority and
pose a huge learning curve. Then it would be easier for the user to just use Notepad :(

When the answer is NO then I feel that the majority users and I specifically refer to the many engineering students
that use it have a real chance of effortlessly getting something done without their studies suffering because of a learning
curve in RfoDesigner. I feel that RfoDesigner as is serves its purpose and that other requirements require a completely
new application with a different name.

What do I want to hear :
I am open to suggestions to how the framework can be changed to make things even more easier for the novice.
No suggestion is rejected. It is considered and not seen as junk. Even the novice can have a suggestion.
That also lets me experience the other side of the coin.
Currently long and understandable variable names, spaces, new lines, blank lines and comments are used to serve
the readability which is paramount in my view for the advance of BASIC!.
I am aware that a really good video tutorial on RfoDesigner is required to show off all the hidden things and tricks.

Richard I am sorry that I can not satisfy you in this bloated code thing. You are welcome to PM me then I can give
directions for you. If I do this here then I could create confusion and unnecessary debate.

I also encourage new users of BASIC! to not give up too quickly. BASIC! is the easiest way to create your own apps
for Android and joining the forum would be a very good choice. Nobody will bite your head off over here.

Download and tutorial for RFODESIGNER

 Post subject: Re: RFO Designer - quick question
Unread postPosted: Sat Feb 04, 2017 10:31 pm 
User avatar

Joined: Sat Mar 26, 2016 9:23 am
Posts: 94
That was pretty much the answer I expected - and a solid explanation of why.
I respect that...

The only suggestion I cold make is possibly a verbosity switch that would give the
user the choice. But I'll wait until after I see what's involved before I make that one.

Check pm?

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: